这是我第一次使用Proguard。我用下面的代码在一个示例项目中测试它(只是为了检查当stacktrace被混淆时)
package com.proguardtest;
import android.app.Activity;
import android.os.Bundle;
public class ProguardTestActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
try{
Integer.parseInt("Test");
} catch (Exception e){
e.printStackTrace();
}
}
}
所以我创建了一个新项目,并进入文件:违约。属性并添加
行proguard.config=proguard.cfg
这个文件是由Android Tools自动生成的。
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
#
# This file must be checked in Version Control Systems.
#
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Project target.
target=android-7
proguard.config=proguard.cfg
然后我尝试用导出向导(Eclipse Windows)生成apk,在最后一步,当我为apk选择路径时,出现一个错误对话框,显示转换到dalvik失败。
我做错了什么?
Thanks in advance
升级到ProGuard 4.6(下载,解压。zip文件,复制到.android-sdktools ProGuard)