如何使用 ProGuard 混淆 OSGi 包?
我目前正在尝试使用 ProGuard 来混淆我的 Eclipse RCP 应用程序。 问题是它混淆了包名称(类 My.Package.Class 变成类似 abc 的东西),但将包名称保留在 MANIFEST.MF 的 Export-Package 部分中。
这导致我的应用程序(实际上是一组 OSGi 捆绑包)无法运行,因为无法解析 MANIFEST.MF 的 Export-Package 部分中指定的包名称。
有人使用 ProGuard 混淆基于 OSGi 的 RCP 应用程序取得过成功吗? 基本上,我看到两个选择:要么完全关闭包名称混淆,要么混淆 MANIFEST.MF 的 Export-Package 部分,但我找不到实现其中任何一个的方法。 Proguard 似乎仅混淆 MANIFEST.MF 中的 Bundle-Activator 类名称,跳过所有其他部分。 提前致谢!
I am currently trying to obfuscate my Eclipse RCP application with ProGuard. The problem is that it obfuscates the package names (the class My.Package.Class turns into something like a.b.c), but keeps the package names in the Export-Package section of MANIFEST.MF.
This leads to the fact that my application (which is a set of OSGi-bundles, actually) cannot be run, as the package names specified in Export-Package section of MANIFEST.MFs cannot be resolved.
Has anybody had any success with ProGuard obfuscating an OSGi-based RCP application? Basically, I see two choices: either completely turn off package names obfuscation, or obfucate MANIFEST.MF's Export-Package section, but I can't find the way to implement any of them. Proguard seems to obfuscate only Bundle-Activator class name in MANIFEST.MF, skipping all other sections. Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
关闭包名混淆; 我的意思是,您通过告诉世界软件包名称来揭示什么重要的商业价值?
如果这确实是一个问题,请将所有代码移至完全混淆的库中,并在非混淆的插件中使用该库。
也就是说,请考虑不要在混淆上浪费时间。 这会花费你的时间和金钱,而且是否有任何好处值得怀疑。 当你的竞争对手开始拆解你有价值的作品时,你将编写下一个版本。 那为什么还要麻烦呢?
Turn off package name obfuscation; I mean what important business values are you exposing by telling the world the package names?
If that really is an issue, move all code into a fully obfuscated library and use the library in a non-obfuscated plugin.
That said, consider not wasting your time with obfuscation at all. It will cost you time and money and it's questionable whether there is any benefit. At the time when your competitors have started to disassemble your valuable work, you will be writing the next version. So why bother?
ProGuard 不支持内置 OSGi 捆绑混淆。
查看 Proguard 功能请求 #135 了解更多信息。
OSGi bundle obfuscation is not supported built-in by ProGuard.
Check the Proguard feature request #135 for more info.
对 OSGI 声明性服务使用以下保留选项
Use the following keep options for the OSGI declarative service