package defpackage;

import android.util.Log;
import java.lang.Thread;
import java.util.concurrent.atomic.AtomicBoolean;

/* JADX INFO: renamed from: ˀʒˎʿ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final class C0500 implements Thread.UncaughtExceptionHandler {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final C3420 f2623;

    /* JADX INFO: renamed from: ːˏᵟᵯ, reason: contains not printable characters */
    public final Thread.UncaughtExceptionHandler f2624;

    /* JADX INFO: renamed from: ᵨᵣ, reason: contains not printable characters */
    public final AtomicBoolean f2625 = new AtomicBoolean(false);

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final C1014 f2626;

    /* JADX INFO: renamed from: ᵷᵺʾᵖ, reason: contains not printable characters */
    public final C3597 f2627;

    public C0500(C1014 c1014, C3420 c3420, Thread.UncaughtExceptionHandler uncaughtExceptionHandler, C3597 c3597) {
        this.f2626 = c1014;
        this.f2623 = c3420;
        this.f2624 = uncaughtExceptionHandler;
        this.f2627 = c3597;
    }

    @Override // java.lang.Thread.UncaughtExceptionHandler
    public final void uncaughtException(Thread thread, Throwable th) {
        AtomicBoolean atomicBoolean = this.f2625;
        atomicBoolean.set(true);
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler = this.f2624;
        if (thread == null || th == null) {
            Log.isLoggable("FirebaseCrashlytics", 3);
        } else {
            try {
                if (this.f2627.m8127()) {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    Log.isLoggable("FirebaseCrashlytics", 3);
                } else {
                    this.f2626.m3353(this.f2623, thread, th);
                }
            } catch (Exception unused) {
                if (uncaughtExceptionHandler != null) {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    uncaughtExceptionHandler.uncaughtException(thread, th);
                } else {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    System.exit(1);
                }
                atomicBoolean.set(false);
                return;
            } catch (Throwable th2) {
                if (uncaughtExceptionHandler != null) {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    uncaughtExceptionHandler.uncaughtException(thread, th);
                } else {
                    Log.isLoggable("FirebaseCrashlytics", 3);
                    System.exit(1);
                }
                atomicBoolean.set(false);
                throw th2;
            }
        }
        if (uncaughtExceptionHandler != null) {
            Log.isLoggable("FirebaseCrashlytics", 3);
            uncaughtExceptionHandler.uncaughtException(thread, th);
        } else {
            Log.isLoggable("FirebaseCrashlytics", 3);
            System.exit(1);
        }
        atomicBoolean.set(false);
    }
}
