Java 如何完全关闭proguard?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23915319/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-14 09:00:21  来源:igfitidea点击:

How to turn off proguard completely?

androidproguardjava

提问by AlikElzin-kilaka

I have an Android application on which I don't want to do anything regarding optimization/obfuscation/etc.

我有一个 Android 应用程序,我不想在它上面做任何关于优化/混淆/等的事情。

I deleted the (auto-generated) proguard configuration file (proguard.cfg) but I think my library projects' files are still being obfuscated, because in the crash reports I don't see the line numbers - Unknown Sourceis shown instead.

我删除了(自动生成的)proguard 配置文件 (proguard.cfg),但我认为我的库项目的文件仍然被混淆,因为在崩溃报告中我没有看到行号 -Unknown Source而是显示了。

How can I turn off proguard completely?

如何完全关闭 proguard?

Also, how can I validate that it was indeed turned off?

另外,我如何验证它确实已关闭?

回答by dorin.canepa

  1. In your project folder create or edit proguard.cfg
  2. Add this to proguard.cfg -dontoptimize -dontshrink -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose

  3. Add to project.properties this:

  1. 在您的项目文件夹中创建或编辑 proguard.cfg
  2. 将此添加到 proguard.cfg -dontoptimize -dontshrink -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose

  3. 添加到 project.properties :

proguard.config=proguard.cfg

proguard.config=proguard.cfg

  1. form console run: ant clean ant release
  1. 表单控制台运行: ant clean ant release

回答by ahmadalibaloch

set this

设置这个

minifyEnabled false

in your app build.gradle

在您的应用程序中 build.gradle

https://stackoverflow.com/a/39051307/2002079

https://stackoverflow.com/a/39051307/2002079

回答by priojeet priyom

    debug/release(as per your need) {
        minifyEnabled false
        useProguard false

    }

回答by Arpit Agarwal

UPDATE: DISABLING THE USE PROGUARD NOW ENABLES R8 CODE SHRINKER BY DEFAULT .

更新:现在禁用 USE PROGUARD 会默认启用 R8 代码收缩器。

  1. minifyEnabledis code shrinker

    1. shrinkResourcesis resource shrinker(works only when minifyEnabled true)
    2. useProguardis code obfuscator
    3. You can use minifyEnabled truewith useProguard false

    So, for completely disabling the proguard features do :

  1. minifyEnabled代码压缩

    1. shrinkResources资源收缩器(仅在 minifyEnabled 为 true 时有效)
    2. useProguard代码混淆器
    3. 您可以使用minifyEnabled trueuseProguard false

    因此,要完全禁用 proguard 功能,请执行以下操作:

minifyEnabled false useProguard false

minifyEnabled false useProguard false