How to make Proguard to obfuscate jars within a ja

2019-09-14 20:33发布

I have a run-able java jar file let's call it masterProgram.jar. Inside this masterProgram.jar if I extract it using 7Zip or WinRAR there are other jars, lets call it lib1.jar, lib2.jar.

Proguard managed to obfuscated the master jar, but when I look-inside the lib jars are not. and because of this the program (masterProgram.jar) breaks at a certain point. I also already set overloadaggressively option in my condig.

I'm calling the proguard.jar through an ant build.xml. and here is my config file config.proguard

-injars 'masterProgram.jar'

-target 1.7
-dontshrink

-dontoptimize
-allowaccessmodification
-printmapping dataprintmap.txt
-overloadaggressively
-useuniqueclassmembernames
-repackageclasses ''
-keepattributes Exceptions,Innerclasses,Signature,Deprecated,*Annotation*,Synthetic
-renamesourcefileattribute SourceFile
-dontnote
-printseeds dataseed.txt
-dontskipnonpubliclibraryclasses

1条回答
手持菜刀,她持情操
2楼-- · 2019-09-14 21:08

Jars inside jars are not really how jars are supposed to work. You'll need to rearrange things to make ProGuard able to deal with things. ProGuard has no way to deal with jars in jars because that's not how jars are intended to be used.

查看更多
登录 后发表回答