我一直在努力让 Proguard 让 Spongycastle 工作。大多数情况下,当我导出已签名的 APK 时,问题就出现了,要么我有错误,要么应用程序在启动前就会崩溃。
因此,我设法收集信息以获得有效的 proguard 配置:
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontskipnonpubliclibraryclassmembers
-dontpreverify
-verbose
-repackageclasses ''
-allowaccessmodification
-keepattributes *Annotation*
-optimizations !code/simplification/arithmetic
-libraryjars C:\Program Files\Java\jre7\lib\rt.jar
-libraryjars libs\sc-light-jdk15on-1.47.0.2.jar
-libraryjars libs\scprov-jdk15on-1.47.0.2.jar
-injars libs
-outjars bin/classes-processed.jar
-dontwarn javax.naming.**
-dontwarn android.support.**
####
-keep class org.** { *; }
-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
-keepclasseswithmembernames class * {
native <methods>;
}
-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.app.Activity {
public void *(android.view.View);
}
-keepclassmembers enum * {
public static **[] values();
public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable {
public static final android.os.Parcelable$Creator *;
}
我正在运行ADT 版本:22.0.0.v201305140200--675183 测试手机在 Android 2.3.5 下
借用我的部分是“ -keep class org.** { *; }
”....我做得对吗?我试过“ -keep class org.spongycastle.** { *; }
”,但应用程序在启动前就崩溃了......
谢谢 !