Skip to content

Commit

Permalink
Add proguard rules for gson + R8
Browse files Browse the repository at this point in the history
  • Loading branch information
phil-lopreiato committed Jan 16, 2024
1 parent b166b0d commit 6c18842
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions android/proguard-rules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,13 @@ public static *** v(...);
# see https://code.google.com/p/android/issues/detail?id=78377
-keep,includedescriptorclasses class !android.support.v7.view.menu.*MenuBuilder*, android.support.v7.** { *; }

# Rules for Retrofit, see https://github.com/square/retrofit/issues/3751#issuecomment-1192043644
# R8 full mode strips generic signatures from return types if not kept.
# Rules for Retrofit, see https://github.com/square/retrofit/issues/3751#issuecomment-1192043644
-if interface * { @retrofit2.http.* public *** *(...); }
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
-keep,allowobfuscation,allowshrinking class retrofit2.Response
-keep,allowobfuscation,allowshrinking class retrofit2.Response

# Rules for gson + R8
# https://github.com/google/gson/blob/51cce39e0064a755d32f820670770f82519039de/examples/android-proguard-example/proguard.cfg#L28
-keep,allowobfuscation,allowshrinking class com.google.gson.reflect.TypeToken
-keep,allowobfuscation,allowshrinking class * extends com.google.gson.reflect.TypeToken

0 comments on commit 6c18842

Please sign in to comment.