简体   繁体   English

如何在ProGuard中混淆库jar?

[英]How to obfuscate a library jar in ProGuard?

I have a jar that uses another jar as a library. 我有一个jar使用另一个jar作为库。 I want them both to be obfuscated. 我希望他们两个都被混淆。
Quoting ProGuard documentation : 引用ProGuard 文档

ProGuard requires the library jars (or wars, ears, zips, or directories) of the input jars to be specified. ProGuard要求指定输入罐的库罐(或战争,耳朵,拉链或目录)。 These are essentially the libraries that you would need for compiling the code. 这些本质上是编译代码所需的库。 ProGuard uses them to reconstruct the class dependencies that are necessary for proper processing. ProGuard使用它们来重建正确处理所必需的类依赖项。 The library jars themselves always remain unchanged . 图书馆罐子本身始终保持不变 You should still put them in the class path of your final application. 您仍应将它们放在最终应用程序的类路径中。

How can I change this behavior? 我该如何改变这种行为?

UPDATE: 更新:
I cannot use incremental obfuscation because I wouldn't know what to specify as entry points for the library jar. 我不能使用增量混淆,因为我不知道指定什么作为库jar的入口点。

You just need to specify your two jars as input jars (with the option -injars ). 您只需将两个罐子指定为输入罐子(使用选项-injars )。 They will then both be obfuscated. 然后他们都会被混淆。 Any other jars, such as the run-time jar, are library jars (specified with the option -libraryjars ). 任何其他jar,例如运行时jar,都是库jar(使用选项-libraryjars指定)。 ProGuard needs them to properly process your code, but it leaves them unchanged. ProGuard需要他们正确处理您的代码,但它会保持不变。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM