// Path: android/app/src/main/java/com/sample/utils/LocaleUtils.java
// public class LocaleUtils {
// 
//     public static Locale getDefault() {
//         if (null == Locale.getDefault()) { return Locale.US; }
//         return Locale.getDefault();
//     }
// 
//     public static String getServerLocale(Locale locale) {
//         if (null != locale) {
//             return locale.toString().replace("_", "-");
//         } else {
//             return "";
//         }
//     }
// 
//     public static String getDefaultLocaleForServer() {
//         Locale locale = getDefault();
//         return getServerLocale(locale);
//     }
// 
// 
// }
// 
// Path: android/app/src/main/java/com/sample/utils/LocaleUtils.java
// public class LocaleUtils {
// 
//     public static Locale getDefault() {
//         if (null == Locale.getDefault()) { return Locale.US; }
//         return Locale.getDefault();
//     }
// 
//     public static String getServerLocale(Locale locale) {
//         if (null != locale) {
//             return locale.toString().replace("_", "-");
//         } else {
//             return "";
//         }
//     }
// 
//     public static String getDefaultLocaleForServer() {
//         Locale locale = getDefault();
//         return getServerLocale(locale);
//     }
// 
// 
// }


import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import com.facebook.react.bridge.*;
import com.sample.utils.LocaleUtils;
import com.sample.utils.LocaleUtils;
import javax.annotation.Nullable;
import java.util.UUID;
    private Context mApplication;
    private Activity mActivity;

    public EnvironmentManager(ReactApplicationContext reactContext) {
        super(reactContext);
        mApplication = getReactApplicationContext().getApplicationContext();
    }

    @Override
    public String getName() {
        return "EnvironmentManager";
    }

    @ReactMethod
    public void get(Callback callback) {
        WritableMap environment = Arguments.createMap();

        PackageInfo packageInfo = null;
        try {
            packageInfo = mApplication.getPackageManager().getPackageInfo(mApplication.getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        environment.putString("name", "debug");
        //environment.putString("name", BuildConfig.ENVIRONMENT);
        environment.putBoolean("simulator", Build.FINGERPRINT.startsWith("generic"));
        environment.putString("buildCode",  String.valueOf(packageInfo.versionCode));
        environment.putString("version", String.valueOf(packageInfo.versionName));
        environment.putString("uuid", getUuid());
// Path: android/app/src/main/java/com/sample/utils/LocaleUtils.java
// public class LocaleUtils {
// 
//     public static Locale getDefault() {
//         if (null == Locale.getDefault()) { return Locale.US; }
//         return Locale.getDefault();
//     }
// 
//     public static String getServerLocale(Locale locale) {
//         if (null != locale) {
//             return locale.toString().replace("_", "-");
//         } else {
//             return "";
//         }
//     }
// 
//     public static String getDefaultLocaleForServer() {
//         Locale locale = getDefault();
//         return getServerLocale(locale);
//     }
// 
// 
// }
// 
// Path: android/app/src/main/java/com/sample/utils/LocaleUtils.java
// public class LocaleUtils {
// 
//     public static Locale getDefault() {
//         if (null == Locale.getDefault()) { return Locale.US; }
//         return Locale.getDefault();
//     }
// 
//     public static String getServerLocale(Locale locale) {
//         if (null != locale) {
//             return locale.toString().replace("_", "-");
//         } else {
//             return "";
//         }
//     }
// 
//     public static String getDefaultLocaleForServer() {
//         Locale locale = getDefault();
//         return getServerLocale(locale);
//     }
// 
// 
// }


// Path: android/app/src/main/java/com/sample/EnvironmentManager.java
import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import com.facebook.react.bridge.*;
import com.sample.utils.LocaleUtils;
import com.sample.utils.LocaleUtils;
import javax.annotation.Nullable;
import java.util.UUID;

    private Context mApplication;
    private Activity mActivity;

    public EnvironmentManager(ReactApplicationContext reactContext) {
        super(reactContext);
        mApplication = getReactApplicationContext().getApplicationContext();
    }

    @Override
    public String getName() {
        return "EnvironmentManager";
    }

    @ReactMethod
    public void get(Callback callback) {
        WritableMap environment = Arguments.createMap();

        PackageInfo packageInfo = null;
        try {
            packageInfo = mApplication.getPackageManager().getPackageInfo(mApplication.getPackageName(), 0);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();
        }

        environment.putString("name", "debug");
        //environment.putString("name", BuildConfig.ENVIRONMENT);
        environment.putBoolean("simulator", Build.FINGERPRINT.startsWith("generic"));
        environment.putString("buildCode",  String.valueOf(packageInfo.versionCode));
        environment.putString("version", String.valueOf(packageInfo.versionName));
        environment.putString("uuid", getUuid());
        environment.putString("locale", LocaleUtils.getDefaultLocaleForServer());