Skip to content

Commit 809e640

Browse files
committed
fix(app): fix JSON serializing and retrofit body issues which are caused by ProGuard
Signed-off-by: Trumeet <[email protected]>
1 parent 43beb98 commit 809e640

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

app/build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ android {
6666
dataBinding {
6767
enabled = true
6868
}
69+
lintOptions {
70+
checkReleaseBuilds false
71+
abortOnError false
72+
}
6973
}
7074

7175
dependencies {
@@ -87,7 +91,7 @@ dependencies {
8791
implementation "android.arch.navigation:navigation-fragment:$nav_version"
8892
implementation "android.arch.navigation:navigation-ui:$nav_version"
8993
// Retrofit & RxJava
90-
def retrofitVersion = "2.4.0"
94+
def retrofitVersion = "2.5.0"
9195
implementation"com.squareup.retrofit2:retrofit:$retrofitVersion"
9296
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
9397
implementation 'com.google.android.gms:play-services-oss-licenses:16.0.1'

app/proguard-rules.pro

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# MiPush
12
-keep class moe.yuuta.mipushtester.push.PushReceiver {*;}
23
-dontwarn com.xiaomi.push.**
34
-dontwarn com.xiaomi.mipush.**
@@ -6,4 +7,31 @@
67
-dontwarn javax.annotation.**
78
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
89
-dontwarn org.codehaus.mojo.animal_sniffer.*
9-
-dontwarn okhttp3.internal.platform.ConscryptPlatform
10+
-dontwarn okhttp3.internal.platform.ConscryptPlatform
11+
12+
# GSON
13+
-keepattributes Signature
14+
-keepattributes *Annotation*
15+
-keepattributes EnclosingMethod
16+
-keep class sun.misc.Unsafe { *; }
17+
-keep class com.google.gson.stream.** { *; }
18+
19+
# API
20+
-keep class moe.yuuta.mipushtester.push.PushRequest {
21+
*;
22+
<fields>;
23+
}
24+
-keep class moe.yuuta.mipushtester.update.Update {
25+
*;
26+
<fields>;
27+
}
28+
29+
# Retrofit
30+
-keepattributes Signature, InnerClasses, EnclosingMethod
31+
-keepclassmembers,allowshrinking,allowobfuscation interface * {
32+
@retrofit2.http.* <methods>;
33+
}
34+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
35+
-dontwarn javax.annotation.**
36+
-dontwarn kotlin.Unit
37+
-dontwarn retrofit2.-KotlinExtensions

0 commit comments

Comments
 (0)