我創建我的應用程序並按照建議here我已經做到了這一點:的Android應用程序保護使用ProGuard
在proguard的-project.txt:
# 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 *;
#}
-optimizationpasses 10
-dontwarn android.support.**
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class ClassOne extends Activity
-keep public class ClassTwo extends ListActivity
-keep public class ClassThree extends ListActivity
-keep public class ClassFour extends ListActivity
-keep public class ClassFive extends ListActivity
-keep public class ClassSix extends ListActivity
-keep public class ClassSeven extends Activity
這些都是階級對我manifest
在project.properties取消註釋行:
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
我導出了我的應用程序並打開了使用的dex2jar和jd-gui,以查看是否添加了任何成功。
問題是,代碼幾乎和我編碼一樣,而且很容易理解。
我做錯了什麼?我可以改進混淆嗎?
謝謝。做到了,但結果是一樣的:( – Favolas
我仍然有我的Proguard配置在proguard.cfg文件中,並打開Proguard,我有project.properties中的proguard.config = proguard.cfg 行(我不' t知道這些是否是當前推薦的名稱!另外,我只使用Ant進行發佈版本,只是使用Eclipse進行調試版本)對不起,它不適用於您的配置 – NickT
好吧,更改'proguard.config = $ {sdk。 dir} /tools/proguard/proguard-android.txt:proguard-project.txt到'proguard.config = proguard-project.txt'。它的接縫更好,但它相對容易理解代碼。 – Favolas