Android的Proguard的不删除所有日志消息 [英] Android Proguard not removing all log messages
问题描述
我想创建一个模糊的android应用。我使用ProGuard的为。我想自动删除所有日志。*的消息。我该怎么办呢?我发现<一href="http://stackoverflow.com/questions/4435773/android-proguard-removing-all-log-statements-and-merging-packages">this职位,但我仍然得到他们。 (我用一个反编译器检查混淆)
ProGuard的-project.txt如下:
I want to create an obfuscated android application. I use ProGuard for that. I would like to automatically remove all the Log.* messages. How can I do that? I found this post but I still get them. (I use a decompiler to check the obfuscation).
The proguard-project.txt is the following:
-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(...);
}
任何帮助将是AP preciated。
谢谢你。
Any help would be appreciated.
Thanks.
推荐答案
这只是删除所有调试 Log.d(TAG,...);
和错误 Log.e(TAG,...)
调用:
This only remove all debug Log.d(TAG, "...");
and error Log.e(TAG, "...")
calls:
-assumenosideeffects class android.util.Log {
public static *** d(...);
public static *** e(...);
}
要删除所有日志调用,只需使用这样的:
To remove all log calls, simply use this:
-assumenosideeffects class android.util.Log { *; }
这篇关于Android的Proguard的不删除所有日志消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!