proguard的简单配置说明

Posted yoyotl

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了proguard的简单配置说明相关的知识,希望对你有一定的参考价值。

#需要转换的jar文件路径
-injars ‘D:fs-np.jar‘
#转换后的jar文件名称
-outjars ‘D:fs-np-sec.jar‘

#关联的第三方jar
-libraryjars ‘C:Program FilesJavajre1.8.0_144lib t.jar‘
-libraryjars ‘D:fs-np_libspring-aop-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-beans-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-autoconfigure-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-starter-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-starter-logging-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-starter-test-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-starter-tomcat-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-starter-web-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-test-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-boot-test-autoconfigure-1.5.13.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-context-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-core-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-expression-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-test-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-web-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libspring-webmvc-4.3.17.RELEASE.jar‘
-libraryjars ‘D:fs-np_libsqlite-jdbc-3.21.0.jar‘
-libraryjars ‘D:fs-np_lib omcat-annotations-api-8.5.31.jar‘
-libraryjars ‘D:fs-np_lib omcat-embed-core-8.5.31.jar‘
-libraryjars ‘D:fs-np_lib omcat-embed-el-8.5.31.jar‘
-libraryjars ‘D:fs-np_lib omcat-embed-websocket-8.5.31.jar‘
-libraryjars ‘D:fs-np_libvalidation-api-1.1.0.Final.jar‘

#保持源文件名称和行号信息不变
-keepattributes SourceFile,LineNumberTable

#保持指定的类的public和private字段的不变
-keep public class com.sanro.sys.np.msg.CallInfo {
public private <fields>;
}

#保持指定包下面的所有类的字段和方法不变
-keep public class com.sanro.sys.np.msg.* {
  <fields>;

  <method>;
}

-keep public class com.sanro.sys.np.msg.CdrInfo {
public private <fields>;
}

-keep public class com.sanro.sys.np.msg.ChannelInfo {
public private <fields>;
}

#保持main函数的不变
# Keep - Applications. Keep all application classes, along with their ‘main‘ methods.
-keepclasseswithmembers public class * {
public static void main(java.lang.String[]);
}











































以上是关于proguard的简单配置说明的主要内容,如果未能解决你的问题,请参考以下文章

proguard生成的pro怎么载入

JAVA CLASS混淆工具:ProGuard简单试用

ProGuard 保留类名但更改包名

ProGuard 最全混淆规则说明

转载:ProGuard 混淆规则说明

Android 中的 ProGuard 不起作用。(不混淆)