package com.msupplymobile;

import android.app.Application;

import com.facebook.react.ReactApplication;
import com.reactnativecommunity.asyncstorage.AsyncStoragePackage;
import com.swmansion.rnscreens.RNScreensPackage;
import com.swmansion.gesturehandler.react.RNGestureHandlerPackage;
import com.learnium.RNDeviceInfo.RNDeviceInfo;
import io.realm.react.RealmReactPackage;
import com.oblador.vectoricons.VectorIconsPackage;
import com.babisoft.ReactNativeLocalization.ReactNativeLocalizationPackage;
import com.rnfs.RNFSPackage;
import com.bugsnag.BugsnagReactNative;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.facebook.soloader.SoLoader;

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

public class MainApplication extends Application implements ReactApplication {

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

    @Override
    protected List<ReactPackage> getPackages() {
      return Arrays.<ReactPackage>asList(
          new RNDeviceInfo(),
          new MainReactPackage(),
            new AsyncStoragePackage(),
            new RNScreensPackage(),
          new RNGestureHandlerPackage(),
          new RealmReactPackage(),
          new VectorIconsPackage(),
          new ReactNativeLocalizationPackage(),
          new RNFSPackage(),
          BugsnagReactNative.getPackage()
      );
    }

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

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

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

@@ -54,16 +54,361 @@
 ation;%0A%0A
+import android.app.Application;%0Aimport android.content.Context;%0Aimport com.facebook.react.PackageList;%0Aimport com.facebook.react.ReactApplication;%0Aimport com.facebook.react.ReactNativeHost;%0Aimport com.facebook.react.ReactPackage;%0Aimport com.facebook.soloader.SoLoader;%0Aimport java.lang.reflect.InvocationTargetException;%0Aimport java.util.List;%0A%0A
 import c
@@ -1105,39 +1105,16 @@
 .Arrays;
-%0Aimport java.util.List;
 %0A%0Apublic
@@ -1438,54 +1438,101 @@
     
-return Arrays.%3CReactPackage%3EasList(%0A          
+%0A      List%3CReactPackage%3E packages = new PackageList(this).getPackages();%0A      packages.add(
 new 
@@ -1545,28 +1545,38 @@
 ceInfo()
-,
+);
 %0A      
-    
+packages.add(
 new Main
@@ -1585,38 +1585,46 @@
 actPackage()
-,
+);
 %0A      
-      
+packages.add(
 new AsyncSto
@@ -1640,22 +1640,30 @@
 ge()
-,
+);
 %0A      
-      
+packages.add(
 new 
@@ -1676,36 +1676,46 @@
 ensPackage()
-,
+);
 %0A      
-    
+packages.add(
 new RNGestur
@@ -1727,36 +1727,46 @@
 lerPackage()
-,
+);
 %0A      
-    
+packages.add(
 new RealmRea
@@ -1772,36 +1772,46 @@
 actPackage()
-,
+);
 %0A      
-    
+packages.add(
 new VectorIc
@@ -1818,36 +1818,46 @@
 onsPackage()
-,%0A   
+);%0A
       
- 
+packages.add(
 new ReactNat
@@ -1880,28 +1880,38 @@
 ackage()
-,
+);
 %0A      
-    
+packages.add(
 new RNFS
@@ -1923,20 +1923,30 @@
 ge()
-,
+);
 %0A      
-    
+packages.add(
 Bugs
@@ -1972,23 +1972,16 @@
 ackage()
-%0A      
 );%0A    %7D
@@ -2286,14 +2286,923 @@
 false);%0A
+    initializeFlipper(this); // Remove this line if you don't want Flipper enabled%0A  %7D%0A%0A    /**%0A   * Loads Flipper in React Native templates.%0A   *%0A   * @param context%0A   */%0A  private static void initializeFlipper(Context context) %7B%0A    if (BuildConfig.DEBUG) %7B%0A      try %7B%0A        /*%0A         We use reflection here to pick up the class that initializes Flipper,%0A        since Flipper library is not available in release mode%0A        */%0A        Class%3C?%3E aClass = Class.forName(%22com.facebook.flipper.ReactNativeFlipper%22);%0A        aClass.getMethod(%22initializeFlipper%22, Context.class).invoke(null, context);%0A      %7D catch (ClassNotFoundException e) %7B%0A        e.printStackTrace();%0A      %7D catch (NoSuchMethodException e) %7B%0A        e.printStackTrace();%0A      %7D catch (IllegalAccessException e) %7B%0A        e.printStackTrace();%0A      %7D catch (InvocationTargetException e) %7B%0A        e.printStackTrace();%0A      %7D%0A    %7D%0A
   %7D%0A%7D%0A

Add native library changes for RN