android混淆配置

编辑:proguard-project.txt文件

xtuils3 配置

 

-optimizationpasses 5   
#混淆时不会产生形形色色的类名
-dontusemixedcaseclassnames   
#指定不去忽略非公共的类库
-dontskipnonpubliclibraryclasses
#不预校验   
-dontpreverify   
-verbose
#优化   
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
    
 #引用的第三方jar包
-libraryjars libs/mpandroidchartlibrary-2-1-6.jar
-libraryjars libs/android-support-v4.jar

#xutils3 
-libraryjars libs/classes.jar 
-keepattributes Annotation
-keepclassmembers class * {
void *(android.view.View);
*** *Click(...);
*** *Event(...);
}
 
    
# 不进行混淆保持原样   
-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   
    
# 保护指定的类和类的成员的名称,如果所有指定的类成员出席   
-keepclasseswithmembernames class * {   
    native <methods>;   
}   
    
# 保护指定的类和类的成员,但条件是所有指定的类和类成员是要存在   
-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.app.Activity {   
   public void *(android.view.View);   
}   
    
-keepclassmembers enum * {   
    public static **[] values();   
    public static ** valueOf(java.lang.String);   
}   
    
# 保护指定的类文件和类成员   
-keep class * implements android.os.Parcelable {   
  public static final android.os.Parcelable$Creator *;   
}
 #减少错误的发生
-keepattributes Signature  
-keepattributes *Annotation*

 

 

 

 

你可能感兴趣的:(android,混淆,xutils,xUtils3)