mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-07 22:40:55 +08:00
Invert native dependency of new bridge -> old bridge
Reviewed By: mhorowitz Differential Revision: D3409230 fbshipit-source-id: 541309ec953843477197e5a2b13730b8a38f608d
This commit is contained in:
committed by
Facebook Github Bot 7
parent
b2d4c2e255
commit
d344963123
@@ -14,6 +14,10 @@ import com.facebook.soloader.SoLoader;
|
||||
|
||||
@DoNotStrip
|
||||
public class JSCJavaScriptExecutor extends JavaScriptExecutor {
|
||||
static {
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
public static class Factory implements JavaScriptExecutor.Factory {
|
||||
@Override
|
||||
public JavaScriptExecutor create(WritableNativeMap jscConfig) throws Exception {
|
||||
@@ -21,10 +25,6 @@ public class JSCJavaScriptExecutor extends JavaScriptExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
}
|
||||
|
||||
public JSCJavaScriptExecutor(WritableNativeMap jscConfig) {
|
||||
initialize(jscConfig);
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.facebook.soloader.SoLoader;
|
||||
@DoNotStrip
|
||||
public abstract class NativeArray {
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
protected NativeArray(HybridData hybridData) {
|
||||
|
||||
@@ -19,7 +19,7 @@ import com.facebook.soloader.SoLoader;
|
||||
@DoNotStrip
|
||||
public abstract class NativeMap {
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
public NativeMap(HybridData hybridData) {
|
||||
|
||||
@@ -24,6 +24,10 @@ import com.facebook.proguard.annotations.DoNotStrip;
|
||||
*/
|
||||
@DoNotStrip
|
||||
public class ProxyJavaScriptExecutor extends JavaScriptExecutor {
|
||||
static {
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
public static class Factory implements JavaScriptExecutor.Factory {
|
||||
private final JavaJSExecutor.Factory mJavaJSExecutorFactory;
|
||||
|
||||
@@ -37,10 +41,6 @@ public class ProxyJavaScriptExecutor extends JavaScriptExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
}
|
||||
|
||||
private @Nullable JavaJSExecutor mJavaJSExecutor;
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,16 +24,22 @@ import com.facebook.soloader.SoLoader;
|
||||
@DoNotStrip
|
||||
public class ReactBridge extends Countable {
|
||||
|
||||
/* package */ static final String REACT_NATIVE_LIB = "reactnativejni";
|
||||
private static final String REACT_NATIVE_LIB = "reactnativejni";
|
||||
private static final String XREACT_NATIVE_LIB = "reactnativejnifb";
|
||||
|
||||
static {
|
||||
SoLoader.loadLibrary(REACT_NATIVE_LIB);
|
||||
staticInit();
|
||||
}
|
||||
|
||||
private final ReactCallback mCallback;
|
||||
private final JavaScriptExecutor mJSExecutor;
|
||||
private final MessageQueueThread mNativeModulesQueueThread;
|
||||
|
||||
public static void staticInit() {
|
||||
SoLoader.loadLibrary(REACT_NATIVE_LIB);
|
||||
SoLoader.loadLibrary(XREACT_NATIVE_LIB);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param jsExecutor the JS executor to use to run JS
|
||||
* @param callback the callback class used to invoke native modules
|
||||
|
||||
@@ -21,9 +21,8 @@ import java.util.ArrayList;
|
||||
*/
|
||||
@DoNotStrip
|
||||
public class ReadableNativeArray extends NativeArray implements ReadableArray {
|
||||
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
protected ReadableNativeArray(HybridData hybridData) {
|
||||
|
||||
@@ -22,9 +22,8 @@ import java.util.HashMap;
|
||||
*/
|
||||
@DoNotStrip
|
||||
public class ReadableNativeMap extends NativeMap implements ReadableMap {
|
||||
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
protected ReadableNativeMap(HybridData hybridData) {
|
||||
|
||||
@@ -21,9 +21,8 @@ import com.facebook.soloader.SoLoader;
|
||||
*/
|
||||
@DoNotStrip
|
||||
public class WritableNativeArray extends ReadableNativeArray implements WritableArray {
|
||||
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
public WritableNativeArray() {
|
||||
|
||||
@@ -22,7 +22,7 @@ import com.facebook.soloader.SoLoader;
|
||||
@DoNotStrip
|
||||
public class WritableNativeMap extends ReadableNativeMap implements WritableMap {
|
||||
static {
|
||||
SoLoader.loadLibrary(ReactBridge.REACT_NATIVE_LIB);
|
||||
ReactBridge.staticInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user