相关链接
http://blog.csdn.net/zhyhang/article/details/18567409
http://blog.csdn.net/zhangjianying/article/details/7939593?c=127e3ef14a86fd3afef97eac34257db1
http://my.oschina.net/noahxiao/blog/304746?utm_source=tuicool&utm_medium=referral
maven配置:
4.0.0
com.yunshouhu
ApkProtect
1.0
jar
UTF-8
1.7
1.7
1.7
org.apache.maven.plugins
maven-compiler-plugin
${java.version}
${java.version}
org.apache.maven.plugins
maven-shade-plugin
package
shade
com.yunshouhu.apkprotect.MainHelper
com.pyx4me
proguard-maven-plugin
package
proguard
true
${basedir}/proguard.conf
${java.home}/lib/rt.jar
lib/fcexporter_jdk1.5.jar
lib/fcexporthandler.jar
lib/jsp-api.jar
lib/servlet-api.jar
false
net.sf.proguard
proguard
4.4
runtime
4.0.0
com.yunshouhu
ApkProtect
1.0
jar
UTF-8
1.8
1.8
1.8
org.apache.maven.plugins
maven-compiler-plugin
${java.version}
${java.version}
org.apache.maven.plugins
maven-shade-plugin
package
shade
com.yunshouhu.apkprotect.MainHelper
com.github.wvengen
proguard-maven-plugin
2.0.11
package
proguard
true
proguard
${project.build.finalName}-proguard
${java.home}/lib/rt.jar
4.0.0
com.yunshouhu
ApkProtect
1.0
jar
UTF-8
1.7
1.7
1.7
org.apache.maven.plugins
maven-compiler-plugin
${java.version}
${java.version}
org.apache.maven.plugins
maven-shade-plugin
package
shade
com.yunshouhu.apkprotect.MainHelper
com.github.wvengen
proguard-maven-plugin
2.0.11
package
proguard
true
${basedir}/proguard.cfg
true
proguard
proguard.cfg文件
# ----------------------------------
# 通过指定数量的优化能执行
# -optimizationpasses n
# ----------------------------------
-optimizationpasses 3
# ----------------------------------
# 混淆时不会产生形形色色的类名
# -dontusemixedcaseclassnames
# ----------------------------------
-dontusemixedcaseclassnames
# ----------------------------------
# 指定不去忽略非公共的库类
# -dontskipnonpubliclibraryclasses
# ----------------------------------
#-dontskipnonpubliclibraryclasses
# ----------------------------------
# 不预校验
# -dontpreverify
# ----------------------------------
# -dontpreverify
# ----------------------------------
# 输出生成信息
# -verbose
# ----------------------------------
-verbose
#混淆时应用侵入式重载
-overloadaggressively
#优化时允许访问并修改有修饰符的类和类的成员
-allowaccessmodification
#确定统一的混淆类的成员名称来增加混淆
-useuniqueclassmembernames
-ignorewarnings
-dontshrink
-dontoptimize
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-keep public class com.yunshouhu.apkprotect.MainHelper { public static void main(java.lang.String[]);}
-keep class **.package-info
-keepattributes Signature
-keepattributes SourceFile,LineNumberTable,*Annotation*
-keep public class com.yunshouhu.apkprotect.MainHelper {
public static void main(java.lang.String[]);
}
#这里添加你不需要混淆的类
-keep class com.zsoftware.common.cache.** {*;}
-keep public class * extends javax.servlet.Servlet
-keepattributes **
#-keepnames class * implements java.io.Serializable
# ---------保护所有实体中的字段名称----------
-keepclassmembers class * implements java.io.Serializable {
;
}
# --------- 保护类中的所有方法名 ------------
-keepclassmembers class * {
public ;
}