# HG changeset patch # User Da Risk # Date 1682693659 14400 # Node ID 08837cef1aeef44fab03b58ec574fea793037b65 # Parent 35d86e87cd75410535fee8216b3b767b646e7624 app: add proguard rules for retrofit with r8 in full mode diff -r 35d86e87cd75 -r 08837cef1aee app/proguard-rules.pro --- a/app/proguard-rules.pro Thu Apr 27 23:08:54 2023 -0400 +++ b/app/proguard-rules.pro Fri Apr 28 10:54:19 2023 -0400 @@ -37,6 +37,23 @@ -keepclassmembers,allowshrinking,allowobfuscation interface * { @retrofit2.http.* ; } +# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy +# and replaces all potential values with null. Explicitly keeping the interfaces prevents this. +-if interface * { @retrofit2.http.* ; } +-keep,allowobfuscation interface <1> + +# Keep inherited services. +-if interface * { @retrofit2.http.* ; } +-keep,allowobfuscation interface * extends <1> + +# Keep generic signature of Call, Response (R8 full mode strips signatures from non-kept items). +-keep,allowobfuscation,allowshrinking interface retrofit2.Call +-keep,allowobfuscation,allowshrinking class retrofit2.Response + +# With R8 full mode generic signatures are stripped for classes that are not +# kept. Suspend functions are wrapped in continuations where the type argument +# is used. +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation # Ignore annotation used for build tooling. -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement