What am i doing wrong in ProGuard configuration to remove log lines?

混江龙づ霸主 提交于 2019-12-25 00:17:35

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!