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. |
Christoffer Adamsen | bc97628 | 2025-01-06 13:00:46 +0100 | [diff] [blame] | 9 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 10 | -keep public class com.android.settings*.** extends androidx.fragment.app.Fragment { |
| 11 | void <init>(); |
| 12 | } |
Amith Yamasani | b14e1e0 | 2010-11-02 09:52:29 -0700 | [diff] [blame] | 13 | |
Fan Zhang | 917f101 | 2018-02-21 15:22:25 -0800 | [diff] [blame] | 14 | # Keep all preference controllers needed by slice and DashboardFragment. |
Beverly Tai | aaa52b4 | 2019-02-06 15:44:20 +0000 | [diff] [blame] | 15 | -keep class * extends com.android.settings.core.BasePreferenceController { |
Fan Zhang | 917f101 | 2018-02-21 15:22:25 -0800 | [diff] [blame] | 16 | *; |
| 17 | } |
| 18 | |
| 19 | -keep class * extends com.android.settings.core.TogglePreferenceController { |
| 20 | *; |
| 21 | } |
| 22 | |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 23 | # We want to keep methods in Activity that could be used in the XML attribute onClick. |
Jared Duke | 4c8bae7 | 2022-09-19 14:57:35 -0700 | [diff] [blame] | 24 | -keepclassmembers class com.android.settings*.** extends android.app.Activity { |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 25 | public void *(android.view.View); |
| 26 | public void *(android.view.MenuItem); |
Jean Chalard | 0824d31 | 2011-12-02 17:47:09 +0900 | [diff] [blame] | 27 | } |
Udam Saini | 8ef4c62 | 2016-02-03 17:31:11 -0800 | [diff] [blame] | 28 | |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 29 | # Keep setters in Views so that animations can still work. |
Jared Duke | 4c8bae7 | 2022-09-19 14:57:35 -0700 | [diff] [blame] | 30 | -keep public class com.android.settings*.** extends android.view.View { |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 31 | public <init>(android.content.Context); |
| 32 | public <init>(android.content.Context, android.util.AttributeSet); |
| 33 | public <init>(android.content.Context, android.util.AttributeSet, int); |
| 34 | |
| 35 | void set*(***); |
| 36 | *** get*(); |
| 37 | } |
| 38 | |
| 39 | # Keep classes that may be inflated from XML. |
Jared Duke | 4c8bae7 | 2022-09-19 14:57:35 -0700 | [diff] [blame] | 40 | -keepclasseswithmembers class com.android.settings*.** { |
Udam Saini | 8ef4c62 | 2016-02-03 17:31:11 -0800 | [diff] [blame] | 41 | public <init>(android.content.Context, android.util.AttributeSet); |
Justin Klaassen | d770c05 | 2016-06-28 19:26:43 -0700 | [diff] [blame] | 42 | } |
Jared Duke | 4c8bae7 | 2022-09-19 14:57:35 -0700 | [diff] [blame] | 43 | -keepclasseswithmembers class com.android.settings*.** { |
Justin Klaassen | 478b5a8 | 2016-06-21 18:31:16 -0700 | [diff] [blame] | 44 | public <init>(android.content.Context, android.util.AttributeSet, int); |
Anna Galusza | 16d58e7 | 2016-03-22 13:07:44 -0700 | [diff] [blame] | 45 | } |
Jared Duke | 4c8bae7 | 2022-09-19 14:57:35 -0700 | [diff] [blame] | 46 | -keepclasseswithmembers class com.android.settings*.** { |
Matthew Fritze | b277557 | 2017-12-05 10:46:47 -0800 | [diff] [blame] | 47 | public <init>(android.content.Context, android.util.AttributeSet, int, int); |
| 48 | } |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 49 | |
Justin Klaassen | ab70411 | 2016-08-01 16:16:40 -0700 | [diff] [blame] | 50 | # Keep specific fields used via reflection. |
| 51 | -keepclassmembers class * { |
| 52 | public static ** SEARCH_INDEX_DATA_PROVIDER; |
| 53 | public static ** SUMMARY_PROVIDER_FACTORY; |
| 54 | } |
Christoffer Adamsen | bc97628 | 2025-01-06 13:00:46 +0100 | [diff] [blame] | 55 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 56 | -keep class androidx.core.app.CoreComponentFactory { |
| 57 | void <init>(); |
| 58 | } |
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 | } |
Tsung-Mao Fang | 18ad0c4 | 2021-08-17 18:28:06 +0800 | [diff] [blame] | 69 | |
| 70 | # Keep WM Jetpack classes and callbacks |
| 71 | -keep class androidx.window.extensions.** { *; } |
| 72 | -dontwarn androidx.window.extensions.** |
| 73 | -keep class androidx.window.** { *; } |
Kyle Zhang | 7dbe651 | 2024-06-11 18:45:11 +0000 | [diff] [blame] | 74 | |
| 75 | # Keep the com.android.settings.media_drm.FakeFeatureFlagsImpl |
| 76 | -keep class com.android.settings.media_drm.FakeFeatureFlagsImpl { *; } |