I have two versions of the same application using identical proguard.cfg with the following section aimed at squelching all Log.x() LogCat output:
-assumenosideeffects class android.util.Log {
public static *** v(...);
public static *** i(...);
public static *** d(...);
public static *** w(...);
public static *** e(...);
}
The first version is monolithic (i.e. not referencing any Library projects whatsoever) and proguard.cfg works there exactly as expected.
The second version is using two Library projects (one is mine and the other is Google’s LVL). The same proguard.cfg is placed in both the application project and my Library project. However, in that second version, proguard.cfg seems to simply have no effect!
What could possibly explain this?
You did add
proguard.config=proguard.cfgtobuild.propertiesin your application project? You should see ProGuard’s console messages and output files. The optimization pass should at least mention some “Number of removed instructions”.The application classes and the library classes are all compiled to bin/classes. They are then treated exactly the same: they are combined into bin/original.jar and obfuscated to bin/obfuscated.jar, using proguard.cfg. Adding more classes can’t really have an effect on removing the logging code.