问题
I am trying to remove logging lines from my apk and i use proguard for this.
It doesn't remove the lines, what can be the problem? (i know that proguard is on, because i test the apk by decompiling to see if it is obfuscated)
This is the full contents of my proguard config file:
-assumenosideeffects class android.util.Log {
public static boolean isLoggable(java.lang.String, int);
public static int v(...);
public static int i(...);
public static int w(...);
public static int d(...);
public static int e(...);
}
回答1:
You can only remove logging if optimization is not disabled, which requires specifying a different global configuration file in project.properties:
proguard.config=${sdk.dir}/tools/proguard/proguard-android-optimize.txt:proguard-project.txt
Similar questions and answers:
- Removing Log call using proguard
- Removing unused strings during ProGuard optimisation
- Removing logging with ProGuard doesn't remove the strings being logged
- How to config my proguard-project.txt file to remove just Logs
- Android Proguard Options - Stricter Rules & Remove Log Statements
来源:https://stackoverflow.com/questions/16561385/what-am-i-doing-wrong-in-proguard-configuration-to-remove-log-lines