ProguardGui进行jar包代码混淆

配置生成.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>;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值