diff --git a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/JSBundleLoader.java b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/JSBundleLoader.java index 1c3df2ca2..f0b813052 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/JSBundleLoader.java +++ b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/JSBundleLoader.java @@ -12,9 +12,6 @@ package com.facebook.react.cxxbridge; import android.content.Context; import com.facebook.react.devsupport.DebugServerException; -import com.facebook.react.devsupport.DevServerHelper; - -import java.io.File; /** * A class that stores JS bundle information and allows {@link CatalystInstance} to load a correct @@ -108,20 +105,6 @@ public abstract class JSBundleLoader { }; } - public static JSBundleLoader createUnpackingBundleLoader( - final Context context, - final String sourceURL, - final String bundleName) { - return UnpackingJSBundleLoader.newBuilder() - .setContext(context) - .setSourceURL(sourceURL) - .setDestinationPath(new File(context.getFilesDir(), "optimized-bundle")) - .checkAndUnpackFile(bundleName + ".meta", "bundle.meta") - .unpackFile(bundleName, "bundle.js") - .setLoadFlags(UnpackingJSBundleLoader.UNPACKED_JS_SOURCE) - .build(); - } - public abstract void loadScript(CatalystInstanceImpl instance); public abstract String getSourceUrl(); } diff --git a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java index 0b4f7d232..19086bdb7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java +++ b/ReactAndroid/src/main/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoader.java @@ -38,18 +38,6 @@ import static com.facebook.systrace.Systrace.TRACE_TAG_REACT_JAVA_BRIDGE; */ public class UnpackingJSBundleLoader extends JSBundleLoader { - /** - * Flag passed to loadScriptFromOptimizedBundle to let the bridge know that - * the unpacker unpacked js source file. - */ - public static final int UNPACKED_JS_SOURCE = (1 << 0); - - /** - * Flag passed to loadScriptFromOptimizedBundle to let the bridge know that - * the unpacker unpacked bytecode cache files. - */ - public static final int UNPACKED_BC_CACHE = (1 << 1); - /** * Name of the lock files. Multiple processes can be spawned off the same app * and we need to guarantee that at most one unpacks files at any time. To diff --git a/ReactAndroid/src/test/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoaderTest.java b/ReactAndroid/src/test/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoaderTest.java index 371f5fd31..acbaf4808 100644 --- a/ReactAndroid/src/test/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoaderTest.java +++ b/ReactAndroid/src/test/java/com/facebook/react/cxxbridge/UnpackingJSBundleLoaderTest.java @@ -43,6 +43,7 @@ public class UnpackingJSBundleLoaderTest { private static final String URL = "http://this.is.an.url"; private static final int MOCK_UNPACKERS_NUM = 2; + private static final int UNPACKER_TEST_FLAGS = 129; @Rule public TemporaryFolder folder = new TemporaryFolder(); @@ -111,13 +112,13 @@ public class UnpackingJSBundleLoaderTest { @Test public void testSetLoadFlags() throws IOException { - mBuilder.setLoadFlags(UnpackingJSBundleLoader.UNPACKED_JS_SOURCE) + mBuilder.setLoadFlags(UNPACKER_TEST_FLAGS) .build() .loadScript(mCatalystInstanceImpl); verify(mCatalystInstanceImpl).loadScriptFromOptimizedBundle( eq(mDestinationPath.getPath()), eq(URL), - eq(UnpackingJSBundleLoader.UNPACKED_JS_SOURCE)); + eq(UNPACKER_TEST_FLAGS)); } @Test