导航菜单

页面标题

页面副标题

aeroLINE CREW v5.0.1 - ReactNativeFirebaseCrashlyticsInitProvider.java 源代码

正在查看: aeroLINE CREW v5.0.1 应用的 ReactNativeFirebaseCrashlyticsInitProvider.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package io.invertase.firebase.crashlytics;

import android.util.Log;
import com.google.firebase.crashlytics.FirebaseCrashlytics;
import io.invertase.firebase.common.ReactNativeFirebaseInitProvider;
import io.invertase.firebase.common.ReactNativeFirebaseJSON;
import io.invertase.firebase.common.ReactNativeFirebaseMeta;
import io.invertase.firebase.common.ReactNativeFirebasePreferences;

public class ReactNativeFirebaseCrashlyticsInitProvider extends ReactNativeFirebaseInitProvider {
    private static final String TAG = "RNFBCrashlyticsInit";

    static boolean isCrashlyticsCollectionEnabled() {
        boolean booleanValue;
        ReactNativeFirebaseJSON sharedInstance = ReactNativeFirebaseJSON.getSharedInstance();
        ReactNativeFirebaseMeta sharedInstance2 = ReactNativeFirebaseMeta.getSharedInstance();
        ReactNativeFirebasePreferences sharedInstance3 = ReactNativeFirebasePreferences.getSharedInstance();
        if (sharedInstance3.contains("crashlytics_auto_collection_enabled")) {
            booleanValue = sharedInstance3.getBooleanValue("crashlytics_auto_collection_enabled", true);
            Log.d(TAG, "isCrashlyticsCollectionEnabled via RNFBPreferences: " + booleanValue);
        } else if (sharedInstance.contains("crashlytics_auto_collection_enabled")) {
            booleanValue = sharedInstance.getBooleanValue("crashlytics_auto_collection_enabled", true);
            Log.d(TAG, "isCrashlyticsCollectionEnabled via RNFBJSON: " + booleanValue);
        } else {
            booleanValue = sharedInstance2.getBooleanValue("crashlytics_auto_collection_enabled", true);
            Log.d(TAG, "isCrashlyticsCollectionEnabled via RNFBMeta: " + booleanValue);
        }
        Log.d(TAG, "isCrashlyticsCollectionEnabled final value: " + booleanValue);
        return booleanValue;
    }

    static boolean isErrorGenerationOnJSCrashEnabled() {
        boolean booleanValue;
        ReactNativeFirebaseJSON sharedInstance = ReactNativeFirebaseJSON.getSharedInstance();
        ReactNativeFirebaseMeta sharedInstance2 = ReactNativeFirebaseMeta.getSharedInstance();
        ReactNativeFirebasePreferences sharedInstance3 = ReactNativeFirebasePreferences.getSharedInstance();
        if (sharedInstance3.contains("crashlytics_is_error_generation_on_js_crash_enabled")) {
            booleanValue = sharedInstance3.getBooleanValue("crashlytics_is_error_generation_on_js_crash_enabled", true);
            Log.d(TAG, "isErrorGenerationOnJSCrashEnabled via RNFBPreferences: " + booleanValue);
        } else if (sharedInstance.contains("crashlytics_is_error_generation_on_js_crash_enabled")) {
            booleanValue = sharedInstance.getBooleanValue("crashlytics_is_error_generation_on_js_crash_enabled", true);
            Log.d(TAG, "isErrorGenerationOnJSCrashEnabled via RNFBJSON: " + booleanValue);
        } else {
            booleanValue = sharedInstance2.getBooleanValue("crashlytics_is_error_generation_on_js_crash_enabled", true);
            Log.d(TAG, "isErrorGenerationOnJSCrashEnabled via RNFBMeta: " + booleanValue);
        }
        Log.d(TAG, "isErrorGenerationOnJSCrashEnabled final value: " + booleanValue);
        return booleanValue;
    }

    static boolean isCrashlyticsJavascriptExceptionHandlerChainingEnabled() {
        boolean booleanValue;
        ReactNativeFirebaseJSON sharedInstance = ReactNativeFirebaseJSON.getSharedInstance();
        ReactNativeFirebaseMeta sharedInstance2 = ReactNativeFirebaseMeta.getSharedInstance();
        ReactNativeFirebasePreferences sharedInstance3 = ReactNativeFirebasePreferences.getSharedInstance();
        if (sharedInstance3.contains("crashlytics_javascript_exception_handler_chaining_enabled")) {
            booleanValue = sharedInstance3.getBooleanValue("crashlytics_javascript_exception_handler_chaining_enabled", true);
            Log.d(TAG, "isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBPreferences: " + booleanValue);
        } else if (sharedInstance.contains("crashlytics_javascript_exception_handler_chaining_enabled")) {
            booleanValue = sharedInstance.getBooleanValue("crashlytics_javascript_exception_handler_chaining_enabled", true);
            Log.d(TAG, "isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBJSON: " + booleanValue);
        } else {
            booleanValue = sharedInstance2.getBooleanValue("crashlytics_javascript_exception_handler_chaining_enabled", true);
            Log.d(TAG, "isCrashlyticsJavascriptExceptionHandlerChainingEnabled via RNFBMeta: " + booleanValue);
        }
        Log.d(TAG, "isCrashlyticsJavascriptExceptionHandlerChainingEnabled final value: " + booleanValue);
        return booleanValue;
    }

    @Override
    public boolean onCreate() {
        super.onCreate();
        try {
            FirebaseCrashlytics.getInstance().setCrashlyticsCollectionEnabled(isCrashlyticsCollectionEnabled());
            Log.i(TAG, "initialization successful");
            return true;
        } catch (Exception e) {
            Log.e(TAG, "initialization failed", e);
            return false;
        }
    }
}