Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to obfucate dependant .jar in Proguard?

I have a Jar library called BizLogic.jar and I am referring to it on my UI project. So when I obfuscate, I want to obfuscate BizLogic.jar first and then UI without breaking any references between them?

Is this possible with Proguard ? If not, Any other product that can support this ?

Thanks

like image 218
kakopappa Avatar asked Feb 14 '11 11:02

kakopappa


1 Answers

The most robust solution would be to process both jars at the same time, but to keep the output in separate jars:

-injars  UI.jar
-outjars UI_processed.jar
-injars  BizLogic.jar
-outjars BizLogic_out.jar

or with an output directory

-injars  UI.jar
-injars  BizLogic.jar
-outjars out

The UI code and the business code will then be consistent.

Alternatively, you can apply incremental obfuscation:

1) First process BizLogic.jar with these additional options:

-printmapping BizJar.map
-dontoptimize
-useuniqueclassmembernames

2) Then process UI.jar with this additional option:

-applymapping BizJar.map

Incremental obfuscation is more complex and sometimes tricky to get right.

All this and more is explained in the ProGuard manual.

like image 193
Eric Lafortune Avatar answered Oct 12 '22 06:10

Eric Lafortune