Proguard rules

This commit is contained in:
Denis Karmyshakov 2018-12-22 14:18:03 +03:00
parent 6190a8c8ce
commit 1d60b914dd
8 changed files with 69 additions and 0 deletions

1
proguard/noObfuscate.pro Normal file
View File

@ -0,0 +1 @@
-dontobfuscate

7
proguard/obfuscate.pro Normal file
View File

@ -0,0 +1,7 @@
-include rules/components.pro
-include rules/okhttp.pro
-include rules/retrofit.pro
-include rules/logansquare.pro
-include rules/crashlytics.pro
-include rules/glide.pro

View File

@ -0,0 +1,2 @@
# View controllers are created through reflection.
-keep class ** extends ru.touchin.roboswag.components.navigation.viewcontrollers.ViewController { *; }

View File

@ -0,0 +1,8 @@
# https://docs.fabric.io/android/crashlytics/dex-and-proguard.html
-keepattributes *Annotation*
-keepattributes SourceFile,LineNumberTable
-keep public class * extends java.lang.Exception
-keep class com.crashlytics.** { *; }
-dontwarn com.crashlytics.**

11
proguard/rules/glide.pro Normal file
View File

@ -0,0 +1,11 @@
# https://github.com/bumptech/glide/blob/master/library/proguard-rules.txt
-keep public class * implements com.bumptech.glide.module.GlideModule
-keep public class * extends com.bumptech.glide.module.AppGlideModule
-keep public enum com.bumptech.glide.load.ImageHeaderParser$** {
**[] $VALUES;
public *;
}
# Uncomment for DexGuard only
#-keepresourcexmlelements manifest/application/meta-data@value=GlideModule

View File

@ -0,0 +1,5 @@
-keep class com.bluelinelabs.logansquare.** { *; }
-keep @com.bluelinelabs.logansquare.annotation.JsonObject class *
-keep @com.bluelinelabs.logansquare.annotation.JsonEnum class *
-keep class **$$JsonObjectMapper { *; }
-keep class **$$JsonTypeConverter { *; }

13
proguard/rules/okhttp.pro Normal file
View File

@ -0,0 +1,13 @@
# https://github.com/square/okhttp/blob/master/okhttp/src/main/resources/META-INF/proguard/okhttp3.pro
# JSR 305 annotations are for embedding nullability information.
-dontwarn javax.annotation.**
# A resource is loaded with a relative path so the package of this class must be preserved.
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase
# Animal Sniffer compileOnly dependency to ensure APIs are compatible with older versions of Java.
-dontwarn org.codehaus.mojo.animal_sniffer.*
# OkHttp platform used only on JVM and when Conscrypt dependency is available.
-dontwarn okhttp3.internal.platform.ConscryptPlatform

View File

@ -0,0 +1,22 @@
# https://github.com/square/retrofit/blob/master/retrofit/src/main/resources/META-INF/proguard/retrofit2.pro
# Retrofit does reflection on generic parameters. InnerClasses is required to use Signature and
# EnclosingMethod is required to use InnerClasses.
-keepattributes Signature, InnerClasses, EnclosingMethod
# 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.**
# Guarded by a NoClassDefFoundError try/catch and only used when on the classpath.
-dontwarn kotlin.Unit
# Top-level functions that can only be used by Kotlin.
-dontwarn retrofit2.-KotlinExtensions