Can incremental obfuscation be stacked?

I see that -applymapping can only accept one mapping file, and I’m inferring that I also can’t give multiple -applymapping options the way you can multiple -injars and -libraryjars options.

Say I have a gui.jar that depends on an app.jar, which in turn depends on a domain.jar. Can I stack incremental obfuscation?

That is, can I obfuscate and print a map for the domain JAR, apply that mapping and obfuscate and print a map for the app JAR, and then one more time apply that mapping and obfuscate the GUI JAR?

I’d guess the three invocations of Proguard would look something like:

Domain Module

-injars domain.jar
-outjars domain_obfuscated.jar
-printmapping domain.map

App Module

-injars app.jar
-outjars app_obfuscated.jar
-injars domain.jar
-outjars domain_obfuscated.jar
-applymapping domain.map
-printmapping app.map

GUI Module

-injars gui.jar
-outjars gui_obfuscated.jar
-injars app.jar
-outjars app_obfuscated.jar
-injars domain.jar
-outjars domain_obfuscated.jar
-applymapping app.map
-printmapping gui.map
1 Like