package host.exp.exponent.experience;

import com.facebook.react.bridge.NativeModule;
import com.facebook.react.bridge.ReactApplicationContext;

import org.json.JSONObject;

import java.util.List;
import java.util.Map;

import expo.core.ModuleRegistry;
import expo.core.ModuleRegistryProvider;
import host.exp.exponent.kernel.ExperienceId;
import host.exp.exponent.utils.ScopedContext;
import versioned.host.exp.exponent.modules.universal.ExpoModuleRegistryAdapter;

public class DetachedModuleRegistryAdapter extends ExpoModuleRegistryAdapter {
  public DetachedModuleRegistryAdapter(ModuleRegistryProvider moduleRegistryProvider) {
    super(moduleRegistryProvider);
  }

  @Override
  public List<NativeModule> createNativeModules(ScopedContext scopedContext, ExperienceId experienceId, Map<String, Object> experienceProperties, JSONObject manifest, List<NativeModule> otherModules) {
    ReactApplicationContext reactApplicationContext = (ReactApplicationContext) scopedContext.getContext();

    // We only use React application context, because we're detached -- no scopes
    ModuleRegistry moduleRegistry = mModuleRegistryProvider.get(reactApplicationContext);
    return getNativeModulesFromModuleRegistry(reactApplicationContext, moduleRegistry);
  }
}

@@ -32,16 +32,103 @@
 ience;%0A%0A
+import android.content.pm.PackageManager;%0Aimport android.support.annotation.Nullable;%0A%0A
 import c
@@ -370,24 +370,125 @@
 ryProvider;%0A
+import expo.interfaces.constants.ConstantsInterface;%0Aimport expo.modules.constants.ConstantsService;%0A
 import host.
@@ -567,16 +567,87 @@
 ontext;%0A
+import versioned.host.exp.exponent.modules.universal.ConstantsBinding;%0A
 import v
@@ -986,16 +986,22 @@
 Modules(
+final 
 ScopedCo
@@ -1427,16 +1427,134 @@
 ntext);%0A
+    %0A    moduleRegistry.registerInternalModule(new ConstantsBinding(scopedContext, experienceProperties, manifest));%0A%0A
     retu

Fix constants in detach