Skip to content

Instantly share code, notes, and snippets.

@dobrowins
Last active July 10, 2018 12:57
Show Gist options
  • Save dobrowins/dbec4a9cdd0b4b156371b5fc5b84f87e to your computer and use it in GitHub Desktop.
Save dobrowins/dbec4a9cdd0b4b156371b5fc5b84f87e to your computer and use it in GitHub Desktop.
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in /Users/nikitagusarov/Library/Android/sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
-optimizationpasses 5
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-keepattributes *Annotation*, Signature, Exception
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*
#MOXY
-keep class **$$PresentersBinder
-keep class **$$State
-keep class **$$ParamsHolder
-keep class **$$ViewStateClassNameProvider
-keepnames class * extends com.arellomobile.mvp.*
#DAGGER2
-dontwarn com.google.errorprone.annotations.*
#SUPPORT APPCOMPAT
-keep public class android.support.v7.widget.** { *; }
-keep public class android.support.v7.internal.widget.** { *; }
-keep public class android.support.v7.internal.view.menu.** { *; }
-keep public class * extends android.support.v4.view.ActionProvider {
public <init>(android.content.Context);
}
#SUPPORT DESIGN
-dontwarn android.support.design.**
-keep class android.support.design.** { *; }
-keep interface android.support.design.** { *; }
-keep public class android.support.design.R$* { *; }
-keep class android.support.v7.widget.** {*;}
#GSON
-keep class sun.misc.Unsafe { *; }
-keep class com.google.gson.stream.** { *; }
#LEAKCANARY
-dontwarn com.squareup.haha.guava.**
-dontwarn com.squareup.haha.perflib.**
-dontwarn com.squareup.haha.trove.**
-dontwarn com.squareup.leakcanary.**
-keep class com.squareup.haha.** { *; }
-keep class com.squareup.leakcanary.** { *; }
# Marshmallow removed Notification.setLatestEventInfo()
-dontwarn android.app.Notification
#GLIDE
-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 *;
}
#RETROFIT
# Retain generic type information for use by reflection by converters and adapters.
-keepattributes Signature
# Retain service method parameters.
-keepclassmembernames,allowobfuscation interface * {
@retrofit2.http.* <methods>;
}
# Ignore annotation used for build tooling.
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
-dontwarn com.squareup.okhttp3.**
-dontwarn javax.annotation.Nullable
-dontwarn javax.annotation.ParametersAreNonnullByDefault
-dontwarn org.conscrypt.OpenSSLProvider
-dontwarn org.conscrypt.Conscrypt
-dontwarn javax.annotation.concurrent.GuardedBy
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.view.View {
public <init>(android.content.Context);
public <init>(android.content.Context, android.util.AttributeSet);
public <init>(android.content.Context, android.util.AttributeSet, int);
public void set*(...);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.content.Context {
public void *(android.view.View);
public void *(android.view.MenuItem);
}
-keepclassmembers class * implements android.os.Parcelable {
static ** CREATOR;
}
-keepclassmembers class **.R$* {
public static <fields>;
}
-keepclassmembers class * {
@android.webkit.JavascriptInterface <methods>;
}
# TOOTHPICK REFLECTION FREE
# Note that if we could use kapt to generate registries, possible to get rid of this
-keepattributes Annotation
# Do not obfuscate classes with Injected Constructors
-keepclasseswithmembernames class * {
@javax.inject.Inject (...);
}
# Do not obfuscate classes with Injected Fields
-keepclasseswithmembernames class * {
@javax.inject.Inject ;
}
# Do not obfuscate classes with Injected Methods
-keepclasseswithmembernames class * {
@javax.inject.Inject ;
}
-keep @android.support.annotation.Keep class *
-keep @javax.inject.Singleton class *
-dontwarn javax.inject.**
-dontwarn javax.annotation.**
-keep class **$$Factory { *; }
-keep class **$$MemberInjector { *; }
-adaptclassstrings
-keep class toothpick.** { *; }
-keepclasseswithmembernames class * {
@javax.inject.Inject <init>(...);
}
# Do not obfuscate classes with Injected Fields
-keepclasseswithmembernames class * {
@javax.inject.Inject <fields>;
}
# Do not obfuscate classes with Injected Methods
-keepclasseswithmembernames class * {
@javax.inject.Inject <methods>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment