项目是模块化的,我需要混淆其中一个模块,叫它 A 模块吧。
-injars old_jar_path
-outjars new_jar_path
#keep 表示符合条件的代码不会被混淆
-keep public class * {
public protected <fields>;
public protected <methods>;
}
#
-keepdirectories
#不去忽略非公共的库类
-dontskipnonpubliclibraryclasses
#不去忽略包可见的库类的成员
-dontskipnonpubliclibraryclassmembers
#保证异常不被去除
-keepattributes Exceptions
然后我去运行命令的时候报了很多的 Warning :
- can't find referenced class XXXX
- 很显然,是和 A 模块平行的模块没有被找到..
官网上似乎给了几种解决方案:
- you should specify it with -injars, otherwise you should specify it with -libraryjars
- 这似乎是用来指定 jar 的
- you can try your luck with the -ignorewarnings option, or even the -dontwarn option.
- 直接 error 了, fuck the luck..
已经在 google 和 stackoverflow 逛了许久了...求 dalao 相助..TAT