Last active
October 28, 2020 15:19
-
-
Save becejacM/79a74946a4cfe112d46abe605aa23879 to your computer and use it in GitHub Desktop.
proGuard rules for 3rd party libraries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Butterknife | |
-keep class butterknife.** { *; } | |
-keepnames class * { @butterknife.Bind *;} | |
-dontwarn butterknife.internal.** | |
-keep class **$$ViewBinder { *; } | |
-keepclasseswithmembernames class * { | |
@butterknife.* <fields>; | |
} | |
-keepclasseswithmembernames class * { | |
@butterknife.* <methods>; | |
} | |
# rxjava | |
-keep class rx.schedulers.Schedulers { | |
public static <methods>; | |
} | |
-keep class rx.schedulers.ImmediateScheduler { | |
public <methods>; | |
} | |
-keep class rx.schedulers.TestScheduler { | |
public <methods>; | |
} | |
-keep class rx.schedulers.Schedulers { | |
public static ** test(); | |
} | |
-keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* { | |
long producerIndex; | |
long consumerIndex; | |
} | |
-keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef { | |
long producerNode; | |
long consumerNode; | |
} | |
# kotlinx | |
# kotlinx-serialization-json specific. Add this if you have java.lang.NoClassDefFoundError kotlinx.serialization.json.JsonObjectSerializer | |
-keepclassmembers class kotlinx.serialization.json.** { | |
*** Companion; | |
} | |
-keepclasseswithmembers class kotlinx.serialization.json.** { | |
kotlinx.serialization.KSerializer serializer(...); | |
} | |
# Change here com.yourcompany.yourpackage | |
-keep,includedescriptorclasses class com.yourcompany.yourpackage.**$$serializer { *; } # <-- change package name to your app's | |
-keepclassmembers class com.yourcompany.yourpackage.** { # <-- change package name to your app's | |
*** Companion; | |
} | |
-keepclasseswithmembers class com.yourcompany.yourpackage.** { # <-- change package name to your app's | |
kotlinx.serialization.KSerializer serializer(...); | |
} | |
# Picasso | |
-dontwarn com.squareup.okhttp.** | |
# GSON | |
# Gson uses generic type information stored in a class file when working with fields. Proguard | |
# removes such information by default, so configure it to keep all of it. | |
-keepattributes Signature | |
# For using GSON @Expose annotation | |
-keepattributes Annotation | |
# Gson specific classes | |
-keep class sun.misc.Unsafe { *; } | |
-keep class com.google.gson.** { *; } | |
# Application classes that will be serialized/deserialized over Gson | |
-keepclassmembers enum * { *; } | |
# Retrofit | |
# Retrofit does reflection on generic parameters and InnerClass is required to use Signature. | |
-keepattributes Signature, InnerClasses | |
# Retain service method parameters when optimizing. | |
-keepclassmembers,allowshrinking,allowobfuscation interface * { | |
@retrofit2.http.* <methods>; | |
} | |
# Ignore annotation used for build tooling. | |
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement | |
# Ignore JSR 305 annotations for embedding nullability information. | |
-dontwarn javax.annotation.** |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment