1# This is a configuration file for ProGuard. 2# http://proguard.sourceforge.net/index.html#manual/usage.html 3 4# Some tests use thenThrow from Mockito which require information on 5# checked exceptions. 6-keepattributes Exceptions 7 8# Keep all Fragments in this package, which are used by reflection. 9-keep public class com.android.settings.** extends androidx.fragment.app.Fragment 10 11# Keep all preference controllers needed by slice and DashboardFragment. 12-keep class * extends com.android.settings.core.BasePreferenceController { 13 *; 14} 15 16-keep class * extends com.android.settings.core.TogglePreferenceController { 17 *; 18} 19 20# We want to keep methods in Activity that could be used in the XML attribute onClick. 21-keepclassmembers class * extends android.app.Activity { 22 public void *(android.view.View); 23 public void *(android.view.MenuItem); 24} 25 26# Keep setters in Views so that animations can still work. 27-keep public class * extends android.view.View { 28 public <init>(android.content.Context); 29 public <init>(android.content.Context, android.util.AttributeSet); 30 public <init>(android.content.Context, android.util.AttributeSet, int); 31 32 void set*(***); 33 *** get*(); 34} 35 36# Keep classes that may be inflated from XML. 37-keepclasseswithmembers class * { 38 public <init>(android.content.Context, android.util.AttributeSet); 39} 40-keepclasseswithmembers class * { 41 public <init>(android.content.Context, android.util.AttributeSet, int); 42} 43-keepclasseswithmembers class * { 44 public <init>(android.content.Context, android.util.AttributeSet, int, int); 45} 46 47# Keep annotated classes or class members. 48-keep @androidx.annotation.Keep class * 49-keepclassmembers class * { 50 @androidx.annotation.Keep *; 51} 52 53# Keep specific fields used via reflection. 54-keepclassmembers class * { 55 public static ** SEARCH_INDEX_DATA_PROVIDER; 56 public static ** SUMMARY_PROVIDER_FACTORY; 57} 58-keep class androidx.core.app.CoreComponentFactory 59 60# Keep classes that implements CustomSliceable, which are used by reflection. 61-keepclasseswithmembers class * implements com.android.settings.slices.CustomSliceable { 62 public <init>(android.content.Context); 63} 64 65# Keep classes that extends SliceBackgroundWorker, which are used by reflection. 66-keepclasseswithmembers class * extends com.android.settings.slices.SliceBackgroundWorker { 67 public <init>(android.content.Context, android.net.Uri); 68} 69