Jared Duke | 629526d | 2022-02-08 11:28:34 -0800 | [diff] [blame] | 1 | # Preserve line number information for debugging stack traces. |
| 2 | -keepattributes SourceFile,LineNumberTable |
| 3 | |
Jared Duke | 08468554 | 2022-06-03 11:14:24 -0700 | [diff] [blame^] | 4 | # Preserve relationship information that can impact simple class naming. |
| 5 | -keepattributes EnclosingMethod,InnerClasses |
| 6 | |
Yohei Yukawa | 25c61e4 | 2022-02-14 22:30:49 +0000 | [diff] [blame] | 7 | -keep class com.android.systemui.recents.OverviewProxyRecentsImpl |
| 8 | -keep class com.android.systemui.statusbar.car.CarStatusBar |
Caitlin Cassidy | a3bcac5 | 2022-02-25 16:17:55 +0000 | [diff] [blame] | 9 | -keep class com.android.systemui.statusbar.phone.CentralSurfaces |
Yohei Yukawa | 25c61e4 | 2022-02-14 22:30:49 +0000 | [diff] [blame] | 10 | -keep class com.android.systemui.statusbar.tv.TvStatusBar |
Yao Chen | 634acb9 | 2016-04-13 16:17:47 -0700 | [diff] [blame] | 11 | -keep class com.android.systemui.car.CarSystemUIFactory |
Xiyuan Xia | 1b30f79 | 2016-01-06 08:50:30 -0800 | [diff] [blame] | 12 | -keep class com.android.systemui.SystemUIFactory |
Sergey Nikolaienkov | 7842bac | 2019-12-19 16:34:11 +0100 | [diff] [blame] | 13 | -keep class com.android.systemui.tv.TvSystemUIFactory |
Yohei Yukawa | 25c61e4 | 2022-02-14 22:30:49 +0000 | [diff] [blame] | 14 | -keep class * extends com.android.systemui.CoreStartable |
| 15 | -keep class * implements com.android.systemui.CoreStartable$Injector |
Winson | e6c9073 | 2015-09-24 16:06:29 -0700 | [diff] [blame] | 16 | |
Jason Monk | 87ccd55 | 2015-12-11 21:39:54 -0500 | [diff] [blame] | 17 | -keepclasseswithmembers class * { |
| 18 | public <init>(android.content.Context, android.util.AttributeSet); |
| 19 | } |
| 20 | |
Aurimas Liutikas | fd52c14 | 2018-04-17 09:50:46 -0700 | [diff] [blame] | 21 | -keep class ** extends androidx.preference.PreferenceFragment |
Yohei Yukawa | 25c61e4 | 2022-02-14 22:30:49 +0000 | [diff] [blame] | 22 | -keep class com.android.systemui.tuner.* |
Jason Monk | 86bc331 | 2016-08-16 13:17:56 -0400 | [diff] [blame] | 23 | -keep class com.android.systemui.plugins.** { |
Jason Monk | e6089af | 2018-07-31 14:38:11 -0400 | [diff] [blame] | 24 | *; |
Jason Monk | 86bc331 | 2016-08-16 13:17:56 -0400 | [diff] [blame] | 25 | } |
Jason Monk | 9424af7 | 2018-12-19 14:17:26 -0500 | [diff] [blame] | 26 | -keep class com.android.systemui.fragments.FragmentService$FragmentCreator { |
| 27 | *; |
| 28 | } |
Aurimas Liutikas | fd52c14 | 2018-04-17 09:50:46 -0700 | [diff] [blame] | 29 | -keep class androidx.core.app.CoreComponentFactory |
Dave Mankoff | a5d8a39 | 2019-10-10 12:21:09 -0400 | [diff] [blame] | 30 | |
Yohei Yukawa | 25c61e4 | 2022-02-14 22:30:49 +0000 | [diff] [blame] | 31 | -keep public class * extends com.android.systemui.CoreStartable { |
| 32 | public <init>(android.content.Context); |
| 33 | } |
| 34 | |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 35 | # Keep the wm shell lib |
Dave Mankoff | 8552807 | 2020-08-06 10:32:25 -0400 | [diff] [blame] | 36 | -keep class com.android.wm.shell.* |
Winson Chung | b754f52 | 2020-08-03 22:17:08 -0700 | [diff] [blame] | 37 | # Keep the protolog group methods that are called by the generated code |
| 38 | -keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup { |
| 39 | *; |
| 40 | } |
Dave Mankoff | 8552807 | 2020-08-06 10:32:25 -0400 | [diff] [blame] | 41 | |
Yohei Yukawa | 25c61e4 | 2022-02-14 22:30:49 +0000 | [diff] [blame] | 42 | -keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent { !synthetic *; } |
| 43 | -keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.GlobalRootComponent$SysUIComponentImpl { !synthetic *; } |
| 44 | -keep,allowoptimization,allowaccessmodification class com.android.systemui.dagger.Dagger** { !synthetic *; } |
| 45 | -keep,allowoptimization,allowaccessmodification class com.android.systemui.tv.Dagger** { !synthetic *; } |
| 46 | |
Jared Duke | 83a28e6 | 2022-03-03 13:11:46 -0800 | [diff] [blame] | 47 | # Prevent optimization or access modification of any referenced code that may |
| 48 | # conflict with code in the bootclasspath. |
| 49 | # TODO(b/222468116): Resolve such collisions in the build system. |
| 50 | -keepnames class android.**.nano.** { *; } |
| 51 | -keepnames class com.android.**.nano.** { *; } |
| 52 | -keepnames class com.android.internal.protolog.** { *; } |
| 53 | -keepnames class android.hardware.common.** { *; } |
| 54 | |
Jared Duke | 2fee740 | 2021-10-18 14:35:04 -0700 | [diff] [blame] | 55 | # Allows proguard to make private and protected methods and fields public as |
| 56 | # part of optimization. This lets proguard inline trivial getter/setter methods. |
| 57 | -allowaccessmodification |
Jared Duke | dc1646f | 2021-11-30 12:35:45 -0800 | [diff] [blame] | 58 | |
| 59 | # Removes runtime checks added through Kotlin to JVM code genereration to |
| 60 | # avoid linear growth as more Kotlin code is converted / added to the codebase. |
| 61 | # These checks are generally applied to Java platform types (values returned |
| 62 | # from Java code that don't have nullness annotations), but we remove them to |
| 63 | # avoid code size increases. |
| 64 | # |
| 65 | # See also https://kotlinlang.org/docs/reference/java-interop.html |
| 66 | # |
| 67 | # TODO(b/199941987): Consider standardizing these rules in a central place as |
| 68 | # Kotlin gains adoption with other platform targets. |
| 69 | -assumenosideeffects class kotlin.jvm.internal.Intrinsics { |
| 70 | # Remove check for method parameters being null |
| 71 | static void checkParameterIsNotNull(java.lang.Object, java.lang.String); |
| 72 | |
| 73 | # When a Java platform type is returned and passed to Kotlin NonNull method, |
| 74 | # remove the null check |
| 75 | static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String); |
| 76 | static void checkNotNullExpressionValue(java.lang.Object, java.lang.String); |
| 77 | |
| 78 | # Remove check that final value returned from method is null, if passing |
| 79 | # back Java platform type. |
| 80 | static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String); |
| 81 | static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String); |
| 82 | |
| 83 | # Null check for accessing a field from a parent class written in Java. |
| 84 | static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String); |
| 85 | static void checkFieldIsNotNull(java.lang.Object, java.lang.String); |
| 86 | |
| 87 | # Removes code generated from !! operator which converts Nullable type to |
| 88 | # NonNull type. These would throw an NPE immediate after on access. |
| 89 | static void checkNotNull(java.lang.Object, java.lang.String); |
| 90 | static void checkNotNullParameter(java.lang.Object, java.lang.String); |
| 91 | |
| 92 | # Removes lateinit var check being used before being set. Check is applied |
| 93 | # on every field access without this. |
| 94 | static void throwUninitializedPropertyAccessException(java.lang.String); |
| 95 | } |
Kevin Jeon | d79d0d7 | 2022-05-03 21:49:19 +0000 | [diff] [blame] | 96 | # Strip verbose logs. |
| 97 | -assumenosideeffects class android.util.Log { |
| 98 | static *** v(...); |
| 99 | static *** isLoggable(...); |
| 100 | } |
| 101 | -assumenosideeffects class android.util.Slog { |
| 102 | static *** v(...); |
| 103 | } |
| 104 | -maximumremovedandroidloglevel 2 |