Java 我在哪里可以找到我的项目中的 proguard.cfg?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20514881/
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-13 02:28:04  来源:igfitidea点击:

Where do I find proguard.cfg in my project?

javaandroidproguard

提问by

I want to enable the ProGuardfor my application and in this documentation ProGuardit says that the proguard.cfg, where I have to modify something, is automatically generated. But if I look in my project folder I only see a proguard-project.txtfile but I dont see the proguard.cfgwhich I need.

我想ProGuard为我的应用程序启用 ,并且在本文档ProGuard 中,它说proguard.cfg我必须修改某些内容的 是自动生成的。但是如果我查看我的项目文件夹,我只会看到一个proguard-project.txt文件,但我没有看到proguard.cfg我需要的文件。

How can I get this proguard.cfg? Or was I'm doing wrong?

我怎样才能得到这个 proguard.cfg?还是我做错了?

Please guid me to this file.

请引导我到这个文件。

采纳答案by GrIsHu

The documentation is slightly inaccurate. The generated file is proguard-project.txtand will be in the root directory of your project.

文档有点不准确。生成的文件现在proguard-project.txt并将位于项目的根目录中。

To enable Proguard, you will need to ignore the "do not modify"warning in project.propertiesand uncomment the following line:

要启用Proguard,您需要忽略"do not modify"警告project.properties并取消注释以下行:

     proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

The Android tool chain will sometimes make changes to project.properties, but your Proguardpath will be preserved.

Android 工具链有时会对 进行更改project.properties,但您的Proguard路径将被保留。