From 7bb0f8413ea25b99dea1ab171bb6a6677f392773 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Tue, 17 Dec 2019 18:35:35 -0500 Subject: [PATCH 01/12] Embed proguard/R8 rules in kotlin-reflect artifact jar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Android build pipeline can extract embedded proguard configurations from dependencies and merge them automatically. This adds a conservative proguard configuration to the kotlin-reflect JVM artifact in support of that. This focuses mostly on just retaining what's necessary for kotlin-reflect's own functionality to operate, but could be expanded if community feedback discovers other good candidate rules. With this in place - most Android projects using R8 or Proguard should Just Work™️ with kotlin-reflect. --- .../resources/META-INF/proguard/kotlinreflect.pro | 14 ++++++++++++++ libraries/reflect/api/build.gradle | 3 +++ 2 files changed, 17 insertions(+) create mode 100644 core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro new file mode 100644 index 0000000000000..3751fecb18476 --- /dev/null +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro @@ -0,0 +1,14 @@ +##---------------Begin: Kotlin-reflect ---------- +# Keep Metadata annotations so they can be parsed at runtime. +-keep class kotlin.Metadata { *; } + +# Keep kotlin-reflect internals. +-keep class kotlin.reflect.jvm.* { *; } + +# Keep generic signatures and annotations at runtime. +# R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. +-keepattributes InnerClasses,Signature,*Annotation*,EnclosingMethod + +# Don't note on API calls from different JVM versions as they're gated properly at runtime. +-dontnote kotlin.internal.PlatformImplementationsKt +##---------------End: Kotlin-reflect ---------- \ No newline at end of file diff --git a/libraries/reflect/api/build.gradle b/libraries/reflect/api/build.gradle index cdaaa1fca8c08..f19789fd0c154 100644 --- a/libraries/reflect/api/build.gradle +++ b/libraries/reflect/api/build.gradle @@ -11,6 +11,9 @@ sourceSets { java { srcDir "${rootDir}/core/reflection.jvm/src" } + resources { + srcDir("${rootDir}/core/reflection.jvm/resources") + } } if (includeJava9) { From 3cd4251e810fedd20f4bfc38a80f1f696be5672c Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Tue, 17 Dec 2019 19:22:04 -0500 Subject: [PATCH 02/12] Fix wildcard --- .../resources/META-INF/proguard/kotlinreflect.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro index 3751fecb18476..9b30e5fc88656 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro @@ -3,7 +3,7 @@ -keep class kotlin.Metadata { *; } # Keep kotlin-reflect internals. --keep class kotlin.reflect.jvm.* { *; } +-keep class kotlin.reflect.jvm.** { *; } # Keep generic signatures and annotations at runtime. # R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. From c15aac48475d360ee4c39f83c37526fe0c75a247 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:20:00 -0500 Subject: [PATCH 03/12] Just keep service loaded APIs --- .../resources/META-INF/proguard/kotlinreflect.pro | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro index 9b30e5fc88656..d6fc86afc86d6 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro @@ -2,8 +2,12 @@ # Keep Metadata annotations so they can be parsed at runtime. -keep class kotlin.Metadata { *; } -# Keep kotlin-reflect internals. --keep class kotlin.reflect.jvm.** { *; } +# Keep implementations of service loaded interfaces +# R8 will automatically handle these these in 1.6+ +-keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader +-keep class * implements kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader { public protected *; } +-keep interface kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition +-keep class * implements kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition { public protected *; } # Keep generic signatures and annotations at runtime. # R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. From b8435582db4eafe1fe5f111ff3608e1c106f1e2a Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:22:26 -0500 Subject: [PATCH 04/12] Use `RuntimeVisible*Annotations` --- .../resources/META-INF/proguard/kotlinreflect.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro index d6fc86afc86d6..8d1ab8a843e01 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro @@ -11,7 +11,7 @@ # Keep generic signatures and annotations at runtime. # R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. --keepattributes InnerClasses,Signature,*Annotation*,EnclosingMethod +-keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod # Don't note on API calls from different JVM versions as they're gated properly at runtime. -dontnote kotlin.internal.PlatformImplementationsKt From c6f922b54e4d6c2ac46a8e33071749ad1a2c52e6 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:24:40 -0500 Subject: [PATCH 05/12] Nix headers --- .../resources/META-INF/proguard/kotlinreflect.pro | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro index 8d1ab8a843e01..8c2572594d826 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro @@ -1,4 +1,3 @@ -##---------------Begin: Kotlin-reflect ---------- # Keep Metadata annotations so they can be parsed at runtime. -keep class kotlin.Metadata { *; } @@ -14,5 +13,4 @@ -keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod # Don't note on API calls from different JVM versions as they're gated properly at runtime. --dontnote kotlin.internal.PlatformImplementationsKt -##---------------End: Kotlin-reflect ---------- \ No newline at end of file +-dontnote kotlin.internal.PlatformImplementationsKt \ No newline at end of file From 8af97da0e76a639ee216b77bb607c74ffa9b03b8 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:25:39 -0500 Subject: [PATCH 06/12] Rename to kotlin-reflect.pro --- .../META-INF/proguard/{kotlinreflect.pro => kotlin-reflect.pro} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename core/reflection.jvm/resources/META-INF/proguard/{kotlinreflect.pro => kotlin-reflect.pro} (100%) diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro similarity index 100% rename from core/reflection.jvm/resources/META-INF/proguard/kotlinreflect.pro rename to core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro From 82aa4e3d6a8103a70e59c7c007140d78ab15a3a3 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:28:36 -0500 Subject: [PATCH 07/12] Don't warn on relocated internal classes --- .../resources/META-INF/proguard/kotlin-reflect.pro | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro index 8c2572594d826..c833d0d36437b 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro @@ -13,4 +13,7 @@ -keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod # Don't note on API calls from different JVM versions as they're gated properly at runtime. --dontnote kotlin.internal.PlatformImplementationsKt \ No newline at end of file +-dontnote kotlin.internal.PlatformImplementationsKt + +# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +-dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file From 08616fbd7431b1284250664586f331724fb251ce Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:30:27 -0500 Subject: [PATCH 08/12] Split files across com.android.tools --- .../proguard/kotlin-reflect.pro | 23 +++++++++++++++++++ .../r8-from-1.6.0/kotlin-reflect.pro | 23 +++++++++++++++++++ .../r8-upto-1.6.0/kotlin-reflect.pro | 23 +++++++++++++++++++ .../META-INF/proguard/kotlin-reflect.pro | 4 ++++ 4 files changed, 73 insertions(+) create mode 100644 core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro create mode 100644 core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro create mode 100644 core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro new file mode 100644 index 0000000000000..8f4dae06c009b --- /dev/null +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro @@ -0,0 +1,23 @@ +# When editing this file, update the following files as well: +# - META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro +# - META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro +# - META-INF/proguard/kotlin-reflect.pro +# Keep Metadata annotations so they can be parsed at runtime. +-keep class kotlin.Metadata { *; } + +# Keep implementations of service loaded interfaces +# R8 will automatically handle these these in 1.6+ +-keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader +-keep class * implements kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader { public protected *; } +-keep interface kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition +-keep class * implements kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition { public protected *; } + +# Keep generic signatures and annotations at runtime. +# R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. +-keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod + +# Don't note on API calls from different JVM versions as they're gated properly at runtime. +-dontnote kotlin.internal.PlatformImplementationsKt + +# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +-dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro new file mode 100644 index 0000000000000..c296376d769c5 --- /dev/null +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro @@ -0,0 +1,23 @@ +# When editing this file, update the following files as well: +# - META-INF/com.android.tools/proguard/kotlin-reflect.pro +# - META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro +# - META-INF/proguard/kotlin-reflect.pro +# Keep Metadata annotations so they can be parsed at runtime. +-keep class kotlin.Metadata { *; } + +# Keep implementations of service loaded interfaces +# R8 will automatically handle these these in 1.6+ +-keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader +-keep class * implements kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader { public protected *; } +-keep interface kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition +-keep class * implements kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition { public protected *; } + +# Keep generic signatures and annotations at runtime. +# R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. +-keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod + +# Don't note on API calls from different JVM versions as they're gated properly at runtime. +-dontnote kotlin.internal.PlatformImplementationsKt + +# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +-dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro new file mode 100644 index 0000000000000..fd275c7727804 --- /dev/null +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro @@ -0,0 +1,23 @@ +# When editing this file, update the following files as well: +# - META-INF/com.android.tools/proguard/kotlin-reflect.pro +# - META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro +# - META-INF/proguard/kotlin-reflect.pro +# Keep Metadata annotations so they can be parsed at runtime. +-keep class kotlin.Metadata { *; } + +# Keep implementations of service loaded interfaces +# R8 will automatically handle these these in 1.6+ +-keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader +-keep class * implements kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader { public protected *; } +-keep interface kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition +-keep class * implements kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition { public protected *; } + +# Keep generic signatures and annotations at runtime. +# R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. +-keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod + +# Don't note on API calls from different JVM versions as they're gated properly at runtime. +-dontnote kotlin.internal.PlatformImplementationsKt + +# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +-dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro index c833d0d36437b..18014d3c6d433 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro @@ -1,3 +1,7 @@ +# When editing this file, update the following files as well: +# - META-INF/com.android.tools/proguard/kotlin-reflect.pro +# - META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro +# - META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro # Keep Metadata annotations so they can be parsed at runtime. -keep class kotlin.Metadata { *; } From a98b55334a199e3049bfc8cfbfbd4441c1c087fe Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:31:46 -0500 Subject: [PATCH 09/12] Remove service loader rules for r8 1.6+ --- .../com.android.tools/r8-from-1.6.0/kotlin-reflect.pro | 7 ------- 1 file changed, 7 deletions(-) diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro index c296376d769c5..1da5b66e36101 100644 --- a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro @@ -5,13 +5,6 @@ # Keep Metadata annotations so they can be parsed at runtime. -keep class kotlin.Metadata { *; } -# Keep implementations of service loaded interfaces -# R8 will automatically handle these these in 1.6+ --keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader --keep class * implements kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader { public protected *; } --keep interface kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition --keep class * implements kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition { public protected *; } - # Keep generic signatures and annotations at runtime. # R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. -keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod From 4e59c9fde4a393352b178e9edf567494ea645de8 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 6 Jan 2020 00:32:34 -0500 Subject: [PATCH 10/12] Generify wording --- .../META-INF/com.android.tools/proguard/kotlin-reflect.pro | 2 +- .../META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro | 2 +- .../META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro | 2 +- .../resources/META-INF/proguard/kotlin-reflect.pro | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro index 8f4dae06c009b..ec0050b0afa2f 100644 --- a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro @@ -19,5 +19,5 @@ # Don't note on API calls from different JVM versions as they're gated properly at runtime. -dontnote kotlin.internal.PlatformImplementationsKt -# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +# Don't note on internal APIs, as there is some class relocating that shrinkers may unnecessarily find suspicious. -dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro index 1da5b66e36101..1958c717df696 100644 --- a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-from-1.6.0/kotlin-reflect.pro @@ -12,5 +12,5 @@ # Don't note on API calls from different JVM versions as they're gated properly at runtime. -dontnote kotlin.internal.PlatformImplementationsKt -# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +# Don't note on internal APIs, as there is some class relocating that shrinkers may unnecessarily find suspicious. -dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro index fd275c7727804..ff4886b5b5cc3 100644 --- a/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/r8-upto-1.6.0/kotlin-reflect.pro @@ -19,5 +19,5 @@ # Don't note on API calls from different JVM versions as they're gated properly at runtime. -dontnote kotlin.internal.PlatformImplementationsKt -# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +# Don't note on internal APIs, as there is some class relocating that shrinkers may unnecessarily find suspicious. -dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file diff --git a/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro index 18014d3c6d433..831b237faac46 100644 --- a/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/proguard/kotlin-reflect.pro @@ -19,5 +19,5 @@ # Don't note on API calls from different JVM versions as they're gated properly at runtime. -dontnote kotlin.internal.PlatformImplementationsKt -# Don't note on internal APIs, as there is some class relocating that Proguard unnecessarily finds suspicious. +# Don't note on internal APIs, as there is some class relocating that shrinkers may unnecessarily find suspicious. -dontwarn kotlin.reflect.jvm.internal.** \ No newline at end of file From 509130244943a796d2c4e8b1cbd35a3009671265 Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Mon, 13 Jan 2020 23:56:53 -0500 Subject: [PATCH 11/12] Nix R8 mention in proguard-only file --- .../META-INF/com.android.tools/proguard/kotlin-reflect.pro | 1 - 1 file changed, 1 deletion(-) diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro index ec0050b0afa2f..8c9620e521292 100644 --- a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro @@ -6,7 +6,6 @@ -keep class kotlin.Metadata { *; } # Keep implementations of service loaded interfaces -# R8 will automatically handle these these in 1.6+ -keep interface kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader -keep class * implements kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader { public protected *; } -keep interface kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition From a7a9f2ba4ed83629b6fabac861c34fab95fbd3ed Mon Sep 17 00:00:00 2001 From: Zac Sweers Date: Wed, 15 Jan 2020 13:27:46 -0500 Subject: [PATCH 12/12] Nix enclosing method and signature from proguard --- .../META-INF/com.android.tools/proguard/kotlin-reflect.pro | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro index 8c9620e521292..d82eae8518cbf 100644 --- a/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro +++ b/core/reflection.jvm/resources/META-INF/com.android.tools/proguard/kotlin-reflect.pro @@ -12,8 +12,7 @@ -keep class * implements kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition { public protected *; } # Keep generic signatures and annotations at runtime. -# R8 requires InnerClasses and EnclosingMethod if you keepattributes Signature. --keepattributes InnerClasses,Signature,RuntimeVisible*Annotations,EnclosingMethod +-keepattributes Signature,RuntimeVisible*Annotations # Don't note on API calls from different JVM versions as they're gated properly at runtime. -dontnote kotlin.internal.PlatformImplementationsKt