blob: 5531a9c69a2d3b45aba977297bec55aaa7334f9f [file] [log] [blame]
Xin Li8a3204f2024-09-04 16:14:54 -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
17-keepattributes SourceFile,LineNumberTable,*Annotation*
18
19# Keep classes and methods that have the guava @VisibleForTesting annotation
Christoffer Adamsen96af7082025-01-06 12:57:13 +010020# TODO(b/373579455): Evaluate if <init> needs to be kept.
21-keep @com.google.common.annotations.VisibleForTesting class * {
22 void <init>();
23}
Xin Li8a3204f2024-09-04 16:14:54 -070024-keepclassmembers class * {
25 @com.google.common.annotations.VisibleForTesting *;
26}
27-keep class com.android.messaging.* { *; }
28-keep class com.android.messaging.*.* { *; }
29-keep class com.android.messaging.*.*.* { *; }
30
31# Keep methods that have the @VisibleForAnimation annotation
Christoffer Adamsen96af7082025-01-06 12:57:13 +010032# TODO(b/373579455): Evaluate if <init> needs to be kept.
33-keep @interface com.android.messaging.annotation.VisibleForAnimation {
34 void <init>();
35}
Xin Li8a3204f2024-09-04 16:14:54 -070036-keepclassmembers class * {
37 @com.android.messaging.annotation.VisibleForAnimation *;
38}
39
Christoffer Adamsen96af7082025-01-06 12:57:13 +010040# TODO(b/373579455): Evaluate if <init> needs to be kept.
41-keep public class * extends android.app.Activity {
42 void <init>();
43}
44# TODO(b/373579455): Evaluate if <init> needs to be kept.
45-keep public class * extends android.app.Application {
46 void <init>();
47}
48# TODO(b/373579455): Evaluate if <init> needs to be kept.
49-keep public class * extends android.app.Service {
50 void <init>();
51}
52# TODO(b/373579455): Evaluate if <init> needs to be kept.
53-keep public class * extends android.content.BroadcastReceiver {
54 void <init>();
55}
56# TODO(b/373579455): Evaluate if <init> needs to be kept.
57-keep public class * extends android.content.ContentProvider {
58 void <init>();
59}
60# TODO(b/373579455): Evaluate if <init> needs to be kept.
61-keep public class * extends android.app.backup.BackupAgentHelper {
62 void <init>();
63}
64# TODO(b/373579455): Evaluate if <init> needs to be kept.
65-keep public class * extends android.preference.Preference {
66 void <init>();
67}
68# TODO(b/373579455): Evaluate if <init> needs to be kept.
69-keep public class * extends androidx.fragment.app.Fragment {
70 void <init>();
71}
Xin Li8a3204f2024-09-04 16:14:54 -070072-keep public class com.android.vcard.* { *; }
73
74-keep class androidx.collection.* { *; }
75-keep class androidx.core.* { *; }
76-keep class androidx.core.*.* { *; }
77-keep class androidx.appcompat.* { *; }
78-keep class androidx.appcompat.*.* { *; }
79-keep class androidx.recyclerview.widget.* { *; }
80-keep class androidx.viewpager.widget.* { *; }
81
82# Keep rastermill classes that need to be accessed from native code (JNI)
83-keep class android.support.rastermill.** { *; }
84
85# Preserve the name of the getCaller method so it can find itself in the stack trace it generates
86-keepclassmembers public class com.android.messaging.util.DebugUtils {
87 public static java.lang.StackTraceElement getCaller(...);
88}
89
90# Keep the static fields of referenced inner classes of auto-generated R classes, in case we
91# access those fields by reflection (e.g. EmojiMarkup)
92-keepclassmembers class **.R$* {
93 public static <fields>;
94}