#135 OSGi bundle obfuscation

open
Obfuscation (8)
5
2012-12-17
2012-10-08
Jolkdarr
No

OSGi bundles use MANIFEST.MF to specify classpath entries (see http://wiki.osgi.org/wiki/Bundle-ClassPath\).
Proguard should be able to parse these specifications (directories or JARs embedded in a single JAR) in order to obfuscate OSGi bundles.
Maybe a new option (-osgi) is required to select JARs that fulfil OSGi directives.

Discussion

  • Eric Lafortune

    Eric Lafortune - 2012-10-08

    Thanks for the suggestion. I generally try to keep ProGuard independent of the many frameworks that come and (sometimes) go: applets, midlets, Android, JEE, Webstart, OSGi, Jigsaw,... The goal is to be able to handle them with external configuration. In the case of OSGi, a small external tool could extract the specifications and convert them into -injars/-libraryjars options (possibly with filters). ProGuard can handle nested archives, but unluckily for this case, it ignores .jar files inside .jar files. This could be improved, but it currently doesn't have a high priority. The current workaround is to process the unpacked .jar file.

    OSGi also relies a lot on reflection from configuration files, which would require further parsing.

     
  • Lukas Hajek

    Lukas Hajek - 2012-10-26

    If you want to use OSGI (eg. in Eclipse RCP) then it is impossible to change or flattern package names.
    OSGI configuration in META-INF/MANIFEST.MF contains Export-Package entry with exported package names. (eg. Export-Package: com.app.data, com.app.service)
    ProGuard is unfortunately not able to modify package names in these resource files.

    It would be nice to scan and replace package names in the specified resources (configuration files).
    Thanks

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks