-libraryjars 'F:\eclipse\adt-bundle-windows-x86-20130917\sdk\platforms\android-19\android.jar'
-optimizationpasses 5
# 混淆时不会产生形形色色的类名
-dontusemixedcaseclassnames
# 指定不去忽略非公共的库类
-dontskipnonpubliclibraryclasses
# 不预校验
-dontpreverify
-verbose
# 优化
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
# 保留了继承自Activity、Application、Service、BroadcastReceiver、ContentProvider、BackupAgentHelper、Preference和ILicensingService 的子类。因为这些子类,都是可能被外部调用的。
-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.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keep public class * extends android.support.v4.app.FragmentActivity
-keep public class * extends android.support.v4.app.Fragmen
# 保留了含有native方法的类
-keepclasseswithmembernames class * {
native <methods>;
}
# actionbarSherlock 这里要注意了
-keep class android.support.v4.app.** { *; }
-keep interface android.support.v4.app.** { *; }
-keep class com.actionbarsherlock.** { *; }
-keep interface com.actionbarsherlock.** { *; }
-keepattributes *Annotation*
# 保留构造函数从xml构造的类(一般为View的子类)
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
# 保留构造函数从xml构造的类(一般为View的子类)
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
# 保护指定类的成员,如果此类受到保护他们会保护的更好
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
# 保留枚举类型中的values和valueOf静态方法
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
# 保留继承Parcelable的跨进程数据类
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
# 保留反射中用到的类和方法,到时根据具体情况再改
# 反编译测试的时候有效,运行时也与未混淆情况一样
-keepclassmembers class 包名.** {
public *;
protected *;
private *;
}