blob: 5fc79943a339a6d4feaf876f0b75e9031c9a2e0d [file] [log] [blame]
Mike Doddd3b009a2015-08-11 11:16:59 -07001# 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 Adamsenb0f8c822025-01-17 04:34:59 -080017-keepattributes SourceFile,
18 LineNumberTable,
19 RuntimeVisibleAnnotations,
20 RuntimeVisibleParameterAnnotations,
21 RuntimeVisibleTypeAnnotations,
22 AnnotationDefault
Mike Doddd3b009a2015-08-11 11:16:59 -070023
24# Keep classes and methods that have the guava @VisibleForTesting annotation
Christoffer Adamsen96af7082025-01-06 12:57:13 +010025# TODO(b/373579455): Evaluate if <init> needs to be kept.
26-keep @com.google.common.annotations.VisibleForTesting class * {
27 void <init>();
28}
Mike Doddd3b009a2015-08-11 11:16:59 -070029-keepclassmembers class * {
30 @com.google.common.annotations.VisibleForTesting *;
31}
Raman Tennetib1aa2132020-07-09 18:37:41 -070032-keep class com.android.messaging.* { *; }
33-keep class com.android.messaging.*.* { *; }
34-keep class com.android.messaging.*.*.* { *; }
Mike Doddd3b009a2015-08-11 11:16:59 -070035
36# Keep methods that have the @VisibleForAnimation annotation
Christoffer Adamsen96af7082025-01-06 12:57:13 +010037# TODO(b/373579455): Evaluate if <init> needs to be kept.
38-keep @interface com.android.messaging.annotation.VisibleForAnimation {
39 void <init>();
40}
Mike Doddd3b009a2015-08-11 11:16:59 -070041-keepclassmembers class * {
42 @com.android.messaging.annotation.VisibleForAnimation *;
43}
44
Christoffer Adamsen96af7082025-01-06 12:57:13 +010045# 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.
micky387193f4dd2025-06-17 19:36:55 -040070-keep public class * extends androidx.preference.Preference {
Christoffer Adamsen96af7082025-01-06 12:57:13 +010071 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 Doddd3b009a2015-08-11 11:16:59 -070077-keep public class com.android.vcard.* { *; }
78
Raman Tennetib1aa2132020-07-09 18:37:41 -070079-keep class androidx.collection.* { *; }
Aurimas Liutikas1b693ea2018-04-09 17:17:41 -070080-keep class androidx.core.* { *; }
81-keep class androidx.core.*.* { *; }
82-keep class androidx.appcompat.* { *; }
83-keep class androidx.appcompat.*.* { *; }
Raman Tennetib1aa2132020-07-09 18:37:41 -070084-keep class androidx.recyclerview.widget.* { *; }
85-keep class androidx.viewpager.widget.* { *; }
Mike Doddd3b009a2015-08-11 11:16:59 -070086
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}