Yifei Zhang | cedd452 | 2023-10-31 11:21:32 -0700 | [diff] [blame] | 1 | -include proguard_kotlin.flags |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 2 | -keep class com.android.systemui.VendorServices |
| 3 | |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 4 | # Needed to ensure callback field references are kept in their respective |
| 5 | # owning classes when the downstream callback registrars only store weak refs. |
Jared Duke | 8e74123 | 2023-09-19 22:51:05 +0000 | [diff] [blame] | 6 | # Note that we restrict this to SysUISingleton classes, as other registering |
| 7 | # classes should either *always* unregister or *never* register from their |
| 8 | # constructor. We also keep callback class names for easier debugging. |
| 9 | -keepnames @com.android.systemui.util.annotations.WeaklyReferencedCallback class * |
| 10 | -keepnames class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback ** |
| 11 | -if @com.android.systemui.util.annotations.WeaklyReferencedCallback class * |
| 12 | -keepclassmembers,allowaccessmodification @com.android.systemui.dagger.SysUISingleton class * { |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 13 | <1> *; |
| 14 | } |
Jared Duke | 8e74123 | 2023-09-19 22:51:05 +0000 | [diff] [blame] | 15 | -if class * extends @com.android.systemui.util.annotations.WeaklyReferencedCallback ** |
| 16 | -keepclassmembers,allowaccessmodification @com.android.systemui.dagger.SysUISingleton class * { |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 17 | <1> *; |
| 18 | } |
| 19 | |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 20 | -keep class androidx.core.app.CoreComponentFactory |
| 21 | |
| 22 | # Keep the wm shell lib |
| 23 | -keep class com.android.wm.shell.* |
| 24 | # Keep the protolog group methods that are called by the generated code |
| 25 | -keepclassmembers class com.android.wm.shell.protolog.ShellProtoLogGroup { |
| 26 | *; |
| 27 | } |
| 28 | |
| 29 | # Prevent optimization or access modification of any referenced code that may |
| 30 | # conflict with code in the bootclasspath. |
| 31 | # TODO(b/222468116): Resolve such collisions in the build system. |
| 32 | -keepnames class android.**.nano.** { *; } |
| 33 | -keepnames class com.android.**.nano.** { *; } |
| 34 | -keepnames class com.android.internal.protolog.** { *; } |
| 35 | -keepnames class android.hardware.common.** { *; } |
| 36 | |
Johannes Gallmann | 3c6a6d7 | 2023-12-13 12:43:38 +0000 | [diff] [blame] | 37 | # TODO(b/316553881): Statically linking flags into SystemUI and bootclasspath might not be a |
| 38 | # good idea in the first place |
| 39 | -keepnames class com.android.window.flags.Flags { public *; } |
| 40 | |
| 41 | |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 42 | # Allows proguard to make private and protected methods and fields public as |
| 43 | # part of optimization. This lets proguard inline trivial getter/setter methods. |
| 44 | -allowaccessmodification |
| 45 | |
Dave Mankoff | 9941659 | 2022-11-10 22:57:43 +0000 | [diff] [blame] | 46 | # Strip verbose logs. |
| 47 | -assumenosideeffects class android.util.Log { |
| 48 | static *** v(...); |
| 49 | static *** isLoggable(...); |
| 50 | } |
| 51 | -assumenosideeffects class android.util.Slog { |
| 52 | static *** v(...); |
| 53 | } |
| 54 | -maximumremovedandroidloglevel 2 |