Dear @Peter_Kronenberg ,
Let me answer the questions one by one.
The “Maybe this library method…” notes are connected to another line which was printed out previously. Please find an example below:
[proguard] Note: org.apache.commons.lang3.ObjectUtils accesses a method 'clone()' dynamically
[proguard] Maybe this is program method 'com.ibm.icu.impl.CharacterIteratorWrapper { java.lang.Object clone(); }'
Since a method is dynamically accessed, it might be needed to keep certain methods and ProGuard is suggesting what method this can be based on what it knows. If a method is accessed through reflection while it is name obfuscated, it will result in crashes at runtime.
I thought things would work mostly out of the box with the default options. This is very unlikely, keep rules will most likely be needed.
- I tried the
-addconfigurationdebugging
option, but that didn’t seem to do anything.* Can you specify the steps taken to test this so that we can further assist you?
The message is telling me that there are 3 accesses to class members by means of reflection. I t would have been nice to tell me what the 3 classes are (Proguard doesn’t seem to have a problem list hundreds of other classes which have various problems :-))
This is not always possible because ProGuard does not have all the information needed to specify this.
Is it required that I explicitly list the classes that I want to obfuscate? As I mentioned, I’m using the maven plugin, so to run it, I just do my maven build and the plugin calls Proguard.
It is necessary to mention the parts of the code that you do not want to be obfuscated / shrunk or optimized by ProGuard because it would cause issues at runtime.
I should also mention that I’m only interested in obfuscating my code. Not all the code of all the 3rd party dependencies, such as SpringBoot. Do I just have to specify my package name somewhere?
You can use keep rules as follows, to allow optimization and shrinking while not applying name obfuscation onto 3rd party dependencies like SpringBoot:
-keep, allowoptimization, allowshrinking !com.your.package.** {*;}
The dependencies are in the jar itself in the BOOT-INF directory. How do I point to that jar within the jar
This depends on the specific use case, I would highly suggest you to take a look at the Spring Boot example: proguard/examples/spring-boot at master · Guardsquare/proguard · GitHub. This will hopefully help you to understand how to come up with the right set up for a Spring Boot application. You will find the following information in the Readme file for example:
Spring Boot applications contain a BOOT-INF folder which contains the application class files and library jars. We must first extract the program classes, then apply ProGuard to them and finally repackage the application.
Kind regards,
Ewout