项目中应用了eventBus,打包时总出错或者闪退。
在网上找了三四种,都不好用,最后还是使用了官方文档的混淆代码。
现在将代码贴出来,方便大家使用。
-keepattributes *Annotation*
-keepclassmembers class ** {
@org.greenrobot.eventbus.Subscribe <methods>;
}
-keep enum org.greenrobot.eventbus.ThreadMode { *; }
# Only required if you use AsyncExecutor
-keepclassmembers class * extends org.greenrobot.eventbus.util.ThrowableFailureEvent {
<init>(java.lang.Throwable);
}