com.typhoon.unitysdk 1.0.3 → 1.0.5
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 OrientationPortrait = 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;
|
|
@@ -140,9 +150,14 @@ dependencies {
|
|
|
140
150
|
// }
|
|
141
151
|
|
|
142
152
|
var publish = GUILayout.Button("发布vivo", GUILayout.Height(32));
|
|
153
|
+
|
|
143
154
|
if (publish)
|
|
144
155
|
{
|
|
145
|
-
|
|
156
|
+
var sure = EditorUtility.DisplayDialog("提示", "发布?", "是");
|
|
157
|
+
if (sure)
|
|
158
|
+
{
|
|
159
|
+
Publish(Target);
|
|
160
|
+
}
|
|
146
161
|
}
|
|
147
162
|
}
|
|
148
163
|
|
|
@@ -198,7 +213,9 @@ dependencies {
|
|
|
198
213
|
Debug.Log("修改游戏名");
|
|
199
214
|
var publishProj = setting.AndroidPublishProj;
|
|
200
215
|
{
|
|
201
|
-
|
|
216
|
+
//
|
|
217
|
+
|
|
218
|
+
var strings_xml = $@"{publishProj}\vivo_union\src\main\res\values\strings.xml";
|
|
202
219
|
var input =
|
|
203
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>";
|
|
204
221
|
File.WriteAllText(strings_xml, input);
|
|
@@ -208,41 +225,24 @@ dependencies {
|
|
|
208
225
|
Debug.Log("更换icon");
|
|
209
226
|
var iconPath = AssetDatabase.GetAssetPath(setting.Icon);
|
|
210
227
|
File.Copy(iconPath,
|
|
211
|
-
|
|
228
|
+
$@"{publishProj}\vivo_union\src\main\res\mipmap-mdpi\app_icon.png", true);
|
|
212
229
|
}
|
|
213
230
|
|
|
214
231
|
|
|
215
232
|
{
|
|
216
233
|
Debug.Log("更换包名等信息");
|
|
217
|
-
var build_gardle = $"{publishProj}/
|
|
234
|
+
var build_gardle = $"{publishProj}/vivo_union/build.gradle";
|
|
218
235
|
var code = build_garde_template;
|
|
219
|
-
|
|
220
|
-
var sb = new StringBuilder();
|
|
221
|
-
var index = 0;
|
|
222
|
-
foreach (var s in str)
|
|
223
|
-
{
|
|
224
|
-
if (index != 0)
|
|
225
|
-
{
|
|
226
|
-
sb.Append(s.PadLeft(2, '0'));
|
|
227
|
-
}
|
|
228
|
-
else
|
|
229
|
-
{
|
|
230
|
-
sb.Append(s);
|
|
231
|
-
}
|
|
232
|
-
|
|
233
|
-
index += 1;
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
236
|
+
|
|
237
237
|
code = code.Replace("$APPLICATION_ID", setting.PackageName);
|
|
238
|
-
code = code.Replace("$VERSION_CODE",
|
|
238
|
+
code = code.Replace("$VERSION_CODE", setting.VersionCode.ToString());
|
|
239
239
|
code = code.Replace("$VERSION_NAME", setting.Version);
|
|
240
240
|
File.WriteAllText(build_gardle, code);
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
{
|
|
244
244
|
Debug.Log("更换AppId");
|
|
245
|
-
|
|
245
|
+
var supplierconfig = $"{publishProj}/vivo_union/src/main/assets/supplierconfig.json";
|
|
246
246
|
var input =
|
|
247
247
|
$"{{\n \"supplier\":{{\n \"vivo\":{{\n \"appid\":\"{setting.AppId}\"\n }},\n \"xiaomi\":{{\n\n }},\n \"huawei\":{{\n\n }},\n \"oppo\":{{\n\n }}\n }}\n\n}}\n";
|
|
248
248
|
File.WriteAllText(supplierconfig, input);
|
|
@@ -252,7 +252,37 @@ dependencies {
|
|
|
252
252
|
Debug.Log("更换代码参数");
|
|
253
253
|
var config = $@"{publishProj}\vivo_union\src\main\java\com\typhoon\vivo_union\Config.java";
|
|
254
254
|
var input =
|
|
255
|
-
|
|
255
|
+
$@"package com.typhoon.vivo_union;
|
|
256
|
+
|
|
257
|
+
/*打包配置*/
|
|
258
|
+
public class Config {{
|
|
259
|
+
/*Debug 模式开关*/
|
|
260
|
+
public static boolean DEBUG_MODE = {setting.DebugMode};
|
|
261
|
+
|
|
262
|
+
/*竖屏模式为true,横屏模式为false*/
|
|
263
|
+
public static boolean ORIENTATION_PORTRAIT = {setting.PrivacyPolicyYNoteUrl};
|
|
264
|
+
|
|
265
|
+
/*隐藏政策URL*/
|
|
266
|
+
public static String PRIVACY_POLICY_URL = ""{setting.PrivacyPolicyYNoteUrl}"";
|
|
267
|
+
/*VIVO-联运 参数*/
|
|
268
|
+
public static String APP_ID = ""{setting.AppId}"";//appid(看后台)
|
|
269
|
+
/*VIVO-广告联盟 参数*/
|
|
270
|
+
public static String MEDIA_ID = ""{setting.MediaID}"";//Media ID
|
|
271
|
+
public static String VIDEO_UNIT_ID = ""{setting.VideoID}""; //视频广告
|
|
272
|
+
public static String SPLASH_UNIT_ID = ""{setting.SplashID}"";//开屏广告
|
|
273
|
+
public static String INTER_IMAGE_UNIT_ID = ""{setting.IntersID}""; //图片类插页广告
|
|
274
|
+
public static String INTER_VIDEO_UNIT_ID = """"; //视频类插页广告
|
|
275
|
+
public static String FLOAT_ICON_UNIT_ID = ""{setting.FloatIconID}""; //悬浮icon
|
|
276
|
+
public static String NATIVE_UNIT_ID = ""{setting.NativeID}"";//原生广告
|
|
277
|
+
public static String BANNER_UNIT_ID = ""{setting.BannerID}"";//banner广告
|
|
278
|
+
public static String WX_APP_ID = """";//后台申请的媒体微信APPID
|
|
279
|
+
public static int SPLASH_FETCH_TIMEOUT = 3000;//开屏广告拉取最大超时时间,单位毫秒
|
|
280
|
+
public static int SPLASH_FLOOR_PRICE=-1;//开屏广告底价,-1为不设定
|
|
281
|
+
public static int INTERS_IMAGE_FLOOR_PRICE=-1;//图片类插屏广告底价,-1为不设定
|
|
282
|
+
public static int INTERS_VIDEO_FLOOR_PRICE=-1;//视频类插屏广告底价,-1为不设定
|
|
283
|
+
|
|
284
|
+
}}
|
|
285
|
+
";
|
|
256
286
|
File.WriteAllText(config, input);
|
|
257
287
|
}
|
|
258
288
|
{
|
|
@@ -261,7 +291,7 @@ dependencies {
|
|
|
261
291
|
var manifest = $"{unityProj}/unityLibrary/src/main/AndroidManifest.xml";
|
|
262
292
|
var xml = File.ReadAllText(manifest);
|
|
263
293
|
// string pattern = @"(?s)<intent-filter\b[^>]*>(.*?)<\/intent-filter>";
|
|
264
|
-
// string result = Regex.Replace(xml, pattern, "");
|
|
294
|
+
// string result = Regex.Replace(xml, pattern, "");f
|
|
265
295
|
xml = xml.Replace("<intent-filter>", "");
|
|
266
296
|
xml = xml.Replace("<action android:name=\"android.intent.action.MAIN\" />", "");
|
|
267
297
|
xml = xml.Replace("<category android:name=\"android.intent.category.LAUNCHER\" />", "");
|
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.5","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"}}
|