From 38b48debc575cacdb05e057fc84479d3db2f72d8 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Tue, 26 Mar 2019 09:48:28 -0700 Subject: [PATCH] Understand the support library/androidx @Keep annotations Copied from tools/base/build-system/gradle-core/src/main/resources/com/android/build/gradle/proguard-common.txt. Fixes: 129311848 Test: none Change-Id: Ie8b40b416c8772a550bb4d1f7bd6e7e944cdd166 --- core/proguard.flags | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/core/proguard.flags b/core/proguard.flags index 6ed1f9b3bc..50049cbdad 100644 --- a/core/proguard.flags +++ b/core/proguard.flags @@ -15,4 +15,35 @@ @**.VisibleForTesting *; } +# Understand the @Keep support annotation. +-keep class android.support.annotation.Keep +-keep class androidx.annotation.Keep + +-keep @android.support.annotation.Keep class * {*;} +-keep @androidx.annotation.Keep class * {*;} + +-keepclasseswithmembers class * { + @android.support.annotation.Keep ; +} + +-keepclasseswithmembers class * { + @androidx.annotation.Keep ; +} + +-keepclasseswithmembers class * { + @android.support.annotation.Keep ; +} + +-keepclasseswithmembers class * { + @androidx.annotation.Keep ; +} + +-keepclasseswithmembers class * { + @android.support.annotation.Keep (...); +} + +-keepclasseswithmembers class * { + @androidx.annotation.Keep (...); +} + -include proguard_basic_keeps.flags