我正在使用最新的 SDK 开发一个 Android APP。我正在为 Api 4 (android 1.6) 开发应用程序。
我的项目有一个proguard-project.txt文件(这是最新版本的 Android SDK 的 proguard 配置文件)并且 project.properties 文件取消了 proguard 行的注释,因此 proguard 被激活(proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt)
问题是我用proguard编译了apk文件,似乎proguard在文件中没有做任何事情,我反编译了apk并显示了与不使用proguard时相同的代码。我的proguard-project.txt也是空的。它只包含评论...
这是我自动生成的proguard-project.txt文件的内容:
# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# Add any project specific keep options here:
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
我必须在这个文件中添加哪些行来混淆、优化和减小我的 apk 文件的大小?(至少可以混淆代码......)
谢谢