How to obfuscate an OSGi package using ProGuard?

I am currently trying to confuse an Eclipse RCP application using ProGuard. The problem is that it confuses the package names (the My.Package.Class class turns into something like abc), but it saves the package names in the Export-Package section in the MANIFEST.MF file.

This leads to the fact that my application (which is a set of OSGi packages, in fact) cannot be launched, because the package names specified in the Export-Package section in the MANIFEST.MF file cannot be resolved.

Has anyone had success with ProGuard confusing OSGi-based RCP application? Basically, I see two options: either completely disable package obfuscation, or trim the MANIFEST.MF Export-Package section, but I can’t find a way to implement any of them. Proguard seems to confuse only the Bundle-Activator class name in MANIFEST.MF, skipping all other sections. Thanks in advance!

+4
source share
2 answers

Turn off package name obfuscation; I mean, what important business values ​​do you disclose by telling the world package names?

If this is really a problem, move all the code to a completely confusing library and use the library in a non-obfuscated plugin.

However, consider not wasting time on obfuscation. It will cost you time and money, and it is doubtful whether there is any benefit. At a time when your competitors began to disassemble your valuable work, you will write the next version. So why bother?

+6
source

Obfuscation of the OSGi package is not supported by the built-in ProGuard. For more information, see Proguard Feature Request No. 135 .

0
source

All Articles