greenrobot / EventBus

Event bus for Android and Java that simplifies communication between Activities, Fragments, Threads, Services, etc. Less code, better quality.
http://greenrobot.org/eventbus/
Apache License 2.0
24.67k stars 4.66k forks source link

Missing rule in consumer proguard rule file #685

Closed tdtran closed 2 years ago

tdtran commented 2 years ago

The following should be added to the consumer proguard rule file

-keepclassmembers class org.greenrobot.eventbus.util.ThrowableFailureEvent {
    <init>(java.lang.Throwable);
}

The current rule set only have keepclassmembers for subclasses of ThrowableFailureEvent, not for ThrowableFailureEvent class itself

This problem is not exactly new. Before version 3.3.0 we were supposed to add the rules to our project proguard rule file ourself as advised by EventBus README which also forgot the rule for ThrowableFailureEvent class. One user reported the issue here

https://github.com/greenrobot/EventBus/issues/131#issuecomment-166283438

We had to do the same for our projects.

greenrobot-team commented 2 years ago

Thanks for reporting! The existing rule can also be replaced by yours as AsyncExecutor does not seem to require using a subclass of ThrowableFailureEvent. It's rather just the default.

Instead it requires any class with a constructor that takes a Throwable as single parameter. Should also update docs with this.