From cfcf5eba4317f80ef8902463b7c0b2e1e7b534a7 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Mon, 3 Feb 2020 01:55:18 -0800 Subject: [PATCH] Add new DoNotStrip class to proguard config (#27934) Summary: JNI now comes from https://github.com/facebookincubator/fbjni and it uses a different DoNotStrip class (https://github.com/facebookincubator/fbjni/blob/master/java/com/facebook/jni/annotations/DoNotStrip.java) so we need to include it in the proguard config. ## Changelog [Android] [Fixed] - Add new DoNotStrip class to proguard config Pull Request resolved: https://github.com/facebook/react-native/pull/27934 Test Plan: Test that it fixes a crash related to missing NativeRunnable class in release builds. Differential Revision: D19690580 Pulled By: cpojer fbshipit-source-id: cb4e2eaae35fb3a9d68f04c57cc973914207be73 --- ReactAndroid/proguard-rules.pro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ReactAndroid/proguard-rules.pro b/ReactAndroid/proguard-rules.pro index 874ad4f29f6590..7eeef601f7189a 100644 --- a/ReactAndroid/proguard-rules.pro +++ b/ReactAndroid/proguard-rules.pro @@ -25,13 +25,16 @@ -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip +-keep,allowobfuscation @interface com.facebook.jni.annotations.DoNotStrip # Do not strip any method/class that is annotated with @DoNotStrip -keep @com.facebook.proguard.annotations.DoNotStrip class * -keep @com.facebook.common.internal.DoNotStrip class * +-keep @com.facebook.jni.annotations.DoNotStrip class * -keepclassmembers class * { @com.facebook.proguard.annotations.DoNotStrip *; @com.facebook.common.internal.DoNotStrip *; + @com.facebook.jni.annotations.DoNotStrip *; } -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {