Skip to content

Instantly share code, notes, and snippets.

@sergiocarneiro
Created July 14, 2018 01:02
Show Gist options
  • Save sergiocarneiro/4da6fba44bb7ee6e9bef71020d64356f to your computer and use it in GitHub Desktop.
Save sergiocarneiro/4da6fba44bb7ee6e9bef71020d64356f to your computer and use it in GitHub Desktop.
A generic proguard configuration file to make the configuration a lot less painful
-renamesourcefileattribute SourceFile
-dontusemixedcaseclassnames
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
# Keep - Library. Keep all public and protected classes, fields, and methods.
-keep public class * {
public protected <fields>;
public protected <methods>;
}
# Keep names - _class method names. Keep all .class method names. This may be
# useful for libraries that will be obfuscated again with different obfuscators.
-keepclassmembers, allowshrinking class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers, allowshrinking class * {
native <methods>;
}
# Also keep - Enumerations. Keep the special static methods that are required in
# enumeration classes.
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * extends java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment