com.typhoon.unitysdk 1.0.4 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -7,7 +7,9 @@ namespace TyphoonUnitySDK
|
|
|
7
7
|
public class PublishVivoBatSetting : ScriptableObject
|
|
8
8
|
{
|
|
9
9
|
[Header("安卓发布工具项目路径")] public string AndroidPublishProj;
|
|
10
|
-
[Header("基本参数")] public
|
|
10
|
+
[Header("基本参数")] public bool DebugMode = true;
|
|
11
|
+
public bool Portrait = true;
|
|
12
|
+
public string GameName;
|
|
11
13
|
public Texture Icon;
|
|
12
14
|
public string PackageName;
|
|
13
15
|
public string AppId;
|
|
@@ -27,7 +29,7 @@ namespace TyphoonUnitySDK
|
|
|
27
29
|
public string BannerID;
|
|
28
30
|
|
|
29
31
|
[Header("版本号")] public string Version = "1.0.0.0";
|
|
30
|
-
|
|
32
|
+
public int VersionCode = 1000000;
|
|
31
33
|
private static string PATH = "Assets/Editor/PublishVivoBatSetting.asset";
|
|
32
34
|
|
|
33
35
|
public static PublishVivoBatSetting _default = null;
|
|
@@ -17,9 +17,10 @@ namespace TyphoonUnitySDK
|
|
|
17
17
|
apply plugin: 'com.android.application'
|
|
18
18
|
|
|
19
19
|
android {
|
|
20
|
-
compileSdkVersion
|
|
20
|
+
compileSdkVersion 30
|
|
21
21
|
buildToolsVersion '30.0.3'
|
|
22
22
|
|
|
23
|
+
|
|
23
24
|
compileOptions {
|
|
24
25
|
sourceCompatibility JavaVersion.VERSION_1_8
|
|
25
26
|
targetCompatibility JavaVersion.VERSION_1_8
|
|
@@ -47,15 +48,17 @@ android {
|
|
|
47
48
|
|
|
48
49
|
defaultConfig {
|
|
49
50
|
minSdkVersion 21
|
|
50
|
-
targetSdkVersion
|
|
51
|
+
targetSdkVersion 30
|
|
52
|
+
versionCode $VERSION_CODE
|
|
53
|
+
versionName '$VERSION_NAME'
|
|
51
54
|
applicationId '$APPLICATION_ID'
|
|
55
|
+
consumerProguardFiles ""consumer-rules.pro""
|
|
52
56
|
ndk {
|
|
53
57
|
abiFilters 'armeabi-v7a', 'arm64-v8a'
|
|
54
58
|
}
|
|
55
|
-
versionCode $VERSION_CODE
|
|
56
|
-
versionName '$VERSION_NAME'
|
|
57
59
|
}
|
|
58
60
|
|
|
61
|
+
|
|
59
62
|
//发布的包名
|
|
60
63
|
applicationVariants.all { variant ->
|
|
61
64
|
variant.outputs.all {
|
|
@@ -68,6 +71,7 @@ android {
|
|
|
68
71
|
}
|
|
69
72
|
|
|
70
73
|
|
|
74
|
+
|
|
71
75
|
sourceSets {
|
|
72
76
|
main {
|
|
73
77
|
jniLibs.srcDirs = ['libs']
|
|
@@ -87,15 +91,15 @@ android {
|
|
|
87
91
|
debug {
|
|
88
92
|
minifyEnabled false
|
|
89
93
|
useProguard false
|
|
90
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
94
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro',getDefaultProguardFile('proguard-android-optimize.txt')
|
|
91
95
|
signingConfig signingConfigs.debug
|
|
92
96
|
jniDebuggable true
|
|
93
97
|
}
|
|
94
98
|
release {
|
|
95
99
|
minifyEnabled false
|
|
96
100
|
useProguard false
|
|
97
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
98
|
-
|
|
101
|
+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro',getDefaultProguardFile('proguard-android-optimize.txt')
|
|
102
|
+
signingConfig signingConfigs.release
|
|
99
103
|
|
|
100
104
|
}
|
|
101
105
|
}
|
|
@@ -104,6 +108,9 @@ android {
|
|
|
104
108
|
doNotStrip '*/armeabi-v7a/*.so'
|
|
105
109
|
doNotStrip '*/arm64-v8a/*.so'
|
|
106
110
|
}
|
|
111
|
+
packagingOptions { doNotStrip ""*/armeabi/libvsecbox.so"" }
|
|
112
|
+
packagingOptions { doNotStrip ""*/armeabi-v7a/libvsecbox.so"" }
|
|
113
|
+
packagingOptions { doNotStrip ""*/arm64-v8a/libvsecbox.so"" }
|
|
107
114
|
|
|
108
115
|
bundle {
|
|
109
116
|
language {
|
|
@@ -117,15 +124,18 @@ android {
|
|
|
117
124
|
}
|
|
118
125
|
}
|
|
119
126
|
|
|
120
|
-
|
|
121
127
|
}
|
|
122
128
|
|
|
123
129
|
dependencies {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
130
|
+
api ""com.android.support:support-v4:28.0.0""
|
|
131
|
+
api ""com.android.support:recyclerview-v7:28.0.0""
|
|
132
|
+
api ""com.android.support:appcompat-v7:28.0.0""
|
|
133
|
+
api fileTree(includes: ['*.jar', '*.aar'], dir: 'libs')
|
|
134
|
+
api project(':sdk_plug')
|
|
135
|
+
api project(':unity_app')
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
129
139
|
}";
|
|
130
140
|
|
|
131
141
|
public PublishVivoBatSetting Target => target as PublishVivoBatSetting;
|
|
@@ -203,7 +213,9 @@ dependencies {
|
|
|
203
213
|
Debug.Log("修改游戏名");
|
|
204
214
|
var publishProj = setting.AndroidPublishProj;
|
|
205
215
|
{
|
|
206
|
-
|
|
216
|
+
//
|
|
217
|
+
|
|
218
|
+
var strings_xml = $@"{publishProj}\vivo_union\src\main\res\values\strings.xml";
|
|
207
219
|
var input =
|
|
208
220
|
$"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n <string name=\"app_name\">{setting.GameName}</string>\n <string name=\"game_view_content_description\">Game view</string>\n</resources>";
|
|
209
221
|
File.WriteAllText(strings_xml, input);
|
|
@@ -213,34 +225,17 @@ dependencies {
|
|
|
213
225
|
Debug.Log("更换icon");
|
|
214
226
|
var iconPath = AssetDatabase.GetAssetPath(setting.Icon);
|
|
215
227
|
File.Copy(iconPath,
|
|
216
|
-
|
|
228
|
+
$@"{publishProj}\vivo_union\src\main\res\mipmap-mdpi\app_icon.png", true);
|
|
217
229
|
}
|
|
218
230
|
|
|
219
231
|
|
|
220
232
|
{
|
|
221
233
|
Debug.Log("更换包名等信息");
|
|
222
|
-
var build_gardle = $"{publishProj}/
|
|
234
|
+
var build_gardle = $"{publishProj}/vivo_union/build.gradle";
|
|
223
235
|
var code = build_garde_template;
|
|
224
|
-
|
|
225
|
-
var sb = new StringBuilder();
|
|
226
|
-
var index = 0;
|
|
227
|
-
foreach (var s in str)
|
|
228
|
-
{
|
|
229
|
-
if (index != 0)
|
|
230
|
-
{
|
|
231
|
-
sb.Append(s.PadLeft(2, '0'));
|
|
232
|
-
}
|
|
233
|
-
else
|
|
234
|
-
{
|
|
235
|
-
sb.Append(s);
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
index += 1;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
|
|
242
237
|
code = code.Replace("$APPLICATION_ID", setting.PackageName);
|
|
243
|
-
code = code.Replace("$VERSION_CODE",
|
|
238
|
+
code = code.Replace("$VERSION_CODE", setting.VersionCode.ToString());
|
|
244
239
|
code = code.Replace("$VERSION_NAME", setting.Version);
|
|
245
240
|
File.WriteAllText(build_gardle, code);
|
|
246
241
|
}
|
|
@@ -256,8 +251,40 @@ dependencies {
|
|
|
256
251
|
{
|
|
257
252
|
Debug.Log("更换代码参数");
|
|
258
253
|
var config = $@"{publishProj}\vivo_union\src\main\java\com\typhoon\vivo_union\Config.java";
|
|
254
|
+
var debugMode = setting.DebugMode ? "ture" : "false";
|
|
255
|
+
var orientation = setting.Portrait ? "true" : "false";
|
|
259
256
|
var input =
|
|
260
|
-
|
|
257
|
+
$@"package com.typhoon.vivo_union;
|
|
258
|
+
|
|
259
|
+
/*打包配置*/
|
|
260
|
+
public class Config {{
|
|
261
|
+
/*Debug 模式开关*/
|
|
262
|
+
public static boolean DEBUG_MODE = {debugMode};
|
|
263
|
+
|
|
264
|
+
/*竖屏模式为true,横屏模式为false*/
|
|
265
|
+
public static boolean ORIENTATION_PORTRAIT = {orientation};
|
|
266
|
+
|
|
267
|
+
/*隐藏政策URL*/
|
|
268
|
+
public static String PRIVACY_POLICY_URL = ""{setting.PrivacyPolicyYNoteUrl}"";
|
|
269
|
+
/*VIVO-联运 参数*/
|
|
270
|
+
public static String APP_ID = ""{setting.AppId}"";//appid(看后台)
|
|
271
|
+
/*VIVO-广告联盟 参数*/
|
|
272
|
+
public static String MEDIA_ID = ""{setting.MediaID}"";//Media ID
|
|
273
|
+
public static String VIDEO_UNIT_ID = ""{setting.VideoID}""; //视频广告
|
|
274
|
+
public static String SPLASH_UNIT_ID = ""{setting.SplashID}"";//开屏广告
|
|
275
|
+
public static String INTER_IMAGE_UNIT_ID = ""{setting.IntersID}""; //图片类插页广告
|
|
276
|
+
public static String INTER_VIDEO_UNIT_ID = """"; //视频类插页广告
|
|
277
|
+
public static String FLOAT_ICON_UNIT_ID = ""{setting.FloatIconID}""; //悬浮icon
|
|
278
|
+
public static String NATIVE_UNIT_ID = ""{setting.NativeID}"";//原生广告
|
|
279
|
+
public static String BANNER_UNIT_ID = ""{setting.BannerID}"";//banner广告
|
|
280
|
+
public static String WX_APP_ID = """";//后台申请的媒体微信APPID
|
|
281
|
+
public static int SPLASH_FETCH_TIMEOUT = 3000;//开屏广告拉取最大超时时间,单位毫秒
|
|
282
|
+
public static int SPLASH_FLOOR_PRICE=-1;//开屏广告底价,-1为不设定
|
|
283
|
+
public static int INTERS_IMAGE_FLOOR_PRICE=-1;//图片类插屏广告底价,-1为不设定
|
|
284
|
+
public static int INTERS_VIDEO_FLOOR_PRICE=-1;//视频类插屏广告底价,-1为不设定
|
|
285
|
+
|
|
286
|
+
}}
|
|
287
|
+
";
|
|
261
288
|
File.WriteAllText(config, input);
|
|
262
289
|
}
|
|
263
290
|
{
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.
|
|
1
|
+
{"name":"com.typhoon.unitysdk","displayName":"typhoon unity sdk","version":"1.0.6","description":"unity端个汇总渠道的sdk,统一接口,一键发布","unity":"2018.1","type":"tool","hideInEditor":false,"author":{"name":"Jan Zhang","email":"","url":""},"changelogUrl":"","documentationUrl":"","keywords":["typhoon"],"license":"","licensesUrl":"","customDependencies":[{"PackageName":"com.unity.nuget.newtonsoft-json","Value":"2.0.0"}],"dependencies":{"com.unity.nuget.newtonsoft-json":"2.0.0"}}
|