From 51b868728afca9337dc6d3f17345bd7212efa1db Mon Sep 17 00:00:00 2001 From: Joshua Gross Date: Thu, 14 Feb 2019 15:07:04 -0800 Subject: [PATCH] Attempt to fix T40449334 by adding DoNotStrip to interface Summary: Java symbols are likely being stripped at compile-time, preventing Reflection from working properly in C++. Should fix T40449334. Reviewed By: mdvacca Differential Revision: D14070629 fbshipit-source-id: f180fa3294b66f660ab1568250c47432cbf0c774 --- .../java/com/facebook/react/fabric/ReactNativeConfig.java | 7 +++++++ .../java/com/facebook/react/fabric/jsi/jni/Binding.cpp | 4 +--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/ReactNativeConfig.java b/ReactAndroid/src/main/java/com/facebook/react/fabric/ReactNativeConfig.java index d837df5c12..a6f57f7d06 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/ReactNativeConfig.java +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/ReactNativeConfig.java @@ -6,13 +6,17 @@ */ package com.facebook.react.fabric; +import com.facebook.proguard.annotations.DoNotStrip; + // This is a wrapper for the ReactNativeConfig object in C++ +@DoNotStrip public interface ReactNativeConfig { /** * Get a boolean param by string name. Default should be false. * * @param param The string name of the parameter being requested. */ + @DoNotStrip boolean getBool(String param); /** @@ -20,6 +24,7 @@ public interface ReactNativeConfig { * * @param param The string name of the parameter being requested. */ + @DoNotStrip int getInt64(String param); /** @@ -27,6 +32,7 @@ public interface ReactNativeConfig { * * @param param The string name of the parameter being requested. */ + @DoNotStrip String getString(String param); /** @@ -34,5 +40,6 @@ public interface ReactNativeConfig { * * @param param The string name of the parameter being requested. */ + @DoNotStrip double getDouble(String param); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp index 6fa4f8c241..9bb5f12bd5 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jsi/jni/Binding.cpp @@ -127,9 +127,7 @@ void Binding::installFabricUIManager( eventBeatManager, runtime, localJavaUIManager); }; - // TODO: Provide non-empty impl for ReactNativeConfig. - std::shared_ptr config = - std::make_shared(reactNativeConfig); + std::shared_ptr config = std::make_shared(reactNativeConfig); contextContainer->registerInstance(config, "ReactNativeConfig"); contextContainer->registerInstance( synchronousBeatFactory, "synchronous");