ProGuard should consider classes mentioned as @annotation parameters to be 'used'.
Java class file shrinker, optimizer, obfuscator, and preverifier
Brought to you by:
guardsquare
I have an annotation to set lifecycle listeners on Fragments, but ProGuard strips the classes I give as parameters:
@LifecycleListener(listeners = {Listener1.class, Listener2.class})
public class SomeFragment extends LifecycleAnnotationAwareFragment {
...
}
I have a workaround of making all the listeners names match *LifecycleListener, and telling ProGuard to keep all such classes (and tell the code which adds those listeners to object strenuously if someone tries to add something with a bad name) but direct support for the parameters of Annotations that survive stripping would be nice.