Skip to content

Commit c1aaf87

Browse files
feat: add proguard to let app works on release mode (android#903)
1 parent 94e8ae1 commit c1aaf87

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

app/proguard-rules.pro

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,35 @@
3232
-keepclassmembernames class kotlinx.** {
3333
volatile <fields>;
3434
}
35+
-keepclassmembers class com.google.samples.apps.sunflower.** { <fields>; }
36+
37+
38+
# Keep annotation default values (e.g., retrofit2.http.Field.encoded).
39+
-keepattributes AnnotationDefault
40+
41+
# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items).
42+
-keep,allowobfuscation,allowshrinking interface retrofit2.Call
43+
-keep,allowobfuscation,allowshrinking class retrofit2.Response
44+
45+
# With R8 full mode generic signatures are stripped for classes that are not
46+
# kept. Suspend functions are wrapped in continuations where the type argument
47+
# is used.
48+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
49+
# -keep class hilt_aggregated_deps.** { *; }
50+
51+
52+
##---------------Begin: proguard configuration for Gson ----------
53+
# Gson uses generic type information stored in a class file when working with fields. Proguard
54+
# removes such information by default, so configure it to keep all of it.
55+
-keep class com.google.gson.** { *; }
56+
-keepattributes Signature
57+
# For using GSON @Expose annotation
58+
-keepattributes *Annotation*
59+
# Gson specific classes
60+
-keep class sun.misc.Unsafe { *; }
61+
#-keep class com.google.gson.stream.** { *; }
62+
# Application classes that will be serialized/deserialized over Gson
63+
-keep class com.google.gson.examples.android.model.** { *; }
64+
##---------------End: proguard configuration for Gson ----------
65+
66+

0 commit comments

Comments
 (0)