配置生成.pro,见http://blog.csdn.net/p106786860/article/details/12168703,http://www.cnblogs.com/rayray/p/3421028.html两位的博客地址
可以解决proguardgui.bat无法导入.pro文件,具体步骤如下
1.经过博客中配置后,生成.pro文件
2.文本编辑.pro,编辑哪些类(需被外界调用的)公开
3.重启proguardgui.bat,导入.pro后选择Process按钮,点击Process!,静等文件混淆编译
附.pro文件简貌
-injars testpaydemo.jar
-outjars testpaydemo_new.jar
-libraryjars 'C:\Program Files\Java\jre7\lib\rt.jar'
-libraryjars android.jar
-target 1.6
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-optimizationpasses 5
-dontusemixedcaseclassnames
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,LocalVariable*Table,*Annotation*,Synthetic,EnclosingMethod
-renamesourcefileattribute SourceFile
-dontpreverify
-verbose
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
//自己的配置哟
-keep public class com.xxx.xxx.xxClass {
<fields>;
<methods>;
}
# Keep - Applications. Keep all application classes, along with their 'main'
# methods.
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}
# 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);
}
# Also keep - Database drivers. Keep all implementations of java.sql.Driver.
-keep class * extends java.sql.Driver
# Also keep - Swing UI L&F. Keep all extensions of javax.swing.plaf.ComponentUI,
# along with the special 'createUI' method.
-keep class * extends javax.swing.plaf.ComponentUI {
public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent);
}
# Keep names - Native method names. Keep all native class/method names.
-keepclasseswithmembers,allowshrinking class * {
native <methods>;
}