gpt4 book ai didi

java - 使用 Proguard GUI 进行混淆,在没有配置文件的情况下保持类

转载 作者:行者123 更新时间:2023-12-02 03:26:27 27 4
gpt4 key购买 nike

我正在混淆我的 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,而是一个确保服务器和客户端之间传输安全的程序。

最佳答案

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

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

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

-ignorewarnings

-dontwarn javax.crypto.**

关于java - 使用 Proguard GUI 进行混淆,在没有配置文件的情况下保持类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38810960/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com