我正在构建一个使用 Proguard 混淆的发布 apk。我添加了前两个规则来帮助我解码 logcat 可能吐出的任何错误。
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-keep @io.realm.annotations.RealmModule class *
-dontwarn javax.**
-dontwarn io.realm.**
-dontwarn rx.internal.**
#Butterknife
-keep class butterknife.** { *; }
-dontwarn butterknife.internal.**
-keep class **$$ViewBinder { *; }
-keepclasseswithmembernames class * {
@butterknife.* <fields>;
}
-keepclasseswithmembernames class * {
@butterknife.* <methods>;
}
#EventBus
-keepclassmembers class ** {
public void onEvent*(**);
}
#JodaTime
-dontwarn org.joda.convert.**
-dontwarn org.joda.time.**
-keep class org.joda.time.** { *; }
-keep interface org.joda.time.** { *; }
应用程序崩溃的错误如下:
AndroidRuntime:Error at com.example.app.e.b.a(SourceFile:65)
AndroidRuntime:Error at com.example.app.e.b.doInBackground(SourceFile:21)
前两条规则有助于向我显示实际的行号,但我无法弄清楚“eba”和“eb”在暗示什么。任何帮助都感激不尽。
编辑:
使用 ReTrace 工具后,我收到以下信息:
07-30 13:38:44.886 E/AndroidRuntime(5563): Process: com.example.app, PID: 5563
07-30 13:38:44.886 E/AndroidRuntime(5563): at com.example.app.e.c$a.a(SourceFile:266)
07-30 13:38:44.886 E/AndroidRuntime(5563): at com.example.app.e.c$a.doInBackground(SourceFile:250)
07-30 13:38:44.886 E/ActivityManager(1173): App crashed! Process: com.example.app