Skip to content

Instantly share code, notes, and snippets.

@kingargyle
Created November 30, 2017 19:22
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kingargyle/e23fcab92922f7c95347fe25a5b28094 to your computer and use it in GitHub Desktop.
Save kingargyle/e23fcab92922f7c95347fe25a5b28094 to your computer and use it in GitHub Desktop.
Toothpick Reflection Free Proguard Rules
# 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.** { *; }
@nima-ahmadi
Copy link

It is missing the types:

-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