package d.f.a;

import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import android.widget.Toast;
import com.ifpdos.debugmenu.DebugMenuApplication;
import com.ifpdos.debugmenu.event.ActivityEvent;
import com.seewo.sdk.SDKTouchHelper;
import d.f.a.r2.h3;
import java.lang.Thread;
import java.util.Objects;

/* JADX INFO: compiled from: DebugMenuApplication.java */
/* JADX INFO: loaded from: classes.dex */
public class h0 extends d.f.a.r2.i3.d {
    public final /* synthetic */ Toast a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Thread.UncaughtExceptionHandler f2579b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ DebugMenuApplication f2580c;

    /* JADX INFO: compiled from: DebugMenuApplication.java */
    public class a implements Runnable {

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final /* synthetic */ Throwable f2581b;

        public a(Throwable th) {
            this.f2581b = th;
        }

        @Override // java.lang.Runnable
        public void run() {
            Toast toast = h0.this.a;
            StringBuilder sbB = d.b.a.a.a.B("捕获到导致崩溃的异常：");
            sbB.append(this.f2581b);
            toast.setText(sbB.toString());
            h0.this.a.show();
            d.b.a.a.a.Y(false, k.c.a.c.c());
        }
    }

    public h0(DebugMenuApplication debugMenuApplication, Toast toast, Thread.UncaughtExceptionHandler uncaughtExceptionHandler) {
        this.f2580c = debugMenuApplication;
        this.a = toast;
        this.f2579b = uncaughtExceptionHandler;
    }

    @Override // d.f.a.r2.i3.d
    public void a(Throwable th) {
        Log.e("AndroidRuntime", "onBandageExceptionHappened:", th);
        th.printStackTrace();
        Objects.requireNonNull(this.f2580c);
        h3.s(DebugMenuApplication.f1956b, th);
        this.a.setText("捕获到异常：" + th);
        this.a.show();
        d.b.a.a.a.Y(false, k.c.a.c.c());
    }

    @Override // d.f.a.r2.i3.d
    public void b(Throwable th) {
        SDKTouchHelper.I.postOsdStatus(false);
        k.c.a.c.c().g(new ActivityEvent.Finish());
        Thread thread = Looper.getMainLooper().getThread();
        Log.e("AndroidRuntime", "--->onUncaughtExceptionHappened:" + thread + "<---", th);
        Objects.requireNonNull(this.f2580c);
        h3.s(DebugMenuApplication.f1956b, th);
        this.f2579b.uncaughtException(thread, new RuntimeException("black screen"));
    }

    @Override // d.f.a.r2.i3.d
    public void c(Thread thread, Throwable th) {
        Log.e("AndroidRuntime", "--->onUncaughtExceptionHappened:" + thread + "<---", th);
        Objects.requireNonNull(this.f2580c);
        h3.s(DebugMenuApplication.f1956b, th);
        new Handler(Looper.getMainLooper()).post(new a(th));
    }
}
