我有一个运行良好的 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.**
. 任何人都可以提出为什么混淆不适用于这个类的子集吗?