|
53 | 53 | # Retrofit 2 |
54 | 54 | # https://github.com/square/retrofit/blob/master/retrofit/src/main/resources/META-INF/proguard/retrofit2.pro |
55 | 55 | ################################## |
56 | | -# Platform calls Class.forName on types which do not exist on Android to determine platform. |
57 | | --dontnote retrofit2.Platform |
58 | | -# Platform used when running on Java 8 VMs. Will not be used at runtime. |
59 | | --dontwarn retrofit2.Platform$Java8 |
60 | | -# Retain generic type information for use by reflection by converters and adapters. |
61 | | --keepattributes Signature |
62 | | -# Retain declared checked exceptions for use by a Proxy instance. |
63 | | --keepattributes Exceptions |
| 56 | +# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and |
| 57 | +# EnclosingMethod is required to use InnerClasses. |
| 58 | +-keepattributes Signature, InnerClasses, EnclosingMethod |
| 59 | + |
| 60 | +# Retrofit does reflection on method and parameter annotations. |
| 61 | +-keepattributes RuntimeVisibleAnnotations, RuntimeVisibleParameterAnnotations |
| 62 | + |
| 63 | +# Keep annotation default values (e.g., retrofit2.http.Field.encoded). |
| 64 | +-keepattributes AnnotationDefault |
| 65 | + |
| 66 | +# Retain service method parameters when optimizing. |
| 67 | +-keepclassmembers,allowshrinking,allowobfuscation interface * { |
| 68 | + @retrofit2.http.* <methods>; |
| 69 | +} |
| 70 | + |
| 71 | +# Ignore annotation used for build tooling. |
| 72 | +-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement |
| 73 | + |
| 74 | +# Ignore JSR 305 annotations for embedding nullability information. |
| 75 | +-dontwarn javax.annotation.** |
| 76 | + |
| 77 | +# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath. |
| 78 | +-dontwarn kotlin.Unit |
| 79 | + |
| 80 | +# Top-level functions that can only be used by Kotlin. |
| 81 | +-dontwarn retrofit2.KotlinExtensions |
| 82 | +-dontwarn retrofit2.KotlinExtensions$* |
| 83 | + |
| 84 | +# With R8 full mode, it sees no subtypes of Retrofit interfaces since they are created with a Proxy |
| 85 | +# and replaces all potential values with null. Explicitly keeping the interfaces prevents this. |
| 86 | +-if interface * { @retrofit2.http.* <methods>; } |
| 87 | +-keep,allowobfuscation interface <1> |
| 88 | + |
| 89 | +# Keep inherited services. |
| 90 | +-if interface * { @retrofit2.http.* <methods>; } |
| 91 | +-keep,allowobfuscation interface * extends <1> |
| 92 | + |
| 93 | +# With R8 full mode generic signatures are stripped for classes that are not |
| 94 | +# kept. Suspend functions are wrapped in continuations where the type argument |
| 95 | +# is used. |
| 96 | +-keep,allowobfuscation,allowshrinking class kotlin.coroutines.Continuation |
| 97 | + |
| 98 | +# R8 full mode strips generic signatures from return types if not kept. |
| 99 | +-if interface * { @retrofit2.http.* public *** *(...); } |
| 100 | +-keep,allowoptimization,allowshrinking,allowobfuscation class <3> |
64 | 101 |
|
65 | 102 |
|
66 | 103 | ################################## |
|
92 | 129 |
|
93 | 130 | -keepclassmembers class com.codepath.models** { <fields>; } |
94 | 131 |
|
95 | | - |
96 | | -################################## |
97 | | -# RX libs # |
98 | | -################################## |
99 | | -# Rxjava-promises |
100 | | --keep class com.darylteo.rx.** { *; } |
101 | | --dontwarn com.darylteo.rx.** |
102 | | --keep class rx.schedulers.Schedulers { |
103 | | - public static <methods>; |
104 | | -} |
105 | | --keep class rx.schedulers.ImmediateScheduler { |
106 | | - public <methods>; |
107 | | -} |
108 | | --keep class rx.schedulers.TestScheduler { |
109 | | - public <methods>; |
110 | | -} |
111 | | --keep class rx.schedulers.Schedulers { |
112 | | - public static ** test(); |
113 | | -} |
114 | | - |
115 | | --dontwarn java.lang.invoke.* |
116 | | --keep class link.styler.styler_android.data.model.** { *; } |
117 | | --keep class * extends io.reactivex.observers.DisposableObserver { |
118 | | - *; |
119 | | -} |
120 | | - |
121 | | - |
122 | 132 | ################################## |
123 | 133 | # Glide 4 |
124 | 134 | ################################## |
|
183 | 193 | # Other GenerateAdapter |
184 | 194 | -keep class * implements androidx.lifecycle.GeneratedAdapter {<init>(...);} |
185 | 195 |
|
186 | | -################################## |
187 | | -# Koin # |
188 | | -################################## |
189 | | --keepnames class android.arch.lifecycle.ViewModel |
190 | | --keepclassmembers public class * extends android.arch.lifecycle.ViewModel { public <init>(...); } |
191 | | --keepclassmembers class com.lebao.app.domain.** { public <init>(...); } |
192 | | --keepclassmembers class * { public <init>(...); } |
193 | | - |
194 | 196 | ################################## |
195 | 197 | # Crashlytics # |
196 | 198 | ################################## |
|
0 commit comments