这是我当前针对Android项目的Proguard配置文件:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-repackageclasses
-libraryjars "libs/**.so"
-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
-keep public class com.scoreloop.** {*;}
-keep public class com.facebook.** {*;}
-keep public class com.google.ads.** {*;}
-keepclasseswithmembernames class * {
native <methods>;
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembernames class * {
public <init>(android.content.Context, android.util.AttributeSet, int);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
-assumenosideeffects class android.util.Log {
public static *** i(...);
public static *** v(...);
public static *** d(...);
}
什么是正确的方法来防止Proguard尝试干扰共享对象?当我将它们添加到我的项目并尝试导出应用程序时,我目前会立即遇到错误:
您应该检查是否需要指定其他程序JAR文件。
在我添加-libraryjars
行之后,它给了我这个错误:java.io.IOException: Can't read [proguard.ClassPathEntry@56f0474c] (No such file or directory)
。如何修复我的Proguard配置文件?