Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 1 | # Copyright (C) 2015 The Android Open Source Project |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | # |
| 15 | # Keep enough data for stack traces |
| 16 | -renamesourcefileattribute SourceFile |
Christoffer Adamsen | b0f8c82 | 2025-01-17 04:34:59 -0800 | [diff] [blame] | 17 | -keepattributes SourceFile, |
| 18 | LineNumberTable, |
| 19 | RuntimeVisibleAnnotations, |
| 20 | RuntimeVisibleParameterAnnotations, |
| 21 | RuntimeVisibleTypeAnnotations, |
| 22 | AnnotationDefault |
Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 23 | |
| 24 | # Keep classes and methods that have the guava @VisibleForTesting annotation |
Christoffer Adamsen | 96af708 | 2025-01-06 12:57:13 +0100 | [diff] [blame] | 25 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 26 | -keep @com.google.common.annotations.VisibleForTesting class * { |
| 27 | void <init>(); |
| 28 | } |
Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 29 | -keepclassmembers class * { |
| 30 | @com.google.common.annotations.VisibleForTesting *; |
| 31 | } |
Raman Tenneti | b1aa213 | 2020-07-09 18:37:41 -0700 | [diff] [blame] | 32 | -keep class com.android.messaging.* { *; } |
| 33 | -keep class com.android.messaging.*.* { *; } |
| 34 | -keep class com.android.messaging.*.*.* { *; } |
Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 35 | |
| 36 | # Keep methods that have the @VisibleForAnimation annotation |
Christoffer Adamsen | 96af708 | 2025-01-06 12:57:13 +0100 | [diff] [blame] | 37 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 38 | -keep @interface com.android.messaging.annotation.VisibleForAnimation { |
| 39 | void <init>(); |
| 40 | } |
Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 41 | -keepclassmembers class * { |
| 42 | @com.android.messaging.annotation.VisibleForAnimation *; |
| 43 | } |
| 44 | |
Christoffer Adamsen | 96af708 | 2025-01-06 12:57:13 +0100 | [diff] [blame] | 45 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 46 | -keep public class * extends android.app.Activity { |
| 47 | void <init>(); |
| 48 | } |
| 49 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 50 | -keep public class * extends android.app.Application { |
| 51 | void <init>(); |
| 52 | } |
| 53 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 54 | -keep public class * extends android.app.Service { |
| 55 | void <init>(); |
| 56 | } |
| 57 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 58 | -keep public class * extends android.content.BroadcastReceiver { |
| 59 | void <init>(); |
| 60 | } |
| 61 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 62 | -keep public class * extends android.content.ContentProvider { |
| 63 | void <init>(); |
| 64 | } |
| 65 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 66 | -keep public class * extends android.app.backup.BackupAgentHelper { |
| 67 | void <init>(); |
| 68 | } |
| 69 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
micky387 | 193f4dd | 2025-06-17 19:36:55 -0400 | [diff] [blame] | 70 | -keep public class * extends androidx.preference.Preference { |
Christoffer Adamsen | 96af708 | 2025-01-06 12:57:13 +0100 | [diff] [blame] | 71 | void <init>(); |
| 72 | } |
| 73 | # TODO(b/373579455): Evaluate if <init> needs to be kept. |
| 74 | -keep public class * extends androidx.fragment.app.Fragment { |
| 75 | void <init>(); |
| 76 | } |
Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 77 | -keep public class com.android.vcard.* { *; } |
| 78 | |
Raman Tenneti | b1aa213 | 2020-07-09 18:37:41 -0700 | [diff] [blame] | 79 | -keep class androidx.collection.* { *; } |
Aurimas Liutikas | 1b693ea | 2018-04-09 17:17:41 -0700 | [diff] [blame] | 80 | -keep class androidx.core.* { *; } |
| 81 | -keep class androidx.core.*.* { *; } |
| 82 | -keep class androidx.appcompat.* { *; } |
| 83 | -keep class androidx.appcompat.*.* { *; } |
Raman Tenneti | b1aa213 | 2020-07-09 18:37:41 -0700 | [diff] [blame] | 84 | -keep class androidx.recyclerview.widget.* { *; } |
| 85 | -keep class androidx.viewpager.widget.* { *; } |
Mike Dodd | d3b009a | 2015-08-11 11:16:59 -0700 | [diff] [blame] | 86 | |
| 87 | # Keep rastermill classes that need to be accessed from native code (JNI) |
| 88 | -keep class android.support.rastermill.** { *; } |
| 89 | |
| 90 | # Preserve the name of the getCaller method so it can find itself in the stack trace it generates |
| 91 | -keepclassmembers public class com.android.messaging.util.DebugUtils { |
| 92 | public static java.lang.StackTraceElement getCaller(...); |
| 93 | } |
| 94 | |
| 95 | # Keep the static fields of referenced inner classes of auto-generated R classes, in case we |
| 96 | # access those fields by reflection (e.g. EmojiMarkup) |
| 97 | -keepclassmembers class **.R$* { |
| 98 | public static <fields>; |
| 99 | } |