0

我混淆了我的 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

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

4

1 回答 1

2

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

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

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

-ignorewarnings

或者

-dontwarn javax.crypto.**
于 2016-08-08T10:24:41.997 回答