使用 proguard 混淆 jar 文件

发布于 2024-12-23 17:41:21 字数 528 浏览 1 评论 0原文

我使用 proguard 来混淆我的 jar 文件。 在处理过程中,我收到以下错误:

Initializing...
Warning: tdvep.jmNb: can't find referenced class QSYGWO
Warning: tdvep.qmfsfjttKdvEpNz: can't find referenced class FVTYBN
Warning: tdvep.qsfboBcSw$qsffmtssf: can't find referenced class UGKTLU
Warning: tdvep.qsffmtssf: can't find referenced class DREQUQ
Warning: there were 4 unresolved references to classes or interfaces.
         You may need to specify additional library jars (using '-libraryjars').

请先更正上述警告。 所以指导我解决这个警告。

I used proguard to obfuscate my jar file.
During processing I got the following errors:

Initializing...
Warning: tdvep.jmNb: can't find referenced class QSYGWO
Warning: tdvep.qmfsfjttKdvEpNz: can't find referenced class FVTYBN
Warning: tdvep.qsfboBcSw$qsffmtssf: can't find referenced class UGKTLU
Warning: tdvep.qsffmtssf: can't find referenced class DREQUQ
Warning: there were 4 unresolved references to classes or interfaces.
         You may need to specify additional library jars (using '-libraryjars').

Please correct the above warnings first.
So guide me to resolve this warnings.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白芷 2024-12-30 17:41:21

您是否检查过 ProGuard 疑难解答部分 - 处理时出现问题

如果存在对类或接口的未解析引用,您很可能忘记指定一个重要的库。为了正确处理,必须指定代码引用的所有库,包括 Java 运行时库。要指定库,请使用 -libraryjars 选项。

例如,如果 ProGuard 抱怨找不到 javax.crypto 类,您可能仍然需要在更常见的旁边指定 jce.jar rt.jar.

如果您缺少某个库并且您绝对确定它没有被使用,您可以使用 -ignorewarnings 选项碰碰运气,甚至可以使用 <代码>-不要警告选项。仅当您确实知道自己在做什么时才使用这些选项。

例如,如果您正在为 Android 进行开发,并且 ProGuard 抱怨它找不到 java.awt 类,那么您正在使用的某个库正在引用java.awt。这有点可疑,因为 Android 根本没有这个包,但如果您的应用程序仍然可以工作,您可以让 ProGuard 使用 "-dontwarn java.awt.** 接受它“

Have you checked the ProGuard troubleshooting section - Problems while processing.

If there are unresolved references to classes or interfaces, you most likely forgot to specify an essential library. For proper processing, all libraries that are referenced by your code must be specified, including the Java run-time library. For specifying libraries, use the -libraryjars option.

For example, if ProGuard complains that it can't find a javax.crypto class, you probably still have to specify jce.jar, next to the more common rt.jar.

If you're missing a library and you're absolutely sure it isn't used anyway, you can try your luck with the -ignorewarnings option, or even the -dontwarn option. Only use these options if you really know what you're doing though.

For example, if you're developing for Android, and ProGuard complains that it can't find a java.awt class, then some library that you are using is referring to java.awt. This is a bit shady, since Android doesn't have this package at all, but if your application works anyway, you can let ProGuard accept it with "-dontwarn java.awt.**".

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文