我正在尝试使用Proguard优化jar
我的配置:
-injars MyLib-1.0.jar
-outjars MyLib-1.0.proguard.jar
-libraryjars retrace.jar
-libraryjars guava-18.0.jar
-printmapping MyLib.map
-keep public class MyLib {
public String myPublicCallEntryPoint(java.lang.String);
}
-keep public class * {
public protected *;
}
-keepclassmembernames class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}
然后我用:java -jar proguard.jar @myconfig.pro -verbose
日志输出:
Initializing...
Note: the configuration refers to the unknown class 'String'
Note: the configuration refers to the unknown class 'java.lang.String'
Note: the configuration refers to the unknown class 'java.lang.Class'
Note: the configuration refers to the unknown class 'java.lang.String'
Note: the configuration refers to the unknown class 'java.lang.Class'
Note: the configuration refers to the unknown class 'java.lang.String'
有没有办法防止这样的事情?我如何告诉proguard识别基类java类?
答案 0 :(得分:0)
问题在于我从JRE中错误地将rt.jar
误认为是来自proguard包的回溯。