Proguard 混淆 Fat jar

发布于 2024-08-09 02:30:37 字数 468 浏览 2 评论 0原文

我的应用程序 jar 包含 swing-layout.jar 中的类,其中包含 java 1.5 的免费布局管理器。在混淆过程中,我收到很多警告,例如

[proguard] Note: org.jdesktop.layout.SwingLayoutStyle accesses a field 'INDE
NT' dynamically                                                             
 [proguard]       Maybe this is program field 'org.jdesktop.layout.LayoutStyl
e { int INDENT; }'   

我希望 proguard 单独保留 org.jdesktop 类,并摆脱我尝试过

      -keeppackagenames org.jdesktop.*

但不起作用的警告?

My application jar contains classes from swing-layout.jar which contains free layout manager for java 1.5. During obfuscation process i get a lot of warnings such as

[proguard] Note: org.jdesktop.layout.SwingLayoutStyle accesses a field 'INDE
NT' dynamically                                                             
 [proguard]       Maybe this is program field 'org.jdesktop.layout.LayoutStyl
e { int INDENT; }'   

I would like proguard to leave org.jdesktop classes alone, and get rid of the warnings i tried

      -keeppackagenames org.jdesktop.*

but it did not work?

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

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

发布评论

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

评论(3

且行且努力 2024-08-16 02:30:37

老问题,但是

-keep org.jdesktop.**

不适用于 proguard 4.6 - 需要添加:

-keep class org.jdesktop.**

以防万一有人和我一样被这个问题绊倒了。

old question, but

-keep org.jdesktop.**

did not work here with proguard 4.6 - need to add:

-keep class org.jdesktop.**

just in case someone stumbles over this question just as I did.

酒解孤独 2024-08-16 02:30:37

我想,你想要

-keep org.jdesktop.**

注意那两颗星。从 文档 中:

*   matches any part of a name not containing the package separator or directory separator.
**  matches any part of a name, possibly containing any number of package separators or directory separators.

-keeppackagenames 只是保留...包名称!您需要 -keep,它可以保护包中的事物的名称。

You want, I think,

-keep org.jdesktop.**

Note the two stars. From the documentation:

*   matches any part of a name not containing the package separator or directory separator.
**  matches any part of a name, possibly containing any number of package separators or directory separators.

-keeppackagenames just keeps... package names! You want -keep, which protects the names of things in packages.

ゃ懵逼小萝莉 2024-08-16 02:30:37

如果您想忽略特定包下的所有内容,您可以这样做,

-keep class some.package.** { *; }

这将保留该包中的所有类以及所有字段和方法。

If you'd like to leave out everything under a specific package, you can do

-keep class some.package.** { *; }

This will keep all classes in that package, and all fields and methods.

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