Adding it on a method or field will keep the method/field (and its name) as well as the class name intact. Note that this annotation is available only when using the AndroidX Annotations Library and when you include the ProGuard rules file that is packaged with the Android Gradle plugin, as described in the section about how to enable shrinking. There are many considerations you should make when using the -keep option; for more information about customizing your rules file, read the ProGuard Manual.