Commit fe91e30cd4f12ba0f3d99a6906a89ce2c4f12302
0 parents
Exists in
master
初始化项目
Showing
33 changed files
with
1741 additions
and
0 deletions
Show diff stats
1 | +++ a/.gitignore | ||
@@ -0,0 +1,14 @@ | @@ -0,0 +1,14 @@ | ||
1 | +*.iml | ||
2 | +.gradle | ||
3 | +/local.properties | ||
4 | +/.idea/* | ||
5 | +/.idea/libraries | ||
6 | +/.idea/modules.xml | ||
7 | +/.idea/workspace.xml | ||
8 | +/.idea/navEditor.xml | ||
9 | +/.idea/assetWizardSettings.xml | ||
10 | +.DS_Store | ||
11 | +/build | ||
12 | +/captures | ||
13 | +.externalNativeBuild | ||
14 | +.cxx |
1 | +++ a/README.md | ||
@@ -0,0 +1,5 @@ | @@ -0,0 +1,5 @@ | ||
1 | +1.工程中build.gradle 中 http://47.94.86.25:8081/repository/maven-group/和http://47.94.86.25:8081/repository/maven-beta/ 的用户名和密码 | ||
2 | +2.修改applicationId,以及添加对用包名的google-services.json文件 | ||
3 | +3. 修改清单文件(AndroidManifest.xml) 中的AppsFlyerLib_key,flurry_key,com.facebook.sdk.ApplicationId,com.google.android.gms.ads.APPLICATION_ID 的值 | ||
4 | +4.thinkingDataKey, | ||
5 | + |
1 | +++ a/app/build.gradle | ||
@@ -0,0 +1,41 @@ | @@ -0,0 +1,41 @@ | ||
1 | +apply plugin: 'com.android.application' | ||
2 | + | ||
3 | +android { | ||
4 | + compileSdkVersion 29 | ||
5 | + buildToolsVersion "29.0.2" | ||
6 | + | ||
7 | + defaultConfig { | ||
8 | + applicationId "test.test.test" | ||
9 | + minSdkVersion 21 | ||
10 | + targetSdkVersion 29 | ||
11 | + versionCode 100 | ||
12 | + versionName "1.0" | ||
13 | + | ||
14 | + testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" | ||
15 | + ndk { | ||
16 | + abiFilters 'armeabi-v7a', 'arm64-v8a' | ||
17 | + } | ||
18 | + } | ||
19 | + compileOptions { | ||
20 | + sourceCompatibility JavaVersion.VERSION_1_8 | ||
21 | + targetCompatibility JavaVersion.VERSION_1_8 | ||
22 | + } | ||
23 | + | ||
24 | + buildTypes { | ||
25 | + release { | ||
26 | + minifyEnabled true | ||
27 | + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' | ||
28 | + } | ||
29 | + } | ||
30 | + | ||
31 | +} | ||
32 | + | ||
33 | +apply plugin: 'com.google.gms.google-services' | ||
34 | + | ||
35 | +dependencies { | ||
36 | + implementation fileTree(dir: 'libs', include: ['*.jar']) | ||
37 | + api 'com.plugins.sdk:Analytics:5.4.8' | ||
38 | + api 'com.plugins.sdk:aD_v4:5.4.8' | ||
39 | + api 'com.plugins.sdk:payment:5.4.8' | ||
40 | + implementation 'androidx.appcompat:appcompat:1.2.0' | ||
41 | +} |
1 | +++ a/app/google-services.json | ||
@@ -0,0 +1,39 @@ | @@ -0,0 +1,39 @@ | ||
1 | +{ | ||
2 | + "project_info": { | ||
3 | + "project_number": "84374916356", | ||
4 | + "project_id": "bubblington-shooting-design", | ||
5 | + "storage_bucket": "bubblington-shooting-design.appspot.com" | ||
6 | + }, | ||
7 | + "client": [ | ||
8 | + { | ||
9 | + "client_info": { | ||
10 | + "mobilesdk_app_id": "1:84374916356:android:0b3827b19705eb39435451", | ||
11 | + "android_client_info": { | ||
12 | + "package_name": "com.quzizi.fbbubble" | ||
13 | + } | ||
14 | + }, | ||
15 | + "oauth_client": [ | ||
16 | + { | ||
17 | + "client_id": "84374916356-vs6omjuhrppk0lr1ldmhemc1vppjijtg.apps.googleusercontent.com", | ||
18 | + "client_type": 3 | ||
19 | + } | ||
20 | + ], | ||
21 | + "api_key": [ | ||
22 | + { | ||
23 | + "current_key": "AIzaSyAgWCd2xo0Tfb3_JbGFjOjGyloZWN0t2Vg" | ||
24 | + } | ||
25 | + ], | ||
26 | + "services": { | ||
27 | + "appinvite_service": { | ||
28 | + "other_platform_oauth_client": [ | ||
29 | + { | ||
30 | + "client_id": "84374916356-vs6omjuhrppk0lr1ldmhemc1vppjijtg.apps.googleusercontent.com", | ||
31 | + "client_type": 3 | ||
32 | + } | ||
33 | + ] | ||
34 | + } | ||
35 | + } | ||
36 | + } | ||
37 | + ], | ||
38 | + "configuration_version": "1" | ||
39 | +} | ||
0 | \ No newline at end of file | 40 | \ No newline at end of file |
1 | +++ a/app/proguard-rules.pro | ||
@@ -0,0 +1,405 @@ | @@ -0,0 +1,405 @@ | ||
1 | +# Add project specific ProGuard rules here. | ||
2 | +# You can control the set of applied configuration files using the | ||
3 | +# proguardFiles setting in build.gradle. | ||
4 | +# | ||
5 | +# For more details, see | ||
6 | +# http://developer.android.com/guide/developing/tools/proguard.html | ||
7 | + | ||
8 | +# If your project uses WebView with JS, uncomment the following | ||
9 | +# and specify the fully qualified class name to the JavaScript interface | ||
10 | +# class: | ||
11 | +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
12 | +# public *; | ||
13 | +#} | ||
14 | + | ||
15 | +# Uncomment this to preserve the line number information for | ||
16 | +# debugging stack traces. | ||
17 | +#-keepattributes SourceFile,LineNumberTable | ||
18 | + | ||
19 | +# If you keep the line number information, uncomment this to | ||
20 | +# hide the original source file name. | ||
21 | +#-renamesourcefileattribute SourceFile | ||
22 | +-verbose | ||
23 | +#指定压缩级别 | ||
24 | +-optimizationpasses 5 | ||
25 | +#混淆时应用侵入式重载 | ||
26 | +-overloadaggressively | ||
27 | +#使用字符串"SourceFile"来替代真正的类 | ||
28 | +-renamesourcefileattribute SourceFile | ||
29 | +#抛出异常时保留代码行号 | ||
30 | +-keepattributes SourceFile,LineNumberTable | ||
31 | +# 混淆时所采用的算法 | ||
32 | +-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* | ||
33 | +#包名不混合大小写 | ||
34 | +-dontusemixedcaseclassnames | ||
35 | +#把混淆类中的方法名也混淆了 | ||
36 | +-useuniqueclassmembernames | ||
37 | +#优化时允许访问并修改有修饰符的类和类的成员 | ||
38 | +-allowaccessmodification | ||
39 | +#将混淆过得类移到根目录下 | ||
40 | +-repackageclasses | ||
41 | + | ||
42 | +-keepclasseswithmembernames class * { | ||
43 | + native <methods>; | ||
44 | +} | ||
45 | + | ||
46 | +#保留资源文件 | ||
47 | +-keepclassmembers class **.R$* { | ||
48 | + public static <fields>; | ||
49 | +} | ||
50 | + | ||
51 | +# The support library contains references to newer platform versions. | ||
52 | +# Don't warn about those in case this app is linking against an older | ||
53 | +# platform version. We know about them, and they are safe. | ||
54 | +-dontwarn android.support.** | ||
55 | + | ||
56 | +-keep public class com.google.android.gms.* { public *; } | ||
57 | +-dontwarn com.google.android.gms.** | ||
58 | +-keep class * extends java.util.ListResourceBundle { | ||
59 | + protected Object[][] getContents(); | ||
60 | +} | ||
61 | + | ||
62 | +-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { | ||
63 | + public static final *** NULL; | ||
64 | +} | ||
65 | + | ||
66 | +-keepnames @com.google.android.gms.common.annotation.KeepName class * | ||
67 | +-keepclassmembernames class * { | ||
68 | + @com.google.android.gms.common.annotation.KeepName *; | ||
69 | +} | ||
70 | + | ||
71 | +-keepnames class * implements android.os.Parcelable { | ||
72 | + public static final ** CREATOR; | ||
73 | +} | ||
74 | + | ||
75 | +# 保留bolts下的所有类及其内部类 | ||
76 | +-keep class bolts.** {*;} | ||
77 | +-dontwarn bolts.** | ||
78 | + | ||
79 | +# 保留fastjson下的所有类及其内部类 | ||
80 | +-keep class com.alibaba.fastjson.** {*;} | ||
81 | +-dontwarn com.alibaba.fastjson.** | ||
82 | + | ||
83 | +# 保留com.android.vending.billing下的所有类及其内部类 | ||
84 | +-keep class com.android.vending.billing.** {*;} | ||
85 | +-dontwarn com.android.vending.billing.** | ||
86 | + | ||
87 | +# 保留applovin下的所有类及其内部类 | ||
88 | +-keep class com.applovin.** {*;} | ||
89 | +-dontwarn com.applovin.** | ||
90 | + | ||
91 | +# 保留appsflyer下的所有类及其内部类 | ||
92 | +-keep class com.appsflyer.** {*;} | ||
93 | +-dontwarn com.appsflyer.** | ||
94 | + | ||
95 | +# 保留avos下的所有类及其内部类 | ||
96 | +-keep class com.avos.** {*;} | ||
97 | +-dontwarn com.avos.** | ||
98 | + | ||
99 | +# 保留avoscloud下的所有类及其内部类 | ||
100 | +-keep class com.avoscloud.** {*;} | ||
101 | +-dontwarn com.avoscloud.** | ||
102 | + | ||
103 | +# 保留avoscloud_gcm下的所有类及其内部类 | ||
104 | +-keep class com.avoscloud_gcm.** {*;} | ||
105 | +-dontwarn com.avoscloud_gcm.** | ||
106 | + | ||
107 | +-keep class com.mopub.** {*;} | ||
108 | +-dontwarn com.mopub.** | ||
109 | + | ||
110 | + | ||
111 | +-keep class org.xmlpull.** {*;} | ||
112 | +-dontwarn org.xmlpull.** | ||
113 | + | ||
114 | + | ||
115 | +# 保留facebook下的所有类及其内部类 | ||
116 | +-keep class com.facebook.** {*;} | ||
117 | +-dontwarn com.facebook.** | ||
118 | + | ||
119 | +# 保留flurry下的所有类及其内部类 | ||
120 | +-keep class com.flurry.** {*;} | ||
121 | +-dontwarn com.flurry.** | ||
122 | + | ||
123 | +# 保留google下的所有类及其内部类 | ||
124 | +-keep class com.google.** {*;} | ||
125 | +-dontwarn com.google.** | ||
126 | + | ||
127 | +# 保留picasso下的所有类及其内部类 | ||
128 | +-keep class com.squareup.picasso.** {*;} | ||
129 | +-dontwarn com.squareup.picasso.** | ||
130 | + | ||
131 | +# 保留bugly下的所有类及其内部类 | ||
132 | +-keep class com.tencent.bugly.** {*;} | ||
133 | +-dontwarn com.tencent.bugly.** | ||
134 | + | ||
135 | +# 保留unity3d下的所有类及其内部类 | ||
136 | +-keep class com.unity3d.ads.** {*;} | ||
137 | +-dontwarn com.unity3d.ads.** | ||
138 | + | ||
139 | +# 保留httpclient下的所有类及其内部类 | ||
140 | +-keep class cz.msebera.** {*;} | ||
141 | +-dontwarn cz.msebera.** | ||
142 | + | ||
143 | +# 保留async http下的所有类及其内部类 | ||
144 | +-keep class com.loopj.android.http.** {*;} | ||
145 | +-dontwarn com.loopj.android.http.** | ||
146 | + | ||
147 | +-keep class android.net.**{*;} | ||
148 | +-dontwarn android.net.** | ||
149 | + | ||
150 | +-keep class android.util.**{*;} | ||
151 | +-dontwarn android.util.** | ||
152 | + | ||
153 | +-keep class org.apache.http.** {*;} | ||
154 | +-dontwarn org.apache.http.** | ||
155 | + | ||
156 | +-keep class okhttp3.** {*;} | ||
157 | +-dontwarn okhttp3.** | ||
158 | + | ||
159 | +-keep class okio.** {*;} | ||
160 | +-dontwarn okio.** | ||
161 | + | ||
162 | +-keep class org.cocos2dx.** {*;} | ||
163 | +-dontwarn org.cocos2dx.** | ||
164 | + | ||
165 | +-keep class com.millennialmedia.** {*;} | ||
166 | +-dontwarn com.millennialmedia.** | ||
167 | + | ||
168 | +-keep class com.liulishuo.filedownloader.** {*;} | ||
169 | +-dontwarn com.liulishuo.filedownloader.** | ||
170 | + | ||
171 | +-keep class com.github.siyamed.** {*;} | ||
172 | +-dontwarn com.github.siyamed.** | ||
173 | + | ||
174 | +-keep class com.custom.** {*;} | ||
175 | +-dontwarn com.custom.** | ||
176 | + | ||
177 | +-keep class com.vungle.publisher.** {*;} | ||
178 | +-dontwarn com.vungle.publisher.** | ||
179 | + | ||
180 | +-keep class dagger.** {*;} | ||
181 | +-dontwarn dagger.** | ||
182 | + | ||
183 | +-keep class de.greenrobot.event.** {*;} | ||
184 | +-dontwarn de.greenrobot.event.** | ||
185 | + | ||
186 | +-keep class javax.inject.** {*;} | ||
187 | +-dontwarn javax.inject.** | ||
188 | + | ||
189 | +-keep class rx.** {*;} | ||
190 | +-dontwarn rx.** | ||
191 | + | ||
192 | +-keep class rx.adjust.** {*;} | ||
193 | +-dontwarn rx.adjust.** | ||
194 | + | ||
195 | +-keep class dalvik.system.** {*;} | ||
196 | +-dontwarn dalvik.system.** | ||
197 | + | ||
198 | +-keep class android.os.** {*;} | ||
199 | +-dontwarn android.os.** | ||
200 | + | ||
201 | +-keep class android.content.** {*;} | ||
202 | +-dontwarn android.content.** | ||
203 | + | ||
204 | +-keep class com.google.android.** {*;} | ||
205 | +-dontwarn com.google.android.** | ||
206 | + | ||
207 | +-keep class com.inmobi.** { *; } | ||
208 | +-dontwarn com.inmobi.** | ||
209 | + | ||
210 | +# Vungle | ||
211 | +-keep class com.vungle.** { *; } | ||
212 | +-dontwarn com.vungle.** | ||
213 | + | ||
214 | +# Moat SDK | ||
215 | +-keep class com.moat.** { *; } | ||
216 | +-dontwarn com.moat.** | ||
217 | + | ||
218 | +-keep class android.** { *; } | ||
219 | +-dontwarn android.** | ||
220 | + | ||
221 | +-keep class com.android.** {*;} | ||
222 | +-dontwarn com.android.** | ||
223 | + | ||
224 | +# Okio | ||
225 | +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement | ||
226 | + | ||
227 | +# Retrofit | ||
228 | +-dontwarn okio.** | ||
229 | +-dontwarn retrofit2.Platform$Java8 | ||
230 | + | ||
231 | +# Gson | ||
232 | +-keepattributes Signature | ||
233 | +-keepattributes *Annotation* | ||
234 | +-dontwarn sun.misc.** | ||
235 | +-keep class com.google.gson.examples.android.model.** { *; } | ||
236 | +-keep class * implements com.google.gson.TypeAdapterFactory | ||
237 | +-keep class * implements com.google.gson.JsonSerializer | ||
238 | +-keep class * implements com.google.gson.JsonDeserializer | ||
239 | + | ||
240 | +#ironsource | ||
241 | +-keep class com.ironsource.** { *;} | ||
242 | +-dontwarn com.ironsource.** | ||
243 | + | ||
244 | + | ||
245 | +#inmobi | ||
246 | +-keep class com.inmobi.** { *; } | ||
247 | +-dontwarn com.inmobi.** | ||
248 | +-keep class com.integralads.** { *; } | ||
249 | +-dontwarn com.integralads.** | ||
250 | +-keep class com.moat.** { *; } | ||
251 | +-dontwarn com.moat.** | ||
252 | + | ||
253 | + | ||
254 | + #mobvista | ||
255 | +-keepattributes Signature | ||
256 | +-keepattributes *Annotation* | ||
257 | +-keep class com.mintegral.** {*; } | ||
258 | +-keep interface com.mintegral.** {*; } | ||
259 | +-keep class android.support.v4.** { *; } | ||
260 | +-dontwarn com.mintegral.** | ||
261 | +-keep class **.R$* { public static final int mintegral*; } | ||
262 | +-keep class com.alphab.** {*; } | ||
263 | +-keep interface com.alphab.** {*; } | ||
264 | + | ||
265 | + | ||
266 | +#Adcolony | ||
267 | +-keep class com.adcolony.** {*; } | ||
268 | +-dontwarn com.adcolony.** | ||
269 | +-keepclassmembers class * { | ||
270 | + @android.webkit.JavascriptInterface <methods>; | ||
271 | +} | ||
272 | + | ||
273 | +#Tapjoy | ||
274 | +-keep class com.tapjoy.** { *; } | ||
275 | +-keepattributes JavascriptInterface | ||
276 | +-keepattributes *Annotation* | ||
277 | +-keep class * extends java.util.ListResourceBundle { | ||
278 | +protected Object[][] getContents(); | ||
279 | +} | ||
280 | +-keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable { | ||
281 | +public static final *** NULL; | ||
282 | +} | ||
283 | +-keepnames @com.google.android.gms.common.annotation.KeepName class * | ||
284 | +-keepclassmembernames class * { | ||
285 | +@com.google.android.gms.common.annotation.KeepName *; | ||
286 | +} | ||
287 | +-keepnames class * implements android.os.Parcelable { | ||
288 | +public static final ** CREATOR; | ||
289 | +} | ||
290 | +-keep class com.google.android.gms.ads.identifier.** { *; } | ||
291 | +-dontwarn com.tapjoy.** | ||
292 | + | ||
293 | +# 更新 unity3d下的所有类及其内部类 | ||
294 | +-keep class com.unity3d.** {*;} | ||
295 | +-dontwarn com.unity3d.** | ||
296 | + | ||
297 | +#Fyber | ||
298 | +-keep class com.heyzap.** {*;} | ||
299 | +-keep class com.fyber.** {*;} | ||
300 | +-dontwarn com.heyzap.** | ||
301 | +-dontwarn com.fyber.** | ||
302 | +-keep class androidx.** {*;} | ||
303 | +-dontwarn androidx.** | ||
304 | +-keep class com.plugins.lib.base.SharedPreferencesUtils {*;} | ||
305 | +-keep class com.plugin.analytics.AnalyticsControl {*;} | ||
306 | + | ||
307 | +# 保留chartboost 新添加 | ||
308 | +-keep class com.chartboost.** {*;} | ||
309 | +-dontwarn com.chartboost.** | ||
310 | +-keep class com.chartboost_helium.** {*;} | ||
311 | +-dontwarn com.chartboost_helium.** | ||
312 | +-keep class com.moat.** {*;} | ||
313 | +-dontwarn com.moat.** | ||
314 | +-keepattributes *Annotation* | ||
315 | +-keepclassmembers class ** { | ||
316 | + @org.greenrobot.eventbus.Subscribe <methods>; | ||
317 | +} | ||
318 | +-keep class org.greenrobot.** {*;} | ||
319 | +-dontwarn org.greenrobot.** | ||
320 | +-keep enum org.greenrobot.eventbus.ThreadMode { *; } | ||
321 | + | ||
322 | +#vungle更新=========== | ||
323 | +# Vungle | ||
324 | +-keep class com.vungle.** { *; } | ||
325 | +-dontwarn com.vungle.** | ||
326 | +-keep class com.vungle.warren.downloader.DownloadRequest | ||
327 | +-dontwarn com.vungle.warren.error.VungleError$ErrorCode | ||
328 | +-dontwarn com.vungle.warren.downloader.DownloadRequest$Status | ||
329 | +-keepclassmembers enum com.vungle.warren.** { *; } | ||
330 | + | ||
331 | + | ||
332 | +# Moat SDK | ||
333 | +-keep class com.moat.** { *; } | ||
334 | +-dontwarn com.moat.** | ||
335 | +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement | ||
336 | +-keepattributes *Annotation* | ||
337 | + | ||
338 | +# Retrofit | ||
339 | +-keepattributes Signature, InnerClasses | ||
340 | +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement | ||
341 | +-dontwarn javax.annotation.** | ||
342 | +-dontwarn kotlin.Unit | ||
343 | +-dontwarn retrofit2.-KotlinExtensions | ||
344 | + | ||
345 | +# Okio+OkHttp | ||
346 | +-dontwarn okhttp3.** | ||
347 | +-dontwarn okio.** | ||
348 | +-dontwarn javax.annotation.** | ||
349 | +-dontwarn org.conscrypt.** | ||
350 | +-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase | ||
351 | +#======================================= | ||
352 | + | ||
353 | +#穿山甲=============================== | ||
354 | + | ||
355 | +-keep class com.bytedance.** {*;} | ||
356 | +-keep class com.androidquery.** {*;} | ||
357 | +-keep class com.ss.** {*;} | ||
358 | +-keep class com.com.bytedance.** {*;} | ||
359 | +-dontwarn com.androidquery.** | ||
360 | +-dontwarn com.ss.** | ||
361 | +-dontwarn com.com.bytedance.** | ||
362 | +-dontwarn com.bytedance.** | ||
363 | +-keep public interface com.bytedance.sdk.openadsdk.downloadnew.** {*;} | ||
364 | +#======================================= | ||
365 | + | ||
366 | +#Display | ||
367 | +#======================================= | ||
368 | +-keep class com.brandio.** { *;} | ||
369 | +-dontwarn com.brandio.** | ||
370 | +-keep class iab.omid.**{ *;} | ||
371 | +-dontwarn iab.omid.** | ||
372 | +#======================================= | ||
373 | + | ||
374 | +#GDTAD | ||
375 | +#======================================= | ||
376 | +-keep class com.qq.e.** { *;} | ||
377 | +-dontwarn com.qq.e.** | ||
378 | +#======================================= | ||
379 | + | ||
380 | +##sigmob========= | ||
381 | +-keep class com.google.android.material.** {*;} | ||
382 | +-keep class androidx.** {*;} | ||
383 | +-keep public class * extends androidx.** | ||
384 | +-keep interface androidx.** {*;} | ||
385 | +-dontwarn com.google.android.material.** | ||
386 | +-dontnote com.google.android.material.** | ||
387 | +-dontwarn androidx.** | ||
388 | +-keep class sun.misc.Unsafe { *; } | ||
389 | +-dontwarn com.sigmob.** | ||
390 | +-keep class com.sigmob.**.**{*;} | ||
391 | +-keep class com.bun.miitmdid.core.** {*;} | ||
392 | +-dontwarn com.bun.miitmdid.core.** | ||
393 | +##END sigmob========= | ||
394 | + | ||
395 | +##KuaiShou========= | ||
396 | +-keep class org.chromium.** {*;} | ||
397 | +-keep class org.chromium.** { *; } | ||
398 | +-keep class aegon.chrome.** { *; } | ||
399 | +-keep class com.kwai.**{ *; } | ||
400 | +-keep class com.kwad.**{ *; } | ||
401 | +-dontwarn com.kwai.** | ||
402 | +-dontwarn com.kwad.** | ||
403 | +-dontwarn com.ksad.** | ||
404 | +-dontwarn aegon.chrome.** | ||
405 | +##END KuaiShou==== | ||
0 | \ No newline at end of file | 406 | \ No newline at end of file |
app/src/androidTest/java/com/quzizi/fbbubble/ExampleInstrumentedTest.java
0 → 100644
1 | +++ a/app/src/androidTest/java/com/quzizi/fbbubble/ExampleInstrumentedTest.java | ||
@@ -0,0 +1,27 @@ | @@ -0,0 +1,27 @@ | ||
1 | +package com.quzizi.fbbubble; | ||
2 | + | ||
3 | +import android.content.Context; | ||
4 | + | ||
5 | +import androidx.test.platform.app.InstrumentationRegistry; | ||
6 | +import androidx.test.ext.junit.runners.AndroidJUnit4; | ||
7 | + | ||
8 | +import org.junit.Test; | ||
9 | +import org.junit.runner.RunWith; | ||
10 | + | ||
11 | +import static org.junit.Assert.*; | ||
12 | + | ||
13 | +/** | ||
14 | + * Instrumented test, which will execute on an Android device. | ||
15 | + * | ||
16 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
17 | + */ | ||
18 | +@RunWith(AndroidJUnit4.class) | ||
19 | +public class ExampleInstrumentedTest { | ||
20 | + @Test | ||
21 | + public void useAppContext() { | ||
22 | + // Context of the app under test. | ||
23 | + Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); | ||
24 | + | ||
25 | + assertEquals("com.quzizi.fbbubble", appContext.getPackageName()); | ||
26 | + } | ||
27 | +} |
1 | +++ a/app/src/main/AndroidManifest.xml | ||
@@ -0,0 +1,39 @@ | @@ -0,0 +1,39 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + package="com.quzizi.fbbubble"> | ||
5 | + <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||
6 | + <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
7 | + <uses-permission android:name="android.permission.INTERNET"/> | ||
8 | + <uses-permission android:name="android.permission.READ_PHONE_STATE"/> | ||
9 | + | ||
10 | + <application | ||
11 | + android:icon="@mipmap/ic_launcher" | ||
12 | + android:label="@string/app_name" | ||
13 | + android:roundIcon="@mipmap/ic_launcher_round" | ||
14 | + android:name=".MyApplication" | ||
15 | + android:supportsRtl="true" | ||
16 | + android:theme="@style/AppTheme"> | ||
17 | + <activity android:name=".MainActivity"> | ||
18 | + <intent-filter> | ||
19 | + <action android:name="android.intent.action.MAIN" /> | ||
20 | + | ||
21 | + <category android:name="android.intent.category.LAUNCHER" /> | ||
22 | + </intent-filter> | ||
23 | + </activity> | ||
24 | + | ||
25 | + <meta-data | ||
26 | + android:name="AppsFlyerLib_key" | ||
27 | + android:value="LpxY6A97fuDqtGDprHUUbn" | ||
28 | + tools:replace="android:value" /> | ||
29 | + <meta-data | ||
30 | + android:name="flurry_key" | ||
31 | + android:value="PB2BZY7BYB8D94H6FYQD" /> | ||
32 | + <meta-data | ||
33 | + android:name="com.facebook.sdk.ApplicationId" | ||
34 | + android:value="@string/facebook_app_id" /> | ||
35 | + <meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" | ||
36 | + android:value="ca-app-pub-7964211093862896~4343267903"/> | ||
37 | + </application> | ||
38 | + | ||
39 | +</manifest> | ||
0 | \ No newline at end of file | 40 | \ No newline at end of file |
1 | +++ a/app/src/main/java/com/quzizi/fbbubble/MainActivity.java | ||
@@ -0,0 +1,479 @@ | @@ -0,0 +1,479 @@ | ||
1 | +package com.quzizi.fbbubble; | ||
2 | + | ||
3 | +import android.app.Activity; | ||
4 | +import android.content.Intent; | ||
5 | +import android.os.Bundle; | ||
6 | +import android.util.Log; | ||
7 | +import android.view.View; | ||
8 | +import android.view.ViewGroup; | ||
9 | +import android.widget.RelativeLayout; | ||
10 | +import android.widget.TextView; | ||
11 | +import android.widget.Toast; | ||
12 | + | ||
13 | + | ||
14 | +import androidx.appcompat.app.AppCompatActivity; | ||
15 | + | ||
16 | +import com.adControler.AdControler; | ||
17 | +import com.adListener.RewardedVideoListener; | ||
18 | +import com.framework.pay.GooglePay; | ||
19 | +import com.framework.pay.OnPayListener; | ||
20 | +import com.plugin.analytics.AnalyticsControl; | ||
21 | + | ||
22 | +import org.json.JSONArray; | ||
23 | +import org.json.JSONException; | ||
24 | +import org.json.JSONObject; | ||
25 | + | ||
26 | +import java.text.SimpleDateFormat; | ||
27 | +import java.util.ArrayList; | ||
28 | +import java.util.Date; | ||
29 | +import java.util.Map; | ||
30 | +import java.util.TreeMap; | ||
31 | + | ||
32 | +public class MainActivity extends AppCompatActivity implements View.OnClickListener, OnPayListener { | ||
33 | + private String TAG = MainActivity.class.getSimpleName(); | ||
34 | + private TextView mSetUserId, mGetUserId; | ||
35 | + private TextView mUserProperty, mMultipleProperty; | ||
36 | + private TextView mUserAddProperty, mUserAddMultipleProperty; | ||
37 | + private TextView mUserOnceProperty, mUserMultipleOnceProperty; | ||
38 | + private TextView mEvent, mMarketEvent; | ||
39 | + private TextView mShowBanner, mHideBanner, mShowInterstitial, mShowRewardVideo, mShowOpen, mShowInGame, mHideInGame; | ||
40 | + private Activity mActivity; | ||
41 | + private TextView mPayConfig, mGoogleProduct, mOwnedProducts, mPay, mConsumePurchase; | ||
42 | + private JSONArray mInAppProductPayArray; | ||
43 | + private ArrayList<String> mInAppProductIdList; | ||
44 | + private JSONObject mPayConfigObject; | ||
45 | + private String mPaySuccess; | ||
46 | + | ||
47 | + | ||
48 | + @Override | ||
49 | + protected void onCreate(Bundle savedInstanceState) { | ||
50 | + super.onCreate(savedInstanceState); | ||
51 | + setContentView(R.layout.activity_main); | ||
52 | + initView(); | ||
53 | + setListener(); | ||
54 | + mActivity = this; | ||
55 | + //url="https://collect.playdayy.com/" | ||
56 | + AnalyticsControl.activeThinkingData(mActivity, getString(R.string.thinkingDataKey),getString(R.string.url),true); | ||
57 | +// AdControler.useTestServer(); | ||
58 | +// AdControler.setTestDevice(getString(R.string.facebookDeviceId), getString(R.string.admobDeviceId));//上线前注释 | ||
59 | + final RelativeLayout layout = new RelativeLayout(this); | ||
60 | + //layout全屏的方式添加到当前界面中 | ||
61 | + addContentView(layout, new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); | ||
62 | + AdControler.init(mActivity, layout, false);//初始化 在确保在主进程中 | ||
63 | + AdControler.start();//开始拉取广告配置,自动加载广告id | ||
64 | + //是否需要下发订单信息 | ||
65 | + GooglePay.initPaySDKWithNewApi(mActivity,true); | ||
66 | + GooglePay.useCnServer(); //测试服务器 | ||
67 | + try{ | ||
68 | + GooglePay.setPayListener(this); | ||
69 | + }catch (Exception e){ | ||
70 | + e.printStackTrace(); | ||
71 | + } | ||
72 | + } | ||
73 | + | ||
74 | + private void initView() { | ||
75 | + mSetUserId = findViewById(R.id.setId);//设置用户属性 | ||
76 | + mGetUserId = findViewById(R.id.getId);//获取用户属性 | ||
77 | + | ||
78 | + mUserProperty = findViewById(R.id.property);//设置用户属性 | ||
79 | + mMultipleProperty = findViewById(R.id.multipleProperty);//设置多参用户属性 | ||
80 | + | ||
81 | + mUserAddProperty = findViewById(R.id.addProperty);//用户累计属性 | ||
82 | + mUserAddMultipleProperty = findViewById(R.id.addMultipleProperty);//多元用户累加属性 | ||
83 | + | ||
84 | + mUserOnceProperty = findViewById(R.id.onceProperty);//设置一次性用户属性 | ||
85 | + mUserMultipleOnceProperty = findViewById(R.id.multipleOnceProperty);//多元用户属性 | ||
86 | + | ||
87 | + mEvent = findViewById(R.id.event);//事件打点 | ||
88 | + mMarketEvent = findViewById(R.id.marketEvent);//投放打点 | ||
89 | + | ||
90 | + mShowBanner = findViewById(R.id.showBanner);//展示Banner | ||
91 | + mHideBanner = findViewById(R.id.hideBanner);//隐藏插屏 | ||
92 | + mShowInterstitial = findViewById(R.id.showInterstitial);//展示插屏 | ||
93 | + mShowRewardVideo = findViewById(R.id.showRewardVideo);//展示激励视频 | ||
94 | + mShowOpen = findViewById(R.id.showOpenAd);//展示开屏广告 | ||
95 | + mShowInGame = findViewById(R.id.showIngame);//展示Ingame | ||
96 | + mHideInGame = findViewById(R.id.hideIngame);//隐藏Ingame | ||
97 | + | ||
98 | + // | ||
99 | + mPayConfig = findViewById(R.id.payConfig); | ||
100 | + mGoogleProduct = findViewById(R.id.googleProduct);//隐藏Ingame | ||
101 | + mOwnedProducts = findViewById(R.id.ownedProducts);//隐藏Ingame | ||
102 | + mPay = findViewById(R.id.pay);//隐藏Ingame | ||
103 | + mConsumePurchase = findViewById(R.id.consumePurchase);//消耗商品 | ||
104 | + } | ||
105 | + | ||
106 | + /** | ||
107 | + * | ||
108 | + */ | ||
109 | + private void setListener() { | ||
110 | + mSetUserId.setOnClickListener(this); | ||
111 | + mGetUserId.setOnClickListener(this); | ||
112 | + mUserProperty.setOnClickListener(this); | ||
113 | + mMultipleProperty.setOnClickListener(this); | ||
114 | + mUserAddProperty.setOnClickListener(this); | ||
115 | + mUserAddMultipleProperty.setOnClickListener(this); | ||
116 | + mUserOnceProperty.setOnClickListener(this); | ||
117 | + mUserMultipleOnceProperty.setOnClickListener(this); | ||
118 | + mEvent.setOnClickListener(this); | ||
119 | + mMarketEvent.setOnClickListener(this); | ||
120 | + //广告 | ||
121 | + mShowBanner.setOnClickListener(this); | ||
122 | + mHideBanner.setOnClickListener(this); | ||
123 | + mShowInterstitial.setOnClickListener(this); | ||
124 | + mShowRewardVideo.setOnClickListener(this); | ||
125 | + mShowOpen.setOnClickListener(this); | ||
126 | + mShowInGame.setOnClickListener(this); | ||
127 | + mHideInGame.setOnClickListener(this); | ||
128 | + //支付 | ||
129 | + mPayConfig.setOnClickListener(this); | ||
130 | + mGoogleProduct.setOnClickListener(this); | ||
131 | + mOwnedProducts.setOnClickListener(this); | ||
132 | + mPay.setOnClickListener(this); | ||
133 | + mConsumePurchase.setOnClickListener(this); | ||
134 | + //设置激励视频监听 | ||
135 | + AdControler.setRewardedAdListener(new RewardedVideoListener() { | ||
136 | + @Override | ||
137 | + public void rewaredVideoReady() { | ||
138 | + //激励视频加载好了 | ||
139 | + Toast.makeText(mActivity, R.string.rewardVideoReady, Toast.LENGTH_SHORT).show(); | ||
140 | + } | ||
141 | + | ||
142 | + @Override | ||
143 | + public void rewaredVideoCompleted() { | ||
144 | + //激励视频领取奖励 | ||
145 | + Log.i(TAG, "MainActivity>>>rewaredVideoCompleted: =="); | ||
146 | + Toast.makeText(mActivity, R.string.obtainReward, Toast.LENGTH_SHORT).show(); | ||
147 | + } | ||
148 | + | ||
149 | + @Override | ||
150 | + public void rewardVideoFailed() { | ||
151 | + //激励视频播放失败 | ||
152 | + Log.i(TAG, "MainActivity>>>rewardVideoFailed: =="); | ||
153 | + } | ||
154 | + }); | ||
155 | + | ||
156 | + } | ||
157 | + | ||
158 | + @Override | ||
159 | + protected void onResume() { | ||
160 | + super.onResume(); | ||
161 | + AnalyticsControl.onResume(); | ||
162 | + } | ||
163 | + | ||
164 | + @Override | ||
165 | + protected void onPause() { | ||
166 | + super.onPause(); | ||
167 | + AnalyticsControl.onPause(); | ||
168 | + } | ||
169 | + | ||
170 | + @Override | ||
171 | + protected void onDestroy() { | ||
172 | + super.onDestroy(); | ||
173 | + AnalyticsControl.onDestroy(); | ||
174 | + GooglePay.destroy(); | ||
175 | + } | ||
176 | + | ||
177 | + @Override | ||
178 | + protected void onActivityResult(int requestCode, int resultCode, Intent data) { | ||
179 | + super.onActivityResult(requestCode, resultCode, data); | ||
180 | + GooglePay.onActivityResult(requestCode, resultCode, data); | ||
181 | + } | ||
182 | + | ||
183 | + @Override | ||
184 | + public void onClick(View view) { | ||
185 | + switch (view.getId()) { | ||
186 | + case R.id.setId: | ||
187 | + AnalyticsControl.setUserId(mActivity, "2020mmddhhss"); | ||
188 | + break; | ||
189 | + case R.id.getId: | ||
190 | + String usrId = AnalyticsControl.getUserId(mActivity);//该id 通过setUserId设置的数据 | ||
191 | + Log.i(TAG, "MainActivity>>>onClick: 获取到的用户id==" + usrId); | ||
192 | + String distinctId = AnalyticsControl.getUserDistinctId(mActivity); //改id 是thinkingdata 自动生成的 | ||
193 | + Log.i(TAG, "MainActivity>>>onClick: 获取到的访客id==" + distinctId); | ||
194 | + break; | ||
195 | + case R.id.property: | ||
196 | + AnalyticsControl.setUserProperty(mActivity, "demoKey", "demoValue"); //设置用户属性 | ||
197 | + break; | ||
198 | + case R.id.multipleProperty: | ||
199 | + JSONObject object = new JSONObject(); | ||
200 | + try { | ||
201 | + object.put("demoKeyString", "demoValue"); | ||
202 | + object.put("demoKeyInt", 2020); | ||
203 | + object.put("demoKeyDouble", 2020.8); | ||
204 | + object.put("demoKeyBoolean", true); | ||
205 | + | ||
206 | + } catch (JSONException e) { | ||
207 | + e.printStackTrace(); | ||
208 | + } | ||
209 | + AnalyticsControl.setUserProperties(mActivity, object); | ||
210 | + break; | ||
211 | + case R.id.addProperty: | ||
212 | + //每触发一次属性demoKeyAddInt的值就增加1 | ||
213 | + AnalyticsControl.setAddedProperty(mActivity, "demoKeyAddInt", 1); | ||
214 | + break; | ||
215 | + case R.id.addMultipleProperty: | ||
216 | + JSONObject addObject = new JSONObject(); | ||
217 | + try { | ||
218 | + addObject.put("demoKeyAddInt", 2); | ||
219 | + addObject.put("demoKeyDouble", 2020.8); | ||
220 | + } catch (JSONException e) { | ||
221 | + e.printStackTrace(); | ||
222 | + } | ||
223 | + //每触发一次demoKeyAddInt属性值增加2,demoKeyDouble属性值增加2020.8 | ||
224 | + AnalyticsControl.setAddedProperties(mActivity, addObject); | ||
225 | + break; | ||
226 | + case R.id.onceProperty: | ||
227 | + Date currentTime = new Date(); | ||
228 | + SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | ||
229 | + //无论触发多少次,demoRegisterTime的属性值永远是安装后第一次设置的时间 | ||
230 | + AnalyticsControl.setOnceProperty(mActivity, "demoRegisterTime", formatter.format(currentTime));// | ||
231 | + | ||
232 | + break; | ||
233 | + case R.id.multipleOnceProperty: | ||
234 | + try { | ||
235 | + JSONObject objectOnnce = new JSONObject(); | ||
236 | + objectOnnce.put("demoRegisterVersion", "1.0.0"); | ||
237 | + objectOnnce.put("demoRegisterData", new Date()); | ||
238 | + AnalyticsControl.setOnceProperties(mActivity, objectOnnce); | ||
239 | + } catch (Exception e) { | ||
240 | + e.printStackTrace(); | ||
241 | + } | ||
242 | + break; | ||
243 | + case R.id.event: | ||
244 | + try { | ||
245 | + JSONObject eventObject = new JSONObject(); | ||
246 | + eventObject.put("demoTime", new Date()); | ||
247 | + eventObject.put("demoNum", 1); | ||
248 | + AnalyticsControl.sendEvent("demoEventName", eventObject.toString()); | ||
249 | + } catch (Exception e) { | ||
250 | + e.printStackTrace(); | ||
251 | + } | ||
252 | + | ||
253 | + break; | ||
254 | + case R.id.marketEvent: | ||
255 | + try { | ||
256 | + | ||
257 | + Bundle bundle = new Bundle(); | ||
258 | + bundle.putString("demoKey", "demoValue"); | ||
259 | + AnalyticsControl.sendFacebookEvent("demoEventName", bundle); | ||
260 | + AnalyticsControl.sendFirebaseEvent("tf_demoEventName", bundle); | ||
261 | + Map<String, String> map = new TreeMap<>(); | ||
262 | + map.put("demoKey", "demoValue"); | ||
263 | + AnalyticsControl.sendAppsFlyerEvent(mActivity, "demoEventName", map); | ||
264 | + } catch (Exception e) { | ||
265 | + e.printStackTrace(); | ||
266 | + } | ||
267 | + | ||
268 | + break; | ||
269 | + case R.id.showBanner: | ||
270 | + if (!AdControler.isBannerReady()) { | ||
271 | + Toast.makeText(mActivity, R.string.bannerNoFill, Toast.LENGTH_SHORT).show(); | ||
272 | + } | ||
273 | + AdControler.showBottomADBannar(AdControler.ADPOS_BOTTOM); | ||
274 | + | ||
275 | + | ||
276 | + break; | ||
277 | + case R.id.hideBanner: | ||
278 | + AdControler.hiddenBannarWithStack(); | ||
279 | + | ||
280 | + break; | ||
281 | + case R.id.showInterstitial: | ||
282 | + if (AdControler.isInterstitialReady()) { | ||
283 | + AdControler.showInterstitialAD(); | ||
284 | + } else { | ||
285 | + Toast.makeText(mActivity, R.string.interstitialNoFill, Toast.LENGTH_SHORT).show(); | ||
286 | + } | ||
287 | + | ||
288 | + break; | ||
289 | + case R.id.showRewardVideo: | ||
290 | + if (AdControler.isRewardVideoReady()) { | ||
291 | + AdControler.showRewardVideo(); | ||
292 | + } else { | ||
293 | + Toast.makeText(mActivity, R.string.rewardVideoNoFill, Toast.LENGTH_SHORT).show(); | ||
294 | + } | ||
295 | + break; | ||
296 | + case R.id.showOpenAd: | ||
297 | + if (AdControler.isOpenAdReady()) { | ||
298 | + AdControler.showOpenAd(); | ||
299 | + } else { | ||
300 | + Toast.makeText(mActivity, R.string.openAdNoFill, Toast.LENGTH_SHORT).show(); | ||
301 | + } | ||
302 | + | ||
303 | + break; | ||
304 | + case R.id.showIngame: | ||
305 | + JSONObject params = new JSONObject(); | ||
306 | + try { | ||
307 | + JSONObject objectParams = new JSONObject(); | ||
308 | + objectParams.put("w", 800); | ||
309 | + objectParams.put("h", 800); | ||
310 | + objectParams.put("top", 50); | ||
311 | + objectParams.put("centerH", 10); | ||
312 | + params.put("view", objectParams); | ||
313 | + objectParams = new JSONObject(); | ||
314 | + objectParams.put("w", 150); | ||
315 | + objectParams.put("h", 150); | ||
316 | + objectParams.put("top", 10); | ||
317 | + objectParams.put("left", 10); | ||
318 | + params.put("icon", objectParams); | ||
319 | + objectParams = new JSONObject(); | ||
320 | + objectParams.put("w", 500); | ||
321 | + objectParams.put("h", 150); | ||
322 | + objectParams.put("top", 20); | ||
323 | + objectParams.put("left", 170); | ||
324 | + objectParams.put("color", "#000000"); | ||
325 | + objectParams.put("size", "24"); | ||
326 | + params.put("title", objectParams); | ||
327 | + objectParams = new JSONObject(); | ||
328 | + objectParams.put("w", 700); | ||
329 | + objectParams.put("h", 100); | ||
330 | + objectParams.put("top", 170); | ||
331 | + objectParams.put("left", 50); | ||
332 | + objectParams.put("color", "#000000"); | ||
333 | + objectParams.put("size", "16"); | ||
334 | + params.put("body", objectParams); | ||
335 | + objectParams = new JSONObject(); | ||
336 | + objectParams.put("w", 800); | ||
337 | + objectParams.put("h", 400); | ||
338 | + objectParams.put("top", 300); | ||
339 | + objectParams.put("left", 0); | ||
340 | + params.put("media", objectParams); | ||
341 | + objectParams = new JSONObject(); | ||
342 | + objectParams.put("w", 500); | ||
343 | + objectParams.put("h", 80); | ||
344 | + objectParams.put("color", "#0000ff"); | ||
345 | + objectParams.put("bottom", 10); | ||
346 | + objectParams.put("centerH", 20); | ||
347 | + params.put("button", objectParams); | ||
348 | + objectParams = new JSONObject(); | ||
349 | + objectParams.put("color", "#ff0000"); | ||
350 | + objectParams.put("size", "20"); | ||
351 | + params.put("action", objectParams); | ||
352 | + } catch (Exception e) { | ||
353 | + Log.i(TAG, "MainActivity>>>onClick: ==" + e.toString()); | ||
354 | + } | ||
355 | + if (!AdControler.isInGameReady()) { | ||
356 | + Toast.makeText(mActivity, R.string.inGameNoFill, Toast.LENGTH_SHORT).show(); | ||
357 | + } | ||
358 | + | ||
359 | + new Thread(new Runnable() { | ||
360 | + @Override | ||
361 | + public void run() { | ||
362 | + Log.i(TAG, "MainActivity>>>run: ==" + params.toString()); | ||
363 | + AdControler.showInGameAD(params.toString()); | ||
364 | + } | ||
365 | + }).start(); | ||
366 | + break; | ||
367 | + case R.id.hideIngame: | ||
368 | + AdControler.hiddenInGameAD(); | ||
369 | + break; | ||
370 | + //支付系统 | ||
371 | + case R.id.payConfig: | ||
372 | + String payMessage = GooglePay.getPayConfig(); | ||
373 | + Log.i(TAG, "MainActivity>>>onClick: =支付数据=" + payMessage); | ||
374 | + try { | ||
375 | + mPayConfigObject = new JSONObject(payMessage); | ||
376 | + //内购订单 | ||
377 | + mInAppProductPayArray = mPayConfigObject.getJSONArray("inAppProductInfo"); | ||
378 | + } catch (Exception e) { | ||
379 | + e.printStackTrace(); | ||
380 | + } | ||
381 | + break; | ||
382 | + case R.id.googleProduct: | ||
383 | + mInAppProductIdList = new ArrayList<>(); | ||
384 | + try { | ||
385 | + if (mInAppProductPayArray == null) { | ||
386 | + Toast.makeText(mActivity, R.string.inspectionProcess, Toast.LENGTH_SHORT).show(); | ||
387 | + return; | ||
388 | + } | ||
389 | + for (int i = 0; i < mInAppProductPayArray.length(); i++) { | ||
390 | + JSONObject inAppProductMessage = mInAppProductPayArray.getJSONObject(i); | ||
391 | + String id = inAppProductMessage.getString("payId"); | ||
392 | + Log.i(TAG, "MainActivity>>>onClick: ==" + id); | ||
393 | + mInAppProductIdList.add(id); | ||
394 | + } | ||
395 | + } catch (Exception e) { | ||
396 | + e.printStackTrace(); | ||
397 | + } | ||
398 | + GooglePay.requestProducts(mInAppProductIdList, null); | ||
399 | + break; | ||
400 | + case R.id.ownedProducts: | ||
401 | + ArrayList<String> ownedProductList = GooglePay.getOwnedProducts(); | ||
402 | + Log.i(TAG, "MainActivity>>>onClick: ==" + ownedProductList); | ||
403 | + break; | ||
404 | + case R.id.pay: | ||
405 | + if (mInAppProductIdList == null || mInAppProductPayArray == null || mPayConfigObject == null || mInAppProductIdList.size() == 0 ) { | ||
406 | + Toast.makeText(mActivity, R.string.inspectionProcess, Toast.LENGTH_SHORT).show(); | ||
407 | + return; | ||
408 | + } | ||
409 | + try { | ||
410 | + JSONObject payObject = new JSONObject(); | ||
411 | + payObject.put("productId", mInAppProductIdList.get(0));//这里随机支付第一个商品的id | ||
412 | + payObject.put("time", System.currentTimeMillis() / 1000); | ||
413 | + payObject.put("name", mInAppProductPayArray.getJSONObject(0).get("name")); | ||
414 | + payObject.put("group", mPayConfigObject.get("groupIndex")); | ||
415 | + payObject.put("consumable", mPayConfigObject.get("consumable")); | ||
416 | + payObject.put("shopItemId", mPayConfigObject.get("shopItemId")); | ||
417 | + GooglePay.payForProduct(payObject.toString(), false,"scene","USD",0,0);//这个是内购商品,不是订阅商品 | ||
418 | + } catch (Exception e) { | ||
419 | + e.printStackTrace(); | ||
420 | + } | ||
421 | + | ||
422 | + break; | ||
423 | + case R.id.consumePurchase: | ||
424 | + if (mPaySuccess != null) { | ||
425 | + GooglePay.consumePurchase(mPaySuccess, false);//此处支付的不是订阅商品, | ||
426 | + } else { | ||
427 | + Toast.makeText(mActivity, "没有拿到支付成功数据", Toast.LENGTH_SHORT).show(); | ||
428 | + } | ||
429 | + break; | ||
430 | + } | ||
431 | + } | ||
432 | + | ||
433 | + @Override | ||
434 | + public void onPaySuccess(String s) { | ||
435 | + //支付成功 的数据s 消耗时使用 | ||
436 | + Log.i(TAG, "MainActivity>>>onPaySuccess: ==" + s); | ||
437 | + mPaySuccess = s; | ||
438 | + } | ||
439 | + | ||
440 | + @Override | ||
441 | + public void onPayFailed(String s) { | ||
442 | + Log.i(TAG, "MainActivity>>>onPayFailed: 支付失败==" + s); | ||
443 | + } | ||
444 | + | ||
445 | + @Override | ||
446 | + public void onPayCancel() { | ||
447 | + Log.i(TAG, "MainActivity>>>onPayCancel: =="); | ||
448 | + } | ||
449 | + | ||
450 | + @Override | ||
451 | + public void onRequestProducts(ArrayList arrayList) { | ||
452 | + Log.i(TAG, "MainActivity>>>onRequestProducts: ==" + arrayList.toString()); | ||
453 | + } | ||
454 | + | ||
455 | + @Override | ||
456 | + public void onQuerySubsProducts(ArrayList arrayList) { | ||
457 | + Log.i(TAG, "MainActivity>>>onQuerySubsProducts: =="); | ||
458 | + } | ||
459 | + | ||
460 | + @Override | ||
461 | + public void onConfigData(String s) { | ||
462 | + Log.i(TAG, "MainActivity>>>onConfigData: ==" + s); | ||
463 | + } | ||
464 | + | ||
465 | + @Override | ||
466 | + public void onConfigDataFailed(String s) { | ||
467 | + Log.i(TAG, "MainActivity>>>onConfigDataFailed: ==" + s); | ||
468 | + } | ||
469 | + | ||
470 | + @Override | ||
471 | + public void onOrderUploaded() { | ||
472 | + Log.i(TAG, "MainActivity>>>onOrderUploaded: =="); | ||
473 | + } | ||
474 | + | ||
475 | + @Override | ||
476 | + public void onOrderUploadedFailed() { | ||
477 | + Log.i(TAG, "MainActivity>>>onOrderUploadedFailed: =="); | ||
478 | + } | ||
479 | +} |
app/src/main/java/com/quzizi/fbbubble/MyApplication.java
0 → 100644
1 | +++ a/app/src/main/java/com/quzizi/fbbubble/MyApplication.java | ||
@@ -0,0 +1,19 @@ | @@ -0,0 +1,19 @@ | ||
1 | +package com.quzizi.fbbubble; | ||
2 | + | ||
3 | +import android.app.Application; | ||
4 | + | ||
5 | +import com.plugin.analytics.AnalyticsControl; | ||
6 | +import com.plugins.lib.firebase.FirebaseHelper; | ||
7 | + | ||
8 | + | ||
9 | +/** | ||
10 | + * Created on 2020/8/12. | ||
11 | + **/ | ||
12 | +public class MyApplication extends Application { | ||
13 | + @Override | ||
14 | + public void onCreate() { | ||
15 | + super.onCreate(); | ||
16 | + AnalyticsControl.initAnalytics(this); | ||
17 | + FirebaseHelper.init(this); | ||
18 | + } | ||
19 | +} |
1 | +++ a/app/src/main/res/drawable/ripple_bg.xml | ||
@@ -0,0 +1,18 @@ | @@ -0,0 +1,18 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<selector xmlns:android="http://schemas.android.com/apk/res/android"> | ||
3 | + <!--按下点击--> | ||
4 | + <item android:state_enabled="true" android:state_pressed="true"> | ||
5 | + <shape> | ||
6 | + <solid android:color="@android:color/holo_orange_dark" /> | ||
7 | + </shape> | ||
8 | + </item> | ||
9 | + | ||
10 | + | ||
11 | + <item android:state_enabled="false" android:state_pressed="false"> | ||
12 | + <shape> | ||
13 | + <solid android:color="@android:color/darker_gray" /> | ||
14 | + </shape> | ||
15 | + </item> | ||
16 | + | ||
17 | + | ||
18 | +</selector> |
1 | +++ a/app/src/main/res/layout/activity_main.xml | ||
@@ -0,0 +1,241 @@ | @@ -0,0 +1,241 @@ | ||
1 | +<?xml version="1.0" encoding="utf-8"?> | ||
2 | +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
3 | + xmlns:tools="http://schemas.android.com/tools" | ||
4 | + android:layout_width="match_parent" | ||
5 | + android:layout_height="match_parent" | ||
6 | + android:orientation="vertical" | ||
7 | + android:padding="10dp" | ||
8 | + tools:context=".MainActivity"> | ||
9 | + | ||
10 | + <ScrollView | ||
11 | + android:layout_width="match_parent" | ||
12 | + android:layout_height="match_parent"> | ||
13 | + | ||
14 | + <LinearLayout | ||
15 | + android:layout_width="match_parent" | ||
16 | + android:layout_height="match_parent" | ||
17 | + android:orientation="horizontal"> | ||
18 | + | ||
19 | + <LinearLayout | ||
20 | + android:layout_width="wrap_content" | ||
21 | + android:layout_height="match_parent" | ||
22 | + android:layout_weight="1" | ||
23 | + android:gravity="center_horizontal" | ||
24 | + android:orientation="vertical"> | ||
25 | + | ||
26 | + <TextView | ||
27 | + android:id="@+id/setId" | ||
28 | + android:layout_width="100dp" | ||
29 | + android:layout_height="40dp" | ||
30 | + android:background="@drawable/ripple_bg" | ||
31 | + android:gravity="center" | ||
32 | + android:text="@string/setUserId" /> | ||
33 | + | ||
34 | + <TextView | ||
35 | + android:id="@+id/getId" | ||
36 | + android:layout_width="100dp" | ||
37 | + android:layout_height="40dp" | ||
38 | + android:layout_marginTop="10dp" | ||
39 | + android:background="@drawable/ripple_bg" | ||
40 | + android:gravity="center" | ||
41 | + android:text="@string/getUserId" /> | ||
42 | + | ||
43 | + <TextView | ||
44 | + android:id="@+id/property" | ||
45 | + android:layout_width="100dp" | ||
46 | + android:layout_height="40dp" | ||
47 | + android:layout_marginTop="10dp" | ||
48 | + android:background="@drawable/ripple_bg" | ||
49 | + android:gravity="center" | ||
50 | + android:text="@string/property" /> | ||
51 | + | ||
52 | + <TextView | ||
53 | + android:id="@+id/multipleProperty" | ||
54 | + android:layout_width="100dp" | ||
55 | + android:layout_height="40dp" | ||
56 | + android:layout_marginTop="10dp" | ||
57 | + android:background="@drawable/ripple_bg" | ||
58 | + android:gravity="center" | ||
59 | + android:text="@string/multipleProperty" /> | ||
60 | + | ||
61 | + <TextView | ||
62 | + android:id="@+id/addProperty" | ||
63 | + android:layout_width="100dp" | ||
64 | + android:layout_height="40dp" | ||
65 | + android:layout_marginTop="10dp" | ||
66 | + android:background="@drawable/ripple_bg" | ||
67 | + android:gravity="center" | ||
68 | + android:text="@string/addProperty" /> | ||
69 | + | ||
70 | + <TextView | ||
71 | + android:id="@+id/addMultipleProperty" | ||
72 | + android:layout_width="100dp" | ||
73 | + android:layout_height="40dp" | ||
74 | + android:layout_marginTop="10dp" | ||
75 | + android:background="@drawable/ripple_bg" | ||
76 | + android:gravity="center" | ||
77 | + android:text="@string/addMultipleProperty" /> | ||
78 | + | ||
79 | + <TextView | ||
80 | + android:id="@+id/onceProperty" | ||
81 | + android:layout_width="100dp" | ||
82 | + android:layout_height="40dp" | ||
83 | + android:layout_marginTop="10dp" | ||
84 | + android:background="@drawable/ripple_bg" | ||
85 | + android:gravity="center" | ||
86 | + android:text="@string/onceProperty" /> | ||
87 | + | ||
88 | + <TextView | ||
89 | + android:id="@+id/multipleOnceProperty" | ||
90 | + android:layout_width="100dp" | ||
91 | + android:layout_height="40dp" | ||
92 | + android:layout_marginTop="10dp" | ||
93 | + android:background="@drawable/ripple_bg" | ||
94 | + android:gravity="center" | ||
95 | + android:text="@string/multipleOnceProperty" /> | ||
96 | + | ||
97 | + <TextView | ||
98 | + android:id="@+id/event" | ||
99 | + android:layout_width="100dp" | ||
100 | + android:layout_height="40dp" | ||
101 | + android:layout_marginTop="10dp" | ||
102 | + android:background="@drawable/ripple_bg" | ||
103 | + android:gravity="center" | ||
104 | + android:text="@string/event" /> | ||
105 | + | ||
106 | + <TextView | ||
107 | + android:id="@+id/marketEvent" | ||
108 | + android:layout_width="100dp" | ||
109 | + android:layout_height="40dp" | ||
110 | + android:layout_marginTop="10dp" | ||
111 | + android:background="@drawable/ripple_bg" | ||
112 | + android:gravity="center" | ||
113 | + android:text="@string/marketEvent" /> | ||
114 | + </LinearLayout> | ||
115 | + | ||
116 | + <LinearLayout | ||
117 | + android:layout_width="wrap_content" | ||
118 | + android:layout_height="match_parent" | ||
119 | + android:layout_weight="1" | ||
120 | + android:gravity="center_horizontal" | ||
121 | + android:orientation="vertical"> | ||
122 | + | ||
123 | + <TextView | ||
124 | + android:id="@+id/showBanner" | ||
125 | + android:layout_width="100dp" | ||
126 | + android:layout_height="40dp" | ||
127 | + android:background="@drawable/ripple_bg" | ||
128 | + android:gravity="center" | ||
129 | + android:text="@string/showBanner" /> | ||
130 | + | ||
131 | + <TextView | ||
132 | + android:id="@+id/hideBanner" | ||
133 | + android:layout_width="100dp" | ||
134 | + android:layout_height="40dp" | ||
135 | + android:layout_marginTop="10dp" | ||
136 | + android:background="@drawable/ripple_bg" | ||
137 | + android:gravity="center" | ||
138 | + android:text="@string/hideBanner" /> | ||
139 | + | ||
140 | + <TextView | ||
141 | + android:id="@+id/showInterstitial" | ||
142 | + android:layout_width="100dp" | ||
143 | + android:layout_height="40dp" | ||
144 | + android:layout_marginTop="10dp" | ||
145 | + android:background="@drawable/ripple_bg" | ||
146 | + android:gravity="center" | ||
147 | + android:text="@string/showInterstitial" /> | ||
148 | + | ||
149 | + <TextView | ||
150 | + android:id="@+id/showRewardVideo" | ||
151 | + android:layout_width="100dp" | ||
152 | + android:layout_height="40dp" | ||
153 | + android:layout_marginTop="10dp" | ||
154 | + android:background="@drawable/ripple_bg" | ||
155 | + android:gravity="center" | ||
156 | + android:text="@string/showRewardVideo" /> | ||
157 | + | ||
158 | + <TextView | ||
159 | + android:id="@+id/showOpenAd" | ||
160 | + android:layout_width="100dp" | ||
161 | + android:layout_height="40dp" | ||
162 | + android:layout_marginTop="10dp" | ||
163 | + android:background="@drawable/ripple_bg" | ||
164 | + android:gravity="center" | ||
165 | + android:text="@string/showOpenAd" /> | ||
166 | + | ||
167 | + <TextView | ||
168 | + android:id="@+id/showIngame" | ||
169 | + android:layout_width="100dp" | ||
170 | + android:layout_height="40dp" | ||
171 | + android:layout_marginTop="10dp" | ||
172 | + android:background="@drawable/ripple_bg" | ||
173 | + android:gravity="center" | ||
174 | + android:text="@string/showIngame" /> | ||
175 | + | ||
176 | + <TextView | ||
177 | + android:id="@+id/hideIngame" | ||
178 | + android:layout_width="100dp" | ||
179 | + android:layout_height="40dp" | ||
180 | + android:layout_marginTop="10dp" | ||
181 | + android:background="@drawable/ripple_bg" | ||
182 | + android:gravity="center" | ||
183 | + android:text="@string/hideIngame" /> | ||
184 | + | ||
185 | + </LinearLayout> | ||
186 | + | ||
187 | + <LinearLayout | ||
188 | + android:layout_width="wrap_content" | ||
189 | + android:layout_height="match_parent" | ||
190 | + android:layout_weight="1" | ||
191 | + android:gravity="center_horizontal" | ||
192 | + android:orientation="vertical"> | ||
193 | + | ||
194 | + <TextView | ||
195 | + android:id="@+id/payConfig" | ||
196 | + android:layout_width="100dp" | ||
197 | + android:layout_height="40dp" | ||
198 | + android:background="@drawable/ripple_bg" | ||
199 | + android:gravity="center" | ||
200 | + android:text="@string/payConfig" /> | ||
201 | + | ||
202 | + <TextView | ||
203 | + android:id="@+id/googleProduct" | ||
204 | + android:layout_width="100dp" | ||
205 | + android:layout_height="40dp" | ||
206 | + android:layout_marginTop="10dp" | ||
207 | + android:background="@drawable/ripple_bg" | ||
208 | + android:gravity="center" | ||
209 | + android:text="@string/googleProduct" /> | ||
210 | + | ||
211 | + | ||
212 | + <TextView | ||
213 | + android:id="@+id/ownedProducts" | ||
214 | + android:layout_width="100dp" | ||
215 | + android:layout_height="40dp" | ||
216 | + android:layout_marginTop="10dp" | ||
217 | + android:background="@drawable/ripple_bg" | ||
218 | + android:gravity="center" | ||
219 | + android:text="@string/ownedProducts" /> | ||
220 | + | ||
221 | + <TextView | ||
222 | + android:id="@+id/pay" | ||
223 | + android:layout_width="100dp" | ||
224 | + android:layout_height="40dp" | ||
225 | + android:layout_marginTop="10dp" | ||
226 | + android:background="@drawable/ripple_bg" | ||
227 | + android:gravity="center" | ||
228 | + android:text="@string/pay" /> | ||
229 | + | ||
230 | + <TextView | ||
231 | + android:id="@+id/consumePurchase" | ||
232 | + android:layout_width="100dp" | ||
233 | + android:layout_height="40dp" | ||
234 | + android:layout_marginTop="10dp" | ||
235 | + android:background="@drawable/ripple_bg" | ||
236 | + android:gravity="center" | ||
237 | + android:text="@string/consumePurchase" /> | ||
238 | + </LinearLayout> | ||
239 | + </LinearLayout> | ||
240 | + </ScrollView> | ||
241 | +</LinearLayout> | ||
0 | \ No newline at end of file | 242 | \ No newline at end of file |
3.51 KB
5.21 KB
2.57 KB
3.31 KB
4.81 KB
7.3 KB
7.72 KB
11.6 KB
10.4 KB
16.2 KB
1 | +++ a/app/src/main/res/values/strings.xml | ||
@@ -0,0 +1,38 @@ | @@ -0,0 +1,38 @@ | ||
1 | +<resources> | ||
2 | + <string name="app_name">PluginsDemo</string> | ||
3 | + <string name="facebook_app_id" translatable="false">257285502517991</string> | ||
4 | + <string name="setUserId">设置用户ID</string> | ||
5 | + <string name="getUserId">获取用户ID</string> | ||
6 | + <string name="property">设置用户属性</string> | ||
7 | + <string name="multipleProperty">多参属性</string> | ||
8 | + <string name="addProperty">单一累加属性</string> | ||
9 | + <string name="addMultipleProperty">多参累加属性</string> | ||
10 | + <string name="onceProperty">单一永久属性</string> | ||
11 | + <string name="multipleOnceProperty">多参永久属性</string> | ||
12 | + <string name="event">事件打点</string> | ||
13 | + <string name="marketEvent">投放事件打点</string> | ||
14 | + <string name="showBanner">展示banner</string> | ||
15 | + <string name="hideBanner">隐藏banner</string> | ||
16 | + <string name="showInterstitial">展示插屏广告</string> | ||
17 | + <string name="showRewardVideo">展示激励视频</string> | ||
18 | + <string name="showOpenAd">展示开屏广告</string> | ||
19 | + <string name="showIngame">展示InGame</string> | ||
20 | + <string name="hideIngame">隐藏InGame</string> | ||
21 | + <string name="payConfig">拉取服务器数据</string> | ||
22 | + <string name="googleProduct">拉取商店详情</string> | ||
23 | + <string name="ownedProducts">持有订单查询</string> | ||
24 | + <string name="pay">发起支付</string> | ||
25 | + <string name="consumePurchase">消耗商品</string> | ||
26 | + <string name="facebookDeviceId">D7BDE0F6F4C421B66FAA239F0A63075B</string> | ||
27 | + <string name="admobDeviceId">de263ff7-94d3-4458-8506-95bf20109e24</string> | ||
28 | + <string name="thinkingDataKey">ec7466297eb640fd817eb5c830c2b144</string> | ||
29 | + <string name="rewardVideoReady">激励视频填充</string> | ||
30 | + <string name="obtainReward">领取奖励</string> | ||
31 | + <string name="bannerNoFill">Banner 未填充</string> | ||
32 | + <string name="interstitialNoFill">插屏广告未填充</string> | ||
33 | + <string name="rewardVideoNoFill">激励视频未填充</string> | ||
34 | + <string name="openAdNoFill">开屏广告未填充</string> | ||
35 | + <string name="inGameNoFill">InGame未填充</string> | ||
36 | + <string name="inspectionProcess">检查流程以及包名是否正确</string> | ||
37 | + <string name="url">"https://collect.playdayy.com/"</string> | ||
38 | +</resources> |
1 | +++ a/app/src/main/res/values/styles.xml | ||
@@ -0,0 +1,11 @@ | @@ -0,0 +1,11 @@ | ||
1 | +<resources> | ||
2 | + | ||
3 | + <!-- Base application theme. --> | ||
4 | + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> | ||
5 | + <!-- Customize your theme here. --> | ||
6 | + <item name="colorPrimary">@color/colorPrimary</item> | ||
7 | + <item name="colorPrimaryDark">@color/colorPrimaryDark</item> | ||
8 | + <item name="colorAccent">@color/colorAccent</item> | ||
9 | + </style> | ||
10 | + | ||
11 | +</resources> |
app/src/test/java/com/quzizi/fbbubble/ExampleUnitTest.java
0 → 100644
1 | +++ a/app/src/test/java/com/quzizi/fbbubble/ExampleUnitTest.java | ||
@@ -0,0 +1,17 @@ | @@ -0,0 +1,17 @@ | ||
1 | +package com.quzizi.fbbubble; | ||
2 | + | ||
3 | +import org.junit.Test; | ||
4 | + | ||
5 | +import static org.junit.Assert.*; | ||
6 | + | ||
7 | +/** | ||
8 | + * Example local unit test, which will execute on the development machine (host). | ||
9 | + * | ||
10 | + * @see <a href="http://d.android.com/tools/testing">Testing documentation</a> | ||
11 | + */ | ||
12 | +public class ExampleUnitTest { | ||
13 | + @Test | ||
14 | + public void addition_isCorrect() { | ||
15 | + assertEquals(4, 2 + 2); | ||
16 | + } | ||
17 | +} | ||
0 | \ No newline at end of file | 18 | \ No newline at end of file |
1 | +++ a/build.gradle | ||
@@ -0,0 +1,57 @@ | @@ -0,0 +1,57 @@ | ||
1 | +// Top-level build file where you can add configuration options common to all sub-projects/modules. | ||
2 | + | ||
3 | +buildscript { | ||
4 | + | ||
5 | + repositories { | ||
6 | + google() | ||
7 | + jcenter() | ||
8 | + mavenCentral() | ||
9 | + | ||
10 | + } | ||
11 | + dependencies { | ||
12 | + classpath 'com.android.tools.build:gradle:3.4.3' | ||
13 | + classpath 'com.google.gms:google-services:4.3.4' | ||
14 | + | ||
15 | + | ||
16 | + // NOTE: Do not place your application dependencies here; they belong | ||
17 | + // in the individual module build.gradle files | ||
18 | + } | ||
19 | +} | ||
20 | + | ||
21 | +allprojects { | ||
22 | + repositories { | ||
23 | + google() | ||
24 | + jcenter() | ||
25 | + mavenCentral() | ||
26 | + | ||
27 | + maven { url 'https://jitpack.io' } | ||
28 | + maven{ | ||
29 | + url "http://47.94.86.25:8081/repository/maven-group/" | ||
30 | + credentials { | ||
31 | + username "pub45153" | ||
32 | + password "mhjfk5asj2" | ||
33 | + } | ||
34 | + } | ||
35 | + maven{ | ||
36 | + url "http://47.94.86.25:8081/repository/maven-beta/" | ||
37 | + credentials { | ||
38 | + username "pub45153" | ||
39 | + password "mhjfk5asj2" | ||
40 | + } | ||
41 | + } | ||
42 | + maven { | ||
43 | + name "Tapjoy's maven repo" | ||
44 | + url "https://tapjoy.bintray.com/maven" | ||
45 | + } | ||
46 | + maven { url "https://repo1.maven.org/maven2/com/chartboost/chartboost-sdk/" } | ||
47 | + maven { url "https://cdn2.inner-active.mobi/legacy-maven/marketplace" } | ||
48 | + maven { url 'https://dl.bintray.com/ironsource-mobile/android-sdk'} | ||
49 | + maven { url "https://adcolony.bintray.com/AdColony" } | ||
50 | + maven { url "http://maven.display.io/" } | ||
51 | + | ||
52 | + } | ||
53 | +} | ||
54 | + | ||
55 | +task clean(type: Delete) { | ||
56 | + delete rootProject.buildDir | ||
57 | +} |
1 | +++ a/gradle.properties | ||
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +# Project-wide Gradle settings. | ||
2 | +# IDE (e.g. Android Studio) users: | ||
3 | +# Gradle settings configured through the IDE *will override* | ||
4 | +# any settings specified in this file. | ||
5 | +# For more details on how to configure your build environment visit | ||
6 | +# http://www.gradle.org/docs/current/userguide/build_environment.html | ||
7 | +# Specifies the JVM arguments used for the daemon process. | ||
8 | +# The setting is particularly useful for tweaking memory settings. | ||
9 | +org.gradle.jvmargs=-Xmx1536m | ||
10 | +# When configured, Gradle will run in incubating parallel mode. | ||
11 | +# This option should only be used with decoupled projects. More details, visit | ||
12 | +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects | ||
13 | +# org.gradle.parallel=true | ||
14 | +# AndroidX package structure to make it clearer which packages are bundled with the | ||
15 | +# Android operating system, and which are packaged with your app's APK | ||
16 | +# https://developer.android.com/topic/libraries/support-library/androidx-rn | ||
17 | +android.useAndroidX=true | ||
18 | +# Automatically convert third-party libraries to use AndroidX | ||
19 | +android.enableJetifier=true | ||
20 | + |
No preview for this file type
1 | +++ a/gradle/wrapper/gradle-wrapper.properties | ||
@@ -0,0 +1,6 @@ | @@ -0,0 +1,6 @@ | ||
1 | +#Tue Aug 11 19:55:13 CST 2020 | ||
2 | +distributionBase=GRADLE_USER_HOME | ||
3 | +distributionPath=wrapper/dists | ||
4 | +zipStoreBase=GRADLE_USER_HOME | ||
5 | +zipStorePath=wrapper/dists | ||
6 | +distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip |
1 | +++ a/gradlew | ||
@@ -0,0 +1,172 @@ | @@ -0,0 +1,172 @@ | ||
1 | +#!/usr/bin/env sh | ||
2 | + | ||
3 | +############################################################################## | ||
4 | +## | ||
5 | +## Gradle start up script for UN*X | ||
6 | +## | ||
7 | +############################################################################## | ||
8 | + | ||
9 | +# Attempt to set APP_HOME | ||
10 | +# Resolve links: $0 may be a link | ||
11 | +PRG="$0" | ||
12 | +# Need this for relative symlinks. | ||
13 | +while [ -h "$PRG" ] ; do | ||
14 | + ls=`ls -ld "$PRG"` | ||
15 | + link=`expr "$ls" : '.*-> \(.*\)$'` | ||
16 | + if expr "$link" : '/.*' > /dev/null; then | ||
17 | + PRG="$link" | ||
18 | + else | ||
19 | + PRG=`dirname "$PRG"`"/$link" | ||
20 | + fi | ||
21 | +done | ||
22 | +SAVED="`pwd`" | ||
23 | +cd "`dirname \"$PRG\"`/" >/dev/null | ||
24 | +APP_HOME="`pwd -P`" | ||
25 | +cd "$SAVED" >/dev/null | ||
26 | + | ||
27 | +APP_NAME="Gradle" | ||
28 | +APP_BASE_NAME=`basename "$0"` | ||
29 | + | ||
30 | +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
31 | +DEFAULT_JVM_OPTS="" | ||
32 | + | ||
33 | +# Use the maximum available, or set MAX_FD != -1 to use that value. | ||
34 | +MAX_FD="maximum" | ||
35 | + | ||
36 | +warn () { | ||
37 | + echo "$*" | ||
38 | +} | ||
39 | + | ||
40 | +die () { | ||
41 | + echo | ||
42 | + echo "$*" | ||
43 | + echo | ||
44 | + exit 1 | ||
45 | +} | ||
46 | + | ||
47 | +# OS specific support (must be 'true' or 'false'). | ||
48 | +cygwin=false | ||
49 | +msys=false | ||
50 | +darwin=false | ||
51 | +nonstop=false | ||
52 | +case "`uname`" in | ||
53 | + CYGWIN* ) | ||
54 | + cygwin=true | ||
55 | + ;; | ||
56 | + Darwin* ) | ||
57 | + darwin=true | ||
58 | + ;; | ||
59 | + MINGW* ) | ||
60 | + msys=true | ||
61 | + ;; | ||
62 | + NONSTOP* ) | ||
63 | + nonstop=true | ||
64 | + ;; | ||
65 | +esac | ||
66 | + | ||
67 | +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar | ||
68 | + | ||
69 | +# Determine the Java command to use to start the JVM. | ||
70 | +if [ -n "$JAVA_HOME" ] ; then | ||
71 | + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then | ||
72 | + # IBM's JDK on AIX uses strange locations for the executables | ||
73 | + JAVACMD="$JAVA_HOME/jre/sh/java" | ||
74 | + else | ||
75 | + JAVACMD="$JAVA_HOME/bin/java" | ||
76 | + fi | ||
77 | + if [ ! -x "$JAVACMD" ] ; then | ||
78 | + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME | ||
79 | + | ||
80 | +Please set the JAVA_HOME variable in your environment to match the | ||
81 | +location of your Java installation." | ||
82 | + fi | ||
83 | +else | ||
84 | + JAVACMD="java" | ||
85 | + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
86 | + | ||
87 | +Please set the JAVA_HOME variable in your environment to match the | ||
88 | +location of your Java installation." | ||
89 | +fi | ||
90 | + | ||
91 | +# Increase the maximum file descriptors if we can. | ||
92 | +if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then | ||
93 | + MAX_FD_LIMIT=`ulimit -H -n` | ||
94 | + if [ $? -eq 0 ] ; then | ||
95 | + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then | ||
96 | + MAX_FD="$MAX_FD_LIMIT" | ||
97 | + fi | ||
98 | + ulimit -n $MAX_FD | ||
99 | + if [ $? -ne 0 ] ; then | ||
100 | + warn "Could not set maximum file descriptor limit: $MAX_FD" | ||
101 | + fi | ||
102 | + else | ||
103 | + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" | ||
104 | + fi | ||
105 | +fi | ||
106 | + | ||
107 | +# For Darwin, add options to specify how the application appears in the dock | ||
108 | +if $darwin; then | ||
109 | + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" | ||
110 | +fi | ||
111 | + | ||
112 | +# For Cygwin, switch paths to Windows format before running java | ||
113 | +if $cygwin ; then | ||
114 | + APP_HOME=`cygpath --path --mixed "$APP_HOME"` | ||
115 | + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` | ||
116 | + JAVACMD=`cygpath --unix "$JAVACMD"` | ||
117 | + | ||
118 | + # We build the pattern for arguments to be converted via cygpath | ||
119 | + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` | ||
120 | + SEP="" | ||
121 | + for dir in $ROOTDIRSRAW ; do | ||
122 | + ROOTDIRS="$ROOTDIRS$SEP$dir" | ||
123 | + SEP="|" | ||
124 | + done | ||
125 | + OURCYGPATTERN="(^($ROOTDIRS))" | ||
126 | + # Add a user-defined pattern to the cygpath arguments | ||
127 | + if [ "$GRADLE_CYGPATTERN" != "" ] ; then | ||
128 | + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" | ||
129 | + fi | ||
130 | + # Now convert the arguments - kludge to limit ourselves to /bin/sh | ||
131 | + i=0 | ||
132 | + for arg in "$@" ; do | ||
133 | + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` | ||
134 | + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option | ||
135 | + | ||
136 | + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition | ||
137 | + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` | ||
138 | + else | ||
139 | + eval `echo args$i`="\"$arg\"" | ||
140 | + fi | ||
141 | + i=$((i+1)) | ||
142 | + done | ||
143 | + case $i in | ||
144 | + (0) set -- ;; | ||
145 | + (1) set -- "$args0" ;; | ||
146 | + (2) set -- "$args0" "$args1" ;; | ||
147 | + (3) set -- "$args0" "$args1" "$args2" ;; | ||
148 | + (4) set -- "$args0" "$args1" "$args2" "$args3" ;; | ||
149 | + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; | ||
150 | + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; | ||
151 | + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; | ||
152 | + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; | ||
153 | + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; | ||
154 | + esac | ||
155 | +fi | ||
156 | + | ||
157 | +# Escape application args | ||
158 | +save () { | ||
159 | + for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done | ||
160 | + echo " " | ||
161 | +} | ||
162 | +APP_ARGS=$(save "$@") | ||
163 | + | ||
164 | +# Collect all arguments for the java command, following the shell quoting and substitution rules | ||
165 | +eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" | ||
166 | + | ||
167 | +# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong | ||
168 | +if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then | ||
169 | + cd "$(dirname "$0")" | ||
170 | +fi | ||
171 | + | ||
172 | +exec "$JAVACMD" "$@" |
1 | +++ a/gradlew.bat | ||
@@ -0,0 +1,84 @@ | @@ -0,0 +1,84 @@ | ||
1 | +@if "%DEBUG%" == "" @echo off | ||
2 | +@rem ########################################################################## | ||
3 | +@rem | ||
4 | +@rem Gradle startup script for Windows | ||
5 | +@rem | ||
6 | +@rem ########################################################################## | ||
7 | + | ||
8 | +@rem Set local scope for the variables with windows NT shell | ||
9 | +if "%OS%"=="Windows_NT" setlocal | ||
10 | + | ||
11 | +set DIRNAME=%~dp0 | ||
12 | +if "%DIRNAME%" == "" set DIRNAME=. | ||
13 | +set APP_BASE_NAME=%~n0 | ||
14 | +set APP_HOME=%DIRNAME% | ||
15 | + | ||
16 | +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. | ||
17 | +set DEFAULT_JVM_OPTS= | ||
18 | + | ||
19 | +@rem Find java.exe | ||
20 | +if defined JAVA_HOME goto findJavaFromJavaHome | ||
21 | + | ||
22 | +set JAVA_EXE=java.exe | ||
23 | +%JAVA_EXE% -version >NUL 2>&1 | ||
24 | +if "%ERRORLEVEL%" == "0" goto init | ||
25 | + | ||
26 | +echo. | ||
27 | +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. | ||
28 | +echo. | ||
29 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
30 | +echo location of your Java installation. | ||
31 | + | ||
32 | +goto fail | ||
33 | + | ||
34 | +:findJavaFromJavaHome | ||
35 | +set JAVA_HOME=%JAVA_HOME:"=% | ||
36 | +set JAVA_EXE=%JAVA_HOME%/bin/java.exe | ||
37 | + | ||
38 | +if exist "%JAVA_EXE%" goto init | ||
39 | + | ||
40 | +echo. | ||
41 | +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% | ||
42 | +echo. | ||
43 | +echo Please set the JAVA_HOME variable in your environment to match the | ||
44 | +echo location of your Java installation. | ||
45 | + | ||
46 | +goto fail | ||
47 | + | ||
48 | +:init | ||
49 | +@rem Get command-line arguments, handling Windows variants | ||
50 | + | ||
51 | +if not "%OS%" == "Windows_NT" goto win9xME_args | ||
52 | + | ||
53 | +:win9xME_args | ||
54 | +@rem Slurp the command line arguments. | ||
55 | +set CMD_LINE_ARGS= | ||
56 | +set _SKIP=2 | ||
57 | + | ||
58 | +:win9xME_args_slurp | ||
59 | +if "x%~1" == "x" goto execute | ||
60 | + | ||
61 | +set CMD_LINE_ARGS=%* | ||
62 | + | ||
63 | +:execute | ||
64 | +@rem Setup the command line | ||
65 | + | ||
66 | +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar | ||
67 | + | ||
68 | +@rem Execute Gradle | ||
69 | +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% | ||
70 | + | ||
71 | +:end | ||
72 | +@rem End local scope for the variables with windows NT shell | ||
73 | +if "%ERRORLEVEL%"=="0" goto mainEnd | ||
74 | + | ||
75 | +:fail | ||
76 | +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of | ||
77 | +rem the _cmd.exe /c_ return code! | ||
78 | +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 | ||
79 | +exit /b 1 | ||
80 | + | ||
81 | +:mainEnd | ||
82 | +if "%OS%"=="Windows_NT" endlocal | ||
83 | + | ||
84 | +:omega |