Rules for code obfuscation
1. If you use a tool such as Gson to make the JavaBean class the entity class not to be confused.
2. If you are using custom controls then make sure they are not involved in the confusion.
3. If an enumeration is used, the enumeration is guaranteed not to be confused.
-keepclassmembers enum * {--enum class cannot be confused
public static **[] values ();
public static * * VALUEOF (java.lang.String);
}
4. Do not confuse classes in third-party libraries
A. Confusing third-party jar packages that protect references
Like what:
-libraryjars Libs/gson-2.0.jar
-libraryjars Libs/universal-image-loader-1.9.0.jar
5. Local methods cannot be confused
-keepclasseswithmembernames class * {All native methods cannot be confused.
Native <methods>;
}
Other common confusion
-keep class android.support.v4.**{*;}
-keepclassmembers class * {
Public <init> (Org.json.JSONObject);
}
-keepclasseswithmembers class * {
Public <init> (Android.content.Context, Android.util.AttributeSet); --some construction methods cannot be confused
}
Rules for code obfuscation