Java Code Examples for com.google.firebase.crash.FirebaseCrash#setCrashCollectionEnabled()

The following examples show how to use com.google.firebase.crash.FirebaseCrash#setCrashCollectionEnabled() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuardaApp.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
@Override
    public void onCreate() {
        super.onCreate();
        context = this;
        context_s = this;
        appComponent = buildAppComponent();
        registerActivityLifecycleCallbacks(this);
        sharedManager = new SharedManager();

        String packageName = getApplicationContext().getPackageName();
        Log.d("flint", "GuardaApp.onCreate()... packageName: " + packageName);
        if ("com.guarda.dct".equals(packageName)) {
            // buy - это покупка, purchase - обменник
//            SharedManager.flag_disable_buy_menu = true;
//            SharedManager.flag_disable_purchase_menu = true;
            SharedManager.flag_create_new_wallet_screen = true;
        } else if ("com.guarda.etc".equals(packageName)) {
            SharedManager.flag_etc_eth_private_key_showing_fix = true;
        } else if ("com.guarda.ethereum".equals(packageName)) {
            SharedManager.flag_etc_eth_private_key_showing_fix = true;
        } else if ("com.guarda.clo".equals(packageName)) {
            SharedManager.flag_etc_eth_private_key_showing_fix = true;
        } else if ("com.guarda.bts".equals(packageName)) {
            SharedManager.flag_create_new_wallet_screen = true;
        }
        // [initially both are disabled. check and enable function is placed in CurrencyListHolder.castResponseCurrencyToCryptoItem]
        SharedManager.flag_disable_buy_menu = false; // !!! since we have 3 exchange services, make buy menu initially enabled
        //SharedManager.flag_disable_purchase_menu = true;
        SharedManager.flag_disable_purchase_menu = false; // !!! since we have two exchange services, changelly's check for exchange activity was disabled

        if ("com.guarda.clo".equals(packageName)) {
            SharedManager.flag_disable_buy_menu = true;
        }
        try {
            /////////////////
            // chinese crutch: force java lazy initialization of SecurePreferences, it's needed for old versions of android
            SecurePreferences.setValue("chinese_crutch_key", "chinese_crutch_value");
            SecurePreferences.setValue("chinese_crutch_key", "");
            // chinese crutch
            /////////////////
        } catch (Exception e) {
            Log.d("psd", "SecurePreferences doesn't support or something else - " + e.getMessage());
            e.printStackTrace();
            //for devices that are not support SecurePreferences
            sharedManager.setIsSecureStorageSupported(false);
        }
        if ("com.guarda.btc".equals(packageName) ||
                "com.guarda.bch".equals(packageName) ||
                "com.guarda.btg".equals(packageName) ||
                "com.guarda.ltc".equals(packageName) ||
                "com.guarda.sbtc".equals(packageName) ||
                "com.guarda.dgb".equals(packageName) ||
                "com.guarda.kmd".equals(packageName) ||
                "com.guarda.bts".equals(packageName) ||
                "com.guarda.qtum".equals(packageName)) {
            sharedManager.setHasWifXprvKeys(true);
        }


        ShapeshiftManager.getInstance().updateSupportedCoinsList(null);

        FreshchatConfig freshchatConfig = new FreshchatConfig(Const.FRESHCHAT_APP_ID, Const.FRESHCHAT_APP_KEY);
        freshchatConfig.setGallerySelectionEnabled(true);
        Freshchat.getInstance(getApplicationContext()).init(freshchatConfig);

        Map<String, String> userMeta = new HashMap<>();
        userMeta.put("packageName", packageName);
        userMeta.put("platform", "android");
        Freshchat.getInstance(getApplicationContext()).setUserProperties(userMeta);

        FirebaseCrash.setCrashCollectionEnabled(!BuildConfig.DEBUG);

        // Set up Crashlytics, disabled for debug builds
        Crashlytics crashlyticsKit = new Crashlytics.Builder()
                .core(new CrashlyticsCore.Builder().disabled(BuildConfig.DEBUG).build())
                .build();
        // Initialize Fabric with the debug-disabled crashlytics.
        Fabric.with(this, crashlyticsKit);
    }
 
Example 2
Source File: CompassApplication.java    From Compass with Apache License 2.0 4 votes vote down vote up
@Override
public void onCreate() {
    super.onCreate();
    FirebaseCrash.setCrashCollectionEnabled(BuildConfig.DEBUG);
}