我怎样才能排除混淆外部.jar通过Proguard的(Android项目)?项目、jar、Proguard、Android

2023-09-05 08:44:36 作者:优雅森系的8个字:灯火阑珊处的回眸

当我出口的Andr​​oid项目proguard.cfg,所有引用.jar文件模糊处理为好。我怎么能排除一些的.jar文件的混淆?

When I export android project with proguard.cfg, all referenced .jar files are obfuscated as well. How can I exclude some of that .jars from obfuscation?

推荐答案

如果您不希望编辑Ant脚本,您可以添加-keep选项proguard.cfg为类的外部罐。例如:

If you don't want to edit the Ant script, you can add -keep options to proguard.cfg for the classes in those external jars. For instance:

-keep class othercode.** { *; }

或者用含有否定符常规EX pression:

Or with a regular expression containing a negator:

-keep class !mycode.** { *; }

标准Ant脚本仍然会合并所有引用的罐子在单输出罐子虽然。

The standard Ant script will still merge all referenced jars in the single output jar though.