我想创建一个混淆的 android 应用程序。我为此使用 ProGuard。我想自动删除所有 Log.* 消息。我怎样才能做到这一点?我找到了这篇文章,但我仍然得到它们。(我使用反编译器来检查混淆)。
proguard-project.txt 如下:
-injars libs/In.jar
-outjars libs/Out.jar
#-libraryjars <java.home>/lib/rt.jar
-libraryjars C:/Users/thomas/android-sdks/platforms/android-7/android.jar
-dontpreverify
-repackageclasses ''
-allowaccessmodification
-optimizations !code/simplification/arithmetic
-renamesourcefileattribute SourceFile
-keepattributes Exceptions,InnerClasses,Signature,Deprecated,
SourceFile,LineNumberTable,*Annotation*,EnclosingMethod
-keep public class * {
public protected *;
}
-keepclassmembernames class * {
java.lang.Class class$(java.lang.String);
java.lang.Class class$(java.lang.String, boolean);
}
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keepclassmembers class * implements java.io.Serializable {
static final long serialVersionUID;
private static final java.io.ObjectStreamField[] serialPersistentFields;
private void writeObject(java.io.ObjectOutputStream);
private void readObject(java.io.ObjectInputStream);
java.lang.Object writeReplace();
java.lang.Object readResolve();
}
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** e(...);
}
任何帮助,将不胜感激。
谢谢。