Search in sources :

Example 1 with FileStoreImpl

use of com.google.firebase.crashlytics.internal.persistence.FileStoreImpl in project GreenHouse by utsanjan.

the class CrashlyticsCore method onPreExecute.

public boolean onPreExecute(SettingsDataProvider settingsProvider) {
    Exception e;
    boolean initializeSynchronously;
    String mappingFileId = CommonUtils.getMappingFileId(this.context);
    Logger logger = Logger.getLogger();
    logger.d("Mapping file ID is: " + mappingFileId);
    boolean requiresBuildId = CommonUtils.getBooleanResourceValue(this.context, CRASHLYTICS_REQUIRE_BUILD_ID, CRASHLYTICS_REQUIRE_BUILD_ID_DEFAULT);
    if (isBuildIdValid(mappingFileId, requiresBuildId)) {
        String googleAppId = this.app.getOptions().getApplicationId();
        try {
            Logger logger2 = Logger.getLogger();
            logger2.i("Initializing Crashlytics " + getVersion());
            FileStore fileStore = new FileStoreImpl(this.context);
            this.crashMarker = new CrashlyticsFileMarker(CRASH_MARKER_FILE_NAME, fileStore);
            this.initializationMarker = new CrashlyticsFileMarker(INITIALIZATION_MARKER_FILE_NAME, fileStore);
            HttpRequestFactory httpRequestFactory = new HttpRequestFactory();
            AppData appData = AppData.create(this.context, this.idManager, googleAppId, mappingFileId);
            UnityVersionProvider unityVersionProvider = new ResourceUnityVersionProvider(this.context);
            AnalyticsReceiver analyticsReceiver = new AnalyticsConnectorReceiver(this.analyticsConnector, new // from class: com.google.firebase.crashlytics.internal.common.CrashlyticsCore.1
            AnalyticsConnectorReceiver.BreadcrumbHandler() {

                // com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver.BreadcrumbHandler
                @Override
                public void dropBreadcrumb(String breadcrumb) {
                    CrashlyticsCore.this.log(breadcrumb);
                }
            });
            Logger logger3 = Logger.getLogger();
            logger3.d("Installer package name is: " + appData.installerPackageName);
            this.controller = new CrashlyticsController(this.context, this.backgroundWorker, httpRequestFactory, this.idManager, this.dataCollectionArbiter, fileStore, this.crashMarker, appData, null, null, this.nativeComponent, unityVersionProvider, analyticsReceiver, this.analyticsConnector, settingsProvider);
            initializeSynchronously = didPreviousInitializationFail();
            checkForPreviousCrash();
        } catch (Exception e2) {
            e = e2;
        }
        try {
            this.controller.enableExceptionHandling(Thread.getDefaultUncaughtExceptionHandler(), settingsProvider);
            if (!initializeSynchronously || !CommonUtils.canTryConnection(this.context)) {
                Logger.getLogger().d("Exception handling initialization successful");
                return CRASHLYTICS_REQUIRE_BUILD_ID_DEFAULT;
            }
            Logger.getLogger().d("Crashlytics did not finish previous background initialization. Initializing synchronously.");
            finishInitSynchronously(settingsProvider);
            return false;
        } catch (Exception e3) {
            e = e3;
            Logger.getLogger().e("Crashlytics was not started due to an exception during initialization", e);
            this.controller = null;
            return false;
        }
    } else {
        throw new IllegalStateException(MISSING_BUILD_ID_MSG);
    }
}
Also used : HttpRequestFactory(com.google.firebase.crashlytics.internal.network.HttpRequestFactory) FileStoreImpl(com.google.firebase.crashlytics.internal.persistence.FileStoreImpl) Logger(com.google.firebase.crashlytics.internal.Logger) TimeoutException(java.util.concurrent.TimeoutException) ExecutionException(java.util.concurrent.ExecutionException) ResourceUnityVersionProvider(com.google.firebase.crashlytics.internal.unity.ResourceUnityVersionProvider) UnityVersionProvider(com.google.firebase.crashlytics.internal.unity.UnityVersionProvider) FileStore(com.google.firebase.crashlytics.internal.persistence.FileStore) ResourceUnityVersionProvider(com.google.firebase.crashlytics.internal.unity.ResourceUnityVersionProvider) AnalyticsConnectorReceiver(com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver) AnalyticsReceiver(com.google.firebase.crashlytics.internal.analytics.AnalyticsReceiver)

Aggregations

Logger (com.google.firebase.crashlytics.internal.Logger)1 AnalyticsConnectorReceiver (com.google.firebase.crashlytics.internal.analytics.AnalyticsConnectorReceiver)1 AnalyticsReceiver (com.google.firebase.crashlytics.internal.analytics.AnalyticsReceiver)1 HttpRequestFactory (com.google.firebase.crashlytics.internal.network.HttpRequestFactory)1 FileStore (com.google.firebase.crashlytics.internal.persistence.FileStore)1 FileStoreImpl (com.google.firebase.crashlytics.internal.persistence.FileStoreImpl)1 ResourceUnityVersionProvider (com.google.firebase.crashlytics.internal.unity.ResourceUnityVersionProvider)1 UnityVersionProvider (com.google.firebase.crashlytics.internal.unity.UnityVersionProvider)1 ExecutionException (java.util.concurrent.ExecutionException)1 TimeoutException (java.util.concurrent.TimeoutException)1