1-keep interface android.annotation.SystemApi 2-keep @android.annotation.SystemApi public class * { 3 public protected *; 4} 5-keepclasseswithmembers public class * { 6 @android.annotation.SystemApi public protected *; 7} 8# Also ensure nested classes are kept. This is overly conservative, but handles 9# cases where such classes aren't explicitly marked @SystemApi. 10# TODO(b/248580093): Rely on Metalava-generated Proguard rules instead. 11-if @android.annotation.SystemApi class * 12-keep public class <1>$** { 13 public protected *; 14} 15