本文介绍了在Eclipse中为Android启用ProGuard的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的新文档说,要添加一行到default.properties文件在项目主目录中。但是,打开此文件时,我在顶部阅读:

The new documentation on ProGuard for Android says to add a line to the default.properties file in the project home directory. However, on opening this file, I read at the top:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!

我错过了什么?

另外是否有一种方法可以让ProGuard只能从Eclipse生产生成(即导出成品时)?

Also, is there a way to enable ProGuard only for a production build from Eclipse (i.e., when exporting the finished product)?

推荐答案

只是一个跟进,因为我正在寻找相同的事情 - 这里的答案是过时的 - 最近的基础proguard配置在这里的sdk目录 - 所以你只需要把它放到你的project.properties中:

just a follow-up because I was searching for the same thing - and the answers here are outdated - lately the base proguard config is here in the sdk dir - so you only have to put this into your project.properties:

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

如果要进行项目特定修改,请创建一个proguard-project.txt并将该行更改为:

if you want to make project-specific modifications, create a proguard-project.txt and change the line to:

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

这篇关于在Eclipse中为Android启用ProGuard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 05:16
查看更多