I am trying to configure proguard for my Android project. We use some fragments of the netty library in our code, and I would like to use Proguard to completely remove code fragments that, as I know, are not used.
Is there any way to tell proguard to assume that a package (or class) is never used and therefore should not be included in output JARs? Note that I'm not talking about excluding any code from obfuscation (which makes the configuration options -keep), I'm talking about completely removing the class from the output.
Edit : as pst suggested below, I tried using an argument -whyareyoukeepingto determine the code path that proguard uses to define the class. It does not change the output of dozens of warnings.
I also tried using a file filter on -outjars, as suggested by pst. This also did not lead to a change, since the algorithm still assumes that the class will be loaded and the filter is applied only after the incorrect definition of the "used" classes.
To be clear: warnings come from classes in third-party libraries that we include in our Android project. We are not executing any code that will load these classes, and if proguard finds a path to the code where it assumes these classes are loaded, I would like to directly say that it does not use these classes.
source
share