我究竟错在ProGuard的配置中删除日志行? [英] What am i doing wrong in ProGuard configuration to remove log lines?

查看:238
本文介绍了我究竟错在ProGuard的配置中删除日志行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从我的apk删除记录的线条和我使用ProGuard的这一点。

它不删除行,有什么可以是问题? (我知道,ProGuard的是,因为我通过反编译测试APK,看它是否被混淆)

这是我的ProGuard配置文件的全部内容:

  -assumenosideeffects类android.util.Log {
    公共静态布尔isLoggable(java.lang.String中,INT);
    公共静态INT V(...);
    公共静态INT I(...);
    公共静态INT W(......);
    公共静态INT D(...);
    公共静态INT E(...);
}


解决方案

您只有在优化未禁用删除日志,这就要求在指定 project.properties

  proguard.config = $ {} sdk.dir /tool​​s/proguard/proguard-android-optimize.txt:proguard-project.txt

类似的问题和答案:

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(...);
}

解决方案

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:

这篇关于我究竟错在ProGuard的配置中删除日志行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆