mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
bbb4e4480d
Summary: R8 shows warning that **com.facebook.react.bridge.JavaScriptModule**, **com.facebook.react.bridge.NativeModule** are interfaces so proguard rules must use implements instead of extends. This PR changes proguard rules to fix the warnings. ## Changelog [Android] [Changed] - Fix R8 warning Pull Request resolved: https://github.com/facebook/react-native/pull/27291 Test Plan: RNTester builds and runs as expected. Differential Revision: D18658704 Pulled By: mdvacca fbshipit-source-id: a679643542bc55b89141f58c3236a29cf83c20d2
65 lines
2.4 KiB
Prolog
65 lines
2.4 KiB
Prolog
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This source code is licensed under the MIT license found in the
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
# Add project specific ProGuard rules here.
|
|
# By default, the flags in this file are appended to flags specified
|
|
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
|
|
# You can edit the include path and order by changing the proguardFiles
|
|
# directive in build.gradle.
|
|
#
|
|
# For more details, see
|
|
# http://developer.android.com/guide/developing/tools/proguard.html
|
|
|
|
# Add any project specific keep options here:
|
|
|
|
# Disabling obfuscation is useful if you collect stack traces from production crashes
|
|
# (unless you are using a system that supports de-obfuscate the stack traces).
|
|
# -dontobfuscate
|
|
|
|
# React Native
|
|
|
|
# Keep our interfaces so they can be used by other ProGuard rules.
|
|
# See http://sourceforge.net/p/proguard/bugs/466/
|
|
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
|
|
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
|
|
-keep,allowobfuscation @interface com.facebook.common.internal.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 *
|
|
-keepclassmembers class * {
|
|
@com.facebook.proguard.annotations.DoNotStrip *;
|
|
@com.facebook.common.internal.DoNotStrip *;
|
|
}
|
|
|
|
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
|
|
void set*(***);
|
|
*** get*();
|
|
}
|
|
|
|
-keep class * implements com.facebook.react.bridge.JavaScriptModule { *; }
|
|
-keep class * implements com.facebook.react.bridge.NativeModule { *; }
|
|
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
|
|
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
|
|
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
|
|
|
|
-dontwarn com.facebook.react.**
|
|
-keep,includedescriptorclasses class com.facebook.react.bridge.** { *; }
|
|
|
|
# okhttp
|
|
|
|
-keepattributes Signature
|
|
-keepattributes *Annotation*
|
|
-keep class okhttp3.** { *; }
|
|
-keep interface okhttp3.** { *; }
|
|
-dontwarn okhttp3.**
|
|
|
|
# okio
|
|
|
|
-keep class sun.misc.Unsafe { *; }
|
|
-dontwarn java.nio.file.*
|
|
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
|
|
-dontwarn okio.**
|