开发者

how to obfucate dependant .jar in Proguard?

开发者 https://www.devze.com 2023-02-10 14:12 出处:网络
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 refer开发者_如何转开发e

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 refer开发者_如何转开发ences between them?

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

Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号