package dev.expo.payments;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.swmansion.reanimated.ReanimatedPackage;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;
import dev.expo.payments.generated.BasePackageList;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.th3rdwave.safeareacontext.SafeAreaContextPackage;

import org.unimodules.adapters.react.ModuleRegistryAdapter;
import org.unimodules.adapters.react.ReactModuleRegistryProvider;
import org.unimodules.core.interfaces.SingletonModule;

import java.util.Arrays;
import java.util.List;

public class MainApplication extends Application implements ReactApplication {
  private final ReactModuleRegistryProvider mModuleRegistryProvider = new ReactModuleRegistryProvider(
    new BasePackageList().getPackageList(),
    Arrays.<SingletonModule>asList()
  );

  private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
    @Override
    public boolean getUseDeveloperSupport() {
      return BuildConfig.DEBUG;
    }

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new MainReactPackage(),
          new ReanimatedPackage(),
          new RNGestureHandlerPackage(),
          new SafeAreaContextPackage(),
          new ModuleRegistryAdapter(mModuleRegistryProvider)
      );
    }

    @Override
    protected String getJSMainModuleName() {
      return "index";
    }
  };

  @Override
  public ReactNativeHost getReactNativeHost() {
    return mReactNativeHost;
  }

  @Override
  public void onCreate() {
    super.onCreate();
    SoLoader.init(this, /* native exopackage */ false);
  }
}

@@ -102,59 +102,8 @@
 on;%0A
-import com.swmansion.reanimated.ReanimatedPackage;%0A
 impo
@@ -274,60 +274,8 @@
 er;%0A
-import dev.expo.payments.generated.BasePackageList;%0A
 impo
@@ -329,32 +329,83 @@
 HandlerPackage;%0A
+import com.swmansion.reanimated.ReanimatedPackage;%0A
 import com.th3rd
@@ -580,63 +580,33 @@
 er;%0A
+%0A
 import 
-org.unimodules.core.interfaces.SingletonModule;%0A
+java.util.Arrays;
 %0Aimp
@@ -615,39 +615,38 @@
 t java.util.
-Arrays;
+List;%0A
 %0Aimport 
 java.util.Li
@@ -629,34 +629,63 @@
 st;%0A%0Aimport 
-java.util.
+dev.expo.payments.generated.BasePackage
 List;%0A%0Apubli
@@ -861,24 +861,26 @@
 ovider(%0A    
+  
 new BasePack
@@ -915,40 +915,14 @@
     
-Arrays.%3CSingletonModule%3EasList()
+  null
 %0A  )

Enable automatic singleton modules creation (#6575)