使用 Proguard GUI 进行混淆,保持 class 没有配置文件

Obfuscation with Proguard GUI keeping class without config file

我正在混淆我的 Java 代码,我正在使用 Proguard 5.2.1。但是,在使用 GUI 时,出现警告:

ProGuard, version 5.2.1
Reading program jar [/root/Desktop/ACGPlain.jar]
Reading library jar [/usr/lib/jvm/java-7-openjdk-amd64/jre/lib/rt.jar]
Warning: connection.HttpURLClient: can't find referenced class javax.crypto.SecretKey
Warning: connection.HttpURLClient: can't find referenced class javax.crypto.SecretKey
Warning: connection.HttpURLClient: can't find referenced class javax.crypto.SecretKey
Warning: connection.HttpURLClient: can't find referenced class javax.crypto.SecretKey
Warning: connection.HttpURLClient: can't find referenced class javax.crypto.SecretKey
Warning: there were 5 unresolved references to classes or interfaces.
         You may need to add missing library jars or update their versions.
         If your code works fine without the missing classes, you can suppress
         the warnings with '-dontwarn' options.
         (http://proguard.sourceforge.net/manual/troubleshooting.html#unresolvedclass)
Please correct the above warnings first.

我已经尝试在命令行中使用 -dontwarn 选项 运行 它,但混淆并没有奏效。我也尝试过以下方法:

java -jar proguard.jar -injar /root/Desktop/ACGPlain.jar -outjar /root/Desktop/ACGOB.jar -keepclass javax.crypto.SecretKey

有没有办法阻止混淆器隐藏 javax.crypto.SecretKey class?我正在寻找一个 GUI 解决方案,而不是通过配置文件。我的 java 代码不适用于 android,它是一个用于保护服务器和客户端之间传输的程序。

加密相关 类 位于不同的 jar 文件中。您需要在配置文件中添加另一个 -libraryjar 配置:

-libraryjar /usr/lib/jvm/java-7-openjdk-amd64/jre/lib/jce.jar

另一种选择是忽略该错误,因为它对您的情况无害:

-ignorewarnings

-dontwarn javax.crypto.**