Unregister with Proguard and the optimized Android configuration file

The My Proguard configuration file uses the following to delete log statements:

-assumenosideeffects class android.util.Log { public static *** d(...); public static *** e(...); } 

Apparently, this only takes effect when optimizations are enabled, so I refer to proguard-android-optimize.txt in the project properties file instead of proguard-android.txt .

Is this a minor change? proguard-android-optimize.txt says: โ€œAdding optimization leads to certain risks, because, for example, not all optimizations performed by ProGuard work with all versions of Dalvik.โ€ What exactly does this mean, and can I not use proguard-android-optimize. txt and instead add only the optimization instructions that are needed for my own configuration file to delete the log?

Thanks. Total newcomers to Proguard.

+6
source share
1 answer

You can only delete the log if optimization is enabled.

Optimization should be fairly stable in current versions of ProGuard. You can replace <android.sdk>/tools/proguard/lib/proguard.jar with the latest version if you want. For example, version 4.9 has improvements for removing registration traces from code compared to version 4.7 in the Android SDK at this time of writing (indicated by the output "java -jar proguard.jar").

+7
source

Source: https://habr.com/ru/post/949685/


All Articles