Add proguard rules to bridge BUCK

Summary:
prevents reflected classes from being stripped/obfuscated
Depends on D4830910

Reviewed By: mhorowitz

Differential Revision: D4835688

fbshipit-source-id: 5b85668f92ed4ae5cebc9902ec60f6d5d6299bd4
This commit is contained in:
Benjamin Jaeger 2017-04-07 11:42:33 -07:00 committed by Facebook Github Bot
parent 403f356082
commit e154117f37
2 changed files with 20 additions and 0 deletions

View File

@ -21,6 +21,7 @@ android_library(
react_native_dep("java/com/facebook/proguard/annotations:annotations"), react_native_dep("java/com/facebook/proguard/annotations:annotations"),
react_native_dep("third-party/java/jsr-330:jsr-330"), react_native_dep("third-party/java/jsr-330:jsr-330"),
], ],
proguard_config = "reactnative.pro",
visibility = [ visibility = [
"PUBLIC", "PUBLIC",
], ],

View File

@ -0,0 +1,19 @@
-keepnames class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keepnames class * extends com.facebook.react.cxxbridge.CxxModuleWrapper {*; }
-keepclassmembers class * extends com.facebook.react.bridge.NativeModule {
@com.facebook.react.bridge.ReactMethod *;
public <init>(...);
}
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
-keepnames class * extends com.facebook.react.uimanager.ViewManager
-keepnames class * extends com.facebook.react.uimanager.ReactShadowNode
-keep class **$$PropsSetter
-keep class **$$ReactModuleInfoProvider
-keep class com.facebook.react.bridge.ReadableType { *; }
-keepnames class com.facebook.quicklog.QuickPerformanceLogger {
void markerAnnotate(int,int,java.lang.String,java.lang.String);
void markerTag(int,int,java.lang.String);
}