如何使用proguard / dexguard对类的子集进行模糊处理

时间:2015-01-09 02:34:57

标签: android proguard dexguard

我有一个正常工作的dexguard项目。现在我想混淆2个类,因为appcompat-v7 v21.0.0存在错误。问题是我无法做到这一点。我认为有一些矛盾的规则可以避免混淆。这是我的proguard文件:

-dalvik
-repackageclasses ''
-allowaccessmodification
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic
-keepattributes *Annotation*
-keepresourcexmlattributenames
    manifest/installLocation,
    manifest/versionCode,
    manifest/application/*/intent-filter/*/name

-encryptnativelibraries lib/**/libnativeBatterySupport.so

-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

-keepclasseswithmembernames class * {
    native <methods>;
}

-keep public class * extends android.view.View {
    public <init>(android.content.Context);
    public <init>(android.content.Context, android.util.AttributeSet);
    public <init>(android.content.Context, android.util.AttributeSet, int);
    public void set*(...);
}

-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.content.Context {
   public void *(android.view.View);
   public void *(android.view.MenuItem);
}

-keepclassmembers class * implements android.os.Parcelable {
    static ** CREATOR;
}

-keepclassmembers class **.R$* {
    public static <fields>;
}

-keepclassmembers class * {
    @android.webkit.JavascriptInterface <methods>;
}

-keep public class * extends android.app.Fragment {
    <init>(...);
}
-keep public class * extends android.support.v4.app.Fragment {
    <init>(...);
}

-keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
}

-keep class * implements android.os.Parcelable {
  public static final android.os.Parcelable$Creator *;
}

# Preserve Android support libraries` classes and interfaces
#-keep class android.support.** { *; }
#BIG HACK TO AVOID A CRASH BECAUSE OF SHITTY appcompat 21.
-keep class !android.support.v7.internal.view.menu.**,android.support.** {*;}
-keep interface android.support.** { *; }

如你所见,我正在试图混淆的是android.support.v7.internal.view.menu.**。任何人都可以建议为什么混淆不适用于这个类的子集?

0 个答案:

没有答案