Skip to content

Commit 3fd7e1a

Browse files
dzinadgithub-actions[bot]
authored andcommitted
add retrofit rules to proguard
GitOrigin-RevId: 8470e87470254b6271489e2b742abfea0f8d54cf
1 parent 188d478 commit 3fd7e1a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

base/proguard-rules.pro

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# region Retrofit
2+
# Retrofit consumer rules are not sufficient for R8 full mode.
3+
# Since Retrofit is delivered with mapbox-java and mapbox-java is not an Android library,
4+
# therefore it can't include consumer proguard rules, we include them here, as this module uses mapbox-java as a transitive dependency
5+
# and this is the base module for all other modules in the NavSDK.
6+
# Rules are copied from https://github.com/square/retrofit/blob/trunk/retrofit/src/main/resources/META-INF/proguard/retrofit2.pro.
7+
-keepattributes Signature, InnerClasses, EnclosingMethod
8+
-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations
9+
-keepattributes AnnotationDefault
10+
-keepclassmembers,allowshrinking,allowobfuscation interface * {
11+
@retrofit2.http.* <methods>;
12+
}
13+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
14+
-dontwarn javax.annotation.**
15+
-dontwarn kotlin.Unit
16+
-dontwarn retrofit2.KotlinExtensions
17+
-dontwarn retrofit2.KotlinExtensions$*
18+
-if interface * { @retrofit2.http.* <methods>; }
19+
-keep,allowobfuscation interface <1>
20+
-if interface * { @retrofit2.http.* <methods>; }
21+
-keep,allowobfuscation interface * extends <1>
22+
-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation
23+
-if interface * { @retrofit2.http.* public *** *(...); }
24+
-keep,allowoptimization,allowshrinking,allowobfuscation class <3>
25+
-keep,allowobfuscation,allowshrinking class retrofit2.Response
26+
# endregion Retrofit

0 commit comments

Comments
 (0)