what-the-bank/sources/com/google/firebase/crashlytics/FirebaseCrashlytics.java

139 lines
5.9 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.firebase.crashlytics;
import android.content.Context;
import com.google.android.gms.tasks.Task;
import com.google.android.gms.tasks.Tasks;
import com.google.firebase.FirebaseApp;
import com.google.firebase.analytics.connector.AnalyticsConnector;
import com.google.firebase.crashlytics.internal.CrashlyticsNativeComponent;
import com.google.firebase.crashlytics.internal.Logger;
import com.google.firebase.crashlytics.internal.MissingNativeComponent;
import com.google.firebase.crashlytics.internal.Onboarding;
import com.google.firebase.crashlytics.internal.common.CrashlyticsCore;
import com.google.firebase.crashlytics.internal.common.DataCollectionArbiter;
import com.google.firebase.crashlytics.internal.common.ExecutorUtils;
import com.google.firebase.crashlytics.internal.common.IdManager;
import com.google.firebase.crashlytics.internal.settings.SettingsController;
import com.google.firebase.iid.internal.FirebaseInstanceIdInternal;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
/* loaded from: classes.dex */
public class FirebaseCrashlytics {
private final CrashlyticsCore core;
/* JADX INFO: Access modifiers changed from: package-private */
public static FirebaseCrashlytics init(FirebaseApp firebaseApp, FirebaseInstanceIdInternal firebaseInstanceIdInternal, CrashlyticsNativeComponent crashlyticsNativeComponent, AnalyticsConnector analyticsConnector) {
Context applicationContext = firebaseApp.getApplicationContext();
IdManager idManager = new IdManager(applicationContext, applicationContext.getPackageName(), firebaseInstanceIdInternal);
DataCollectionArbiter dataCollectionArbiter = new DataCollectionArbiter(firebaseApp);
CrashlyticsNativeComponent missingNativeComponent = crashlyticsNativeComponent == null ? new MissingNativeComponent() : crashlyticsNativeComponent;
Onboarding onboarding = new Onboarding(firebaseApp, applicationContext, idManager, dataCollectionArbiter);
CrashlyticsCore crashlyticsCore = new CrashlyticsCore(firebaseApp, idManager, missingNativeComponent, dataCollectionArbiter, analyticsConnector);
if (!onboarding.onPreExecute()) {
Logger.getLogger().e("Unable to start Crashlytics.");
return null;
}
ExecutorService buildSingleThreadExecutorService = ExecutorUtils.buildSingleThreadExecutorService("com.google.firebase.crashlytics.startup");
SettingsController retrieveSettingsData = onboarding.retrieveSettingsData(applicationContext, firebaseApp, buildSingleThreadExecutorService);
Tasks.call(buildSingleThreadExecutorService, new Callable<Void>(onboarding, buildSingleThreadExecutorService, retrieveSettingsData, crashlyticsCore.onPreExecute(retrieveSettingsData), crashlyticsCore) { // from class: com.google.firebase.crashlytics.FirebaseCrashlytics.1
final CrashlyticsCore val$core;
final boolean val$finishCoreInBackground;
final Onboarding val$onboarding;
final SettingsController val$settingsController;
final ExecutorService val$threadPoolExecutor;
{
this.val$onboarding = onboarding;
this.val$threadPoolExecutor = buildSingleThreadExecutorService;
this.val$settingsController = retrieveSettingsData;
this.val$finishCoreInBackground = r4;
this.val$core = crashlyticsCore;
}
@Override // java.util.concurrent.Callable
public Void call() throws Exception {
this.val$onboarding.doOnboarding(this.val$threadPoolExecutor, this.val$settingsController);
if (!this.val$finishCoreInBackground) {
return null;
}
this.val$core.doBackgroundInitializationAsync(this.val$settingsController);
return null;
}
});
return new FirebaseCrashlytics(crashlyticsCore);
}
private FirebaseCrashlytics(CrashlyticsCore crashlyticsCore) {
this.core = crashlyticsCore;
}
public static FirebaseCrashlytics getInstance() {
FirebaseCrashlytics firebaseCrashlytics = (FirebaseCrashlytics) FirebaseApp.getInstance().get(FirebaseCrashlytics.class);
if (firebaseCrashlytics != null) {
return firebaseCrashlytics;
}
throw new NullPointerException("FirebaseCrashlytics component is not present.");
}
public void recordException(Throwable th) {
if (th == null) {
Logger.getLogger().w("Crashlytics is ignoring a request to log a null exception.");
} else {
this.core.logException(th);
}
}
public void log(String str) {
this.core.log(str);
}
public void setUserId(String str) {
this.core.setUserId(str);
}
public void setCustomKey(String str, boolean z) {
this.core.setCustomKey(str, Boolean.toString(z));
}
public void setCustomKey(String str, double d) {
this.core.setCustomKey(str, Double.toString(d));
}
public void setCustomKey(String str, float f) {
this.core.setCustomKey(str, Float.toString(f));
}
public void setCustomKey(String str, int i) {
this.core.setCustomKey(str, Integer.toString(i));
}
public void setCustomKey(String str, long j) {
this.core.setCustomKey(str, Long.toString(j));
}
public void setCustomKey(String str, String str2) {
this.core.setCustomKey(str, str2);
}
public Task<Boolean> checkForUnsentReports() {
return this.core.checkForUnsentReports();
}
public void sendUnsentReports() {
this.core.sendUnsentReports();
}
public void deleteUnsentReports() {
this.core.deleteUnsentReports();
}
public boolean didCrashOnPreviousExecution() {
return this.core.didCrashOnPreviousExecution();
}
public void setCrashlyticsCollectionEnabled(boolean z) {
this.core.setCrashlyticsCollectionEnabled(z);
}
}