������������������.apk分析 / b.java


package com.lt.app.a;

import android.os.Build;
import android.os.Looper;
import android.os.Process;
import android.util.Log;
import android.widget.Toast;
import com.lt.app.App;
import com.xiaomi.mipush.sdk.Constants;
import java.io.StringWriter;
import java.lang.Thread;
import java.lang.reflect.Field;

/* compiled from: CrashHandler */
public class b implements Thread.UncaughtExceptionHandler {

    /* renamed from: ʻ  reason: contains not printable characters */
    private static b f6032 = new b();

    /* renamed from: ʼ  reason: contains not printable characters */
    private Thread.UncaughtExceptionHandler f6033 = null;

    /* renamed from: ʻ  reason: contains not printable characters */
    public static b m8245() {
        return f6032;
    }

    /* renamed from: ʼ  reason: contains not printable characters */
    public void m8248() {
        this.f6033 = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(f6032);
    }

    public void uncaughtException(Thread thread, Throwable th) {
        if (m8246(th)) {
            try {
                Thread.sleep(2500);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            Process.killProcess(Process.myPid());
            System.exit(1);
            return;
        }
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler = this.f6033;
        if (uncaughtExceptionHandler != null) {
            uncaughtExceptionHandler.uncaughtException(thread, th);
        }
    }

    /* renamed from: ʻ  reason: contains not printable characters */
    private boolean m8246(Throwable th) {
        if (th == null) {
            return false;
        }
        m8247(th);
        new Thread() {
            /* class com.lt.app.a.b.AnonymousClass1 */

            public void run() {
                Looper.prepare();
                Toast.makeText(App.m8130(), "APP异常退出,请联系技术员!", 1).show();
                Looper.loop();
            }
        }.start();
        return true;
    }

    /* renamed from: ʼ  reason: contains not printable characters */
    private void m8247(Throwable th) {
        StringWriter stringWriter = new StringWriter();
        try {
            App r1 = App.m8130();
            if (r1 != null) {
                stringWriter.write(r1.m8140().toString() + "\n\n");
            }
            Field[] fields = Build.class.getFields();
            if (fields.length > 0) {
                try {
                    for (Field field : fields) {
                        field.setAccessible(true);
                        stringWriter.write(field.getName() + Constants.COLON_SEPARATOR + String.valueOf(field.get(null)) + "\n");
                    }
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
            stringWriter.write("BuildDate:19046\n");
            stringWriter.write(Log.getStackTraceString(th));
            stringWriter.flush();
            n.m8377(stringWriter.toString());
            stringWriter.close();
        } catch (Exception e2) {
            e2.printStackTrace();
        }
    }
}