android混淆记录 对vatimio库避免混淆 对EventBus避免混淆

最近为了增加自己app的反编译难道,也为了减少压缩包体积,所以配置了混淆规则,这里坑还是蛮多的。
大体上我是参考这篇博客:https://www.jianshu.com/p/b5b2a5dfaaf4
并且直接复制了他的模板,对于而外的内容在这里记录

1
2
-dontwarn com.example.pc_0775.naugthyvideo.bean.**
-keepnames class com.example.pc_0775.naugthyvideo.bean.** { *;}

对vatimio库避免混淆

1
-keep class io.vov.vitamio.** { *; }

对EventBus避免混淆

1
2
3
4
5
6
7
8
9
10
-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);
}