我目前正在尝试用ProGuard混淆我的Eclipse RCP应用程序。问题是它混淆了包名(类My.Package.Class变成了类似a.bc的东西),但将包名保留在MANIFEST.MF的Export-Package部分。
这导致我的应用程序(实际上是一组OSGi-bundle)无法运行,因为无法解析MANIFEST.MFs的Export-Package部分中指定的包名。
有没有人成功地用ProGuard混淆了一个基于OSGi的RCP应用?基本上,我看到了两个选择:要么完全关闭包名混淆,要么混淆MANIFEST.MF的Export-Package部分,但我找不到实现任何一个的方法。Proguard似乎只混淆了MANIFEST.MF中的Bundle-Activator类名,跳过了所有其他部分。提前感谢!
发布于 2009-03-19 14:11:09
关闭包名称混淆;我的意思是,通过告诉世界包名称,您暴露了哪些重要的商业价值?
如果这确实是一个问题,那么将所有代码移到一个完全模糊的库中,并在一个非模糊的插件中使用该库。
也就是说,考虑一下根本不要把时间浪费在混淆上。这将耗费你的时间和金钱,而且是否有任何好处也是值得怀疑的。当你的竞争对手已经开始拆解你有价值的工作时,你将编写下一个版本。那么,为什么还要费心呢?
发布于 2013-02-28 01:19:11
ProGuard内置不支持OSGi包模糊处理。有关更多信息,请查看Proguard feature request #135。
发布于 2020-11-04 23:16:44
对OSGI声明性服务使用以下keep选项
#Keep all annotations.
-keepattributes *Annotation*,Exceptions
#Keep all interfaces. This is required to run OSGi services.
-keep public interface *
#Keep all Component classes
-keep @org.osgi.service.component.annotations.Component class *
#Kepp all Component classes member functions with OSGi specific annotations
-keepclassmembers @org.osgi.service.component.annotations.Component class * {
#Keep all methods with annotatios Reference.
@org.osgi.service.component.annotations.Reference *;
#Keep all methods with annotatios Activate.
@org.osgi.service.component.annotations.Activate *;
}https://stackoverflow.com/questions/662335
复制相似问题