我尝试使用 proguard android 工具。但是没有安装混淆的apk(我使用eclipse导出向导)。dex2jar 告诉我所有类都在 jar 中,但以 *.dump.txt 命名并包含如下内容:
//class:0002 access:0x0011
public final class com.company.android.BuildConfig
//field:0000 access:0x0019
//Lcom/company/android/BuildConfig;.DEBUG Z
public static final Z DEBUG=true;
//method:0000 access:0x10001
//Lcom/company/android/BuildConfig;.<init>()V
public V <init>()
this:v0 //com.company.android.BuildConfig
LOCAL_VARIABLE LL0 ~ LL1 v0 -> this // Lcom/company/android/BuildConfig;
LABEL | LL0: line 4
INVOKE_DIRECT | |v0.<init>() //Ljava/lang/Object;.<init>()V
RETURN_VOID | |return
LABEL | LL1:
我哪里错了?我怎样才能使工作混淆apk?
我的 proguard.cfg:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Service
-keep public class * extends android.content.BroadcastReceiver
-keep public class * extends android.content.ContentProvider
-keep public class * extends android.app.backup.BackupAgentHelper
-keep public class * extends android.preference.Preference
-keep public class com.android.vending.licensing.ILicensingService
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers class * extends android.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
我的项目属性:
target=android-8
proguard.config=proguard.cfg
谢谢!