Obfuscating Spring Boot fat Jar using Proguard

235 views Asked by At

I would like to obfuscate Spring Boot application that is packaged into a fat jar.

My proguard config:

-injars       lib.jar
-outjars      lib_out.jar
-libraryjars  <java.home>/jmods/java.base.jmod(!**.jar;!module-info.class):<java.home>/lib/rt.jar
-printmapping myapplication.map

-dontoptimize
-dontshrink

-adaptresourcefilenames    **.properties,**.xml,META-INF/MANIFEST.MF,META-INF/spring.*
-adaptresourcefilecontents **.properties,**.xml,META-INF/MANIFEST.MF,META-INF/spring.*

-keep class !com.myclass.mypackage.that.i.want.to.ofuscate.** { *; }

-keepattributes *Annotation*,Signature,InnerClasses,EnclosingMethod

However prociessing my jar generates following warnings:

Warning: class [BOOT-INF/classes/com/myclass/mypackage/that/i/want/to/ofuscate/My.class] unexpectedly contains class [com.myclass.mypackage.that.i.want.to.obfuscate.My]

I read an answer by Proguard author here but it did not provide any concrete example and docs are not helpful as well...

0

There are 0 answers