diff --git a/proguard/noObfuscate.pro b/proguard/noObfuscate.pro new file mode 100644 index 0000000..e9caf63 --- /dev/null +++ b/proguard/noObfuscate.pro @@ -0,0 +1 @@ +-dontobfuscate diff --git a/proguard/obfuscate.pro b/proguard/obfuscate.pro new file mode 100644 index 0000000..1de1390 --- /dev/null +++ b/proguard/obfuscate.pro @@ -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 diff --git a/proguard/rules/components.pro b/proguard/rules/components.pro new file mode 100644 index 0000000..830b721 --- /dev/null +++ b/proguard/rules/components.pro @@ -0,0 +1,2 @@ +# View controllers are created through reflection. +-keep class ** extends ru.touchin.roboswag.components.navigation.viewcontrollers.ViewController { *; } diff --git a/proguard/rules/crashlytics.pro b/proguard/rules/crashlytics.pro new file mode 100644 index 0000000..c0d005d --- /dev/null +++ b/proguard/rules/crashlytics.pro @@ -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.** diff --git a/proguard/rules/glide.pro b/proguard/rules/glide.pro new file mode 100644 index 0000000..fc32188 --- /dev/null +++ b/proguard/rules/glide.pro @@ -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 diff --git a/proguard/rules/logansquare.pro b/proguard/rules/logansquare.pro new file mode 100644 index 0000000..d7c10b2 --- /dev/null +++ b/proguard/rules/logansquare.pro @@ -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 { *; } diff --git a/proguard/rules/okhttp.pro b/proguard/rules/okhttp.pro new file mode 100644 index 0000000..949c15b --- /dev/null +++ b/proguard/rules/okhttp.pro @@ -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 diff --git a/proguard/rules/retrofit.pro b/proguard/rules/retrofit.pro new file mode 100644 index 0000000..6517c4d --- /dev/null +++ b/proguard/rules/retrofit.pro @@ -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.* ; +} + +# 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