Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 1 | # This is a configuration file for ProGuard. |
| 2 | # http://proguard.sourceforge.net/index.html#manual/usage.html |
| 3 | |
Søren Gjesse | d9ce797 | 2018-03-21 15:13:29 +0100 | [diff] [blame] | 4 | # Some tests use thenThrow from Mockito which require information on |
| 5 | # checked exceptions. |
| 6 | -keepattributes Exceptions |
| 7 | |
Daisuke Miyakawa | c81adf5 | 2010-08-12 13:04:43 -0700 | [diff] [blame] | 8 | # Keep all Fragments in this package, which are used by reflection. |
tmfang | 27c84de | 2018-06-28 11:39:05 +0800 | [diff] [blame] | 9 | -keep public class com.android.settings.** extends androidx.fragment.app.Fragment |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 10 | |
Fan Zhang | 917f101 | 2018-02-21 15:22:25 -0800 | [diff] [blame] | 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 | |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 20 | # We want to keep methods in Activity that could be used in the XML attribute onClick. |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 21 | -keepclassmembers class * extends android.app.Activity { |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 22 | public void *(android.view.View); |
| 23 | public void *(android.view.MenuItem); |
Jean Chalard | 0824d31 | 2011-12-02 17:47:09 +0900 | [diff] [blame] | 24 | } |
Udam Saini | 8ef4c62 | 2016-02-03 17:31:11 -0800 | [diff] [blame] | 25 | |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 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. |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 37 | -keepclasseswithmembers class * { |
Udam Saini | 8ef4c62 | 2016-02-03 17:31:11 -0800 | [diff] [blame] | 38 | public <init>(android.content.Context, android.util.AttributeSet); |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 39 | } |
| 40 | -keepclasseswithmembers class * { |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 41 | public <init>(android.content.Context, android.util.AttributeSet, int); |
Anna Galusza | 16d58e7 | 2016-03-22 13:07:44 -0700 | [diff] [blame] | 42 | } |
Matthew Fritze | b277557 | 2017-12-05 10:46:47 -0800 | [diff] [blame] | 43 | -keepclasseswithmembers class * { |
| 44 | public <init>(android.content.Context, android.util.AttributeSet, int, int); |
| 45 | } |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 46 | |
| 47 | # Keep annotated classes or class members. |
Aurimas Liutikas | e0069d3 | 2018-04-17 11:22:43 -0700 | [diff] [blame] | 48 | -keep @androidx.annotation.Keep class * |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 49 | -keepclassmembers class * { |
Aurimas Liutikas | e0069d3 | 2018-04-17 11:22:43 -0700 | [diff] [blame] | 50 | @androidx.annotation.Keep *; |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 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 | } |
Aurimas Liutikas | e0069d3 | 2018-04-17 11:22:43 -0700 | [diff] [blame] | 58 | -keep class androidx.core.app.CoreComponentFactory |
Mill Chen | fb49921 | 2018-09-17 22:06:05 +0800 | [diff] [blame] | 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); |
Jason Chiu | a68f815 | 2018-10-29 17:58:55 +0800 | [diff] [blame] | 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 | } |