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
How to turn off proguard completely?
提问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 Source
is 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
- In your project folder create or edit proguard.cfg
Add this to proguard.cfg
-dontoptimize -dontshrink -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose
Add to project.properties this:
- 在您的项目文件夹中创建或编辑 proguard.cfg
将此添加到 proguard.cfg
-dontoptimize -dontshrink -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose
添加到 project.properties :
proguard.config=proguard.cfg
proguard.config=proguard.cfg
- form console run:
ant clean ant release
- 表单控制台运行:
ant clean ant release
回答by ahmadalibaloch
set this
设置这个
minifyEnabled false
in your app build.gradle
在您的应用程序中 build.gradle
回答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 代码收缩器。
minifyEnabledis code shrinker
- shrinkResourcesis resource shrinker(works only when minifyEnabled true)
- useProguardis code obfuscator
- You can use minifyEnabled truewith useProguard false
So, for completely disabling the proguard features do :
minifyEnabled是代码压缩器
- shrinkResources是资源收缩器(仅在 minifyEnabled 为 true 时有效)
- useProguard是代码混淆器
- 您可以使用minifyEnabled true和useProguard false
因此,要完全禁用 proguard 功能,请执行以下操作:
minifyEnabled false useProguard false
minifyEnabled false useProguard false