在 Eclipse for Android 中启用 ProGuard [英] Enabling ProGuard in Eclipse for Android

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

问题描述

ProGuard for Android 上的新文档说要在 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! 

我错过了什么吗?

另外,有没有办法只为 Eclipse 的生产构建启用 ProGuard(即导出成品时)?

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 for Android 中启用 ProGuard的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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