小源钱包 v1.0.0版本的 MD5 值为:2fddb51fa9867693f901004082511bea

以下内容为反编译后的 e.java 源代码,内容仅作参考


package com.uc.crashsdk;

import android.app.ActivityManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.os.Build;
import android.os.ConditionVariable;
import android.os.Debug;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.os.Process;
import android.os.StatFs;
import android.os.StrictMode;
import com.alibaba.sdk.android.oss.common.OSSConstants;
import com.alicom.tools.networking.RSA;
import com.jufu.kakahua.apiloan.ui.ReservePhoneVerifyActivity;
import com.nirvana.tools.logger.cache.db.DBHelpTool;
import com.uc.crashsdk.a.h;
import com.uc.crashsdk.export.CrashStatKey;
import com.uc.crashsdk.export.LogType;
import com.zhy.http.okhttp.OkHttpUtils;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintStream;
import java.io.RandomAccessFile;
import java.lang.Thread;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Comparator;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Random;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class e implements Thread.UncaughtExceptionHandler {
    private static long f16383b;
    private static String f16389i;
    private final List<FileInputStream> f16407e = new ArrayList();
    static final boolean f16381a = true;
    private static final AtomicBoolean f16384c = new AtomicBoolean(false);
    private static boolean f16385d = false;
    private static long f16386f = 0;
    private static long f16387g = -1;
    private static boolean f16388h = true;
    private static String f16390j = "";
    private static String f16391k = null;
    private static String f16392l = null;
    private static String f16393m = null;
    private static final Object f16394n = new Object();
    private static final ConditionVariable f16395o = new ConditionVariable();
    private static final Object f16396p = new Object();
    private static final Object f16397q = new Object();
    private static final Object f16398r = new Object();
    private static final ArrayList<String> f16399s = new ArrayList<>();
    private static int f16400t = 0;
    private static String f16401u = null;
    private static boolean f16402v = false;
    private static String f16403w = null;
    private static String f16404x = null;
    private static final Object f16405y = new Object();
    private static final Object f16406z = new Object();
    private static Map<String, Integer> A = null;
    private static String B = null;
    private static int C = -1;
    private static int D = -1;
    private static int E = -1;
    private static int F = -1;
    private static int G = -1;
    private static int H = -1;
    private static int I = -1;
    private static String J = "?";
    private static boolean K = false;
    private static boolean L = false;
    private static int M = 0;
    private static int N = 0;
    private static boolean O = false;
    private static com.uc.crashsdk.a.e P = new com.uc.crashsdk.a.e(405);
    private static c Q = new c((byte) 0);
    private static boolean R = false;
    private static final com.uc.crashsdk.a.e S = new com.uc.crashsdk.a.e(412);
    private static Thread.UncaughtExceptionHandler T = null;
    private static Throwable U = null;
    private static boolean V = false;
    private static boolean W = false;
    private static Runnable X = null;
    private static final Object Y = new Object();
    private static int Z = 101;
    private static Runnable f16382aa = new com.uc.crashsdk.a.e(407);
    private static final Object ab = new Object();
    private static volatile boolean ac = false;
    private static Object ad = new Object();
    private static ParcelFileDescriptor ae = null;
    private static boolean af = false;
    private static boolean ag = false;

    public static class a extends OutputStream {
        private final long f16408a;
        private final OutputStream f16409b;
        private int f16410c = 0;
        private int f16411d = 0;
        private boolean f16412e = false;

        a(long j10, OutputStream outputStream) {
            this.f16408a = j10;
            this.f16409b = outputStream;
        }

        private int a(byte[] bArr, int i10, int i11) {
            int i12;
            this.f16411d += i11;
            if (this.f16412e) {
                return 0;
            }
            int A = g.A();
            if (A > 0) {
                int i13 = this.f16410c;
                if (i13 + i11 > A) {
                    i12 = A - i13;
                    this.f16410c += i12;
                    if (this.f16408a == 0) {
                        b(new String(bArr, i10, i12));
                    } else {
                        this.f16409b.write(bArr, i10, i12);
                    }
                    if (i12 < i11) {
                        this.f16412e = true;
                    }
                    return i12;
                }
            }
            i12 = i11;
            this.f16410c += i12;
            if (this.f16408a == 0) {
            }
            if (i12 < i11) {
            }
            return i12;
        }

        private void b(String str) {
            if (com.uc.crashsdk.b.f16349d) {
                JNIBridge.nativeClientWriteData(this.f16408a, str);
            }
        }

        final void a() {
            try {
                if (this.f16411d - this.f16410c > 0) {
                    a("\n");
                    a("--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n");
                }
                a(String.format(Locale.US, "Full: %d bytes, write: %d bytes, limit: %d bytes, reject: %d bytes.\n", Integer.valueOf(this.f16411d), Integer.valueOf(this.f16410c), Integer.valueOf(g.A()), Integer.valueOf(this.f16411d - this.f16410c)));
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
        }

        final void a(String str) {
            if (e.f16388h && e.I()) {
                com.uc.crashsdk.a.a.d("DEBUG", str);
            }
            if (this.f16408a != 0) {
                b(str);
            } else {
                this.f16409b.write(str.getBytes(RSA.CHAR_ENCODING));
            }
        }

        @Override
        public final void write(int i10) {
            if (e.f16388h && e.I()) {
                com.uc.crashsdk.a.a.d("DEBUG", String.format(Locale.US, "%c", Integer.valueOf(i10)));
            }
            if (this.f16408a != 0) {
                b(String.format(Locale.US, "%c", Integer.valueOf(i10)));
            } else {
                this.f16409b.write(i10);
            }
            this.f16410c++;
            this.f16411d++;
        }

        @Override
        public final void write(byte[] bArr) {
            if (e.f16388h && e.I() && (bArr.length != 1 || bArr[0] != 10)) {
                try {
                    com.uc.crashsdk.a.a.d("DEBUG", new String(bArr));
                } catch (Throwable unused) {
                }
            }
            a(bArr, 0, bArr.length);
        }

        @Override
        public final void write(byte[] bArr, int i10, int i11) {
            if (e.f16388h && e.I()) {
                byte[] bArr2 = new byte[i11];
                System.arraycopy(bArr, i10, bArr2, 0, i11);
                if (i11 != 1 || bArr2[0] != 10) {
                    try {
                        com.uc.crashsdk.a.a.d("DEBUG", new String(bArr2));
                    } catch (Throwable unused) {
                    }
                }
            }
            a(bArr, i10, i11);
        }
    }

    public static class b implements Comparator<File> {
        private b() {
        }

        b(byte b10) {
            this();
        }

        @Override
        public final int compare(File file, File file2) {
            File file3 = file;
            File file4 = file2;
            if (file3.lastModified() > file4.lastModified()) {
                return 1;
            }
            return file3.lastModified() < file4.lastModified() ? -1 : 0;
        }
    }

    public static class c extends BroadcastReceiver {
        private c() {
        }

        c(byte b10) {
            this();
        }

        @Override
        public final void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            if (!"android.intent.action.BATTERY_CHANGED".equals(action)) {
                if ("android.intent.action.BATTERY_LOW".equals(action) || "android.intent.action.BATTERY_OKAY".equals(action)) {
                    boolean unused = e.K = "android.intent.action.BATTERY_LOW".equals(action);
                    e.K();
                    return;
                } else if ("android.intent.action.ANR".equals(action)) {
                    try {
                        e.d(context);
                        return;
                    } catch (Throwable th) {
                        com.uc.crashsdk.a.g.a(th);
                        return;
                    }
                } else {
                    return;
                }
            }
            int unused2 = e.C = intent.getIntExtra(DBHelpTool.RecordEntry.COLUMN_NAME_LEVEL, -1);
            int unused3 = e.D = intent.getIntExtra("scale", -1);
            int unused4 = e.E = intent.getIntExtra("voltage", -1);
            int unused5 = e.F = intent.getIntExtra("health", -1);
            int unused6 = e.G = intent.getIntExtra("plugged", -1);
            int unused7 = e.H = intent.getIntExtra(ReservePhoneVerifyActivity.EXTRAS_KEY_PAGE_STATUS, -1);
            int unused8 = e.I = intent.getIntExtra("temperature", -1);
            String unused9 = e.J = intent.getStringExtra("technology");
            if (e.J() >= 2) {
                e.K();
                e.L();
            }
        }
    }

    public static class d {
        long f16413a;
        long f16414b;
        int f16415c;
        int f16416d;
        boolean f16417e;
        boolean f16418f;
        boolean f16419g;

        private d() {
            this.f16413a = 0L;
            this.f16414b = 0L;
            this.f16415c = 0;
            this.f16416d = 0;
            this.f16417e = false;
            this.f16418f = false;
            this.f16419g = false;
        }

        d(byte b10) {
            this();
        }
    }

    public e() {
        try {
            M();
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
    }

    public static void A() {
        if (g.q()) {
            com.uc.crashsdk.a.f.a(0, new com.uc.crashsdk.a.e(403), OkHttpUtils.DEFAULT_MILLISECONDS);
        }
    }

    public static void B() {
        if (ac || com.uc.crashsdk.b.L()) {
            return;
        }
        com.uc.crashsdk.a.f.a(1, new com.uc.crashsdk.a.e(408), 1000L);
    }

    public static void C() {
        com.uc.crashsdk.a.f.a(1, new com.uc.crashsdk.a.e(409), 7000L);
    }

    public static void D() {
        int N2 = g.N();
        boolean z10 = true;
        boolean z11 = false;
        if (N2 == 0 || N2 == 3 || N2 == 4) {
            int i10 = Build.VERSION.SDK_INT;
            if (i10 >= 21 && i10 <= 25) {
                boolean z12 = N2 != 0;
                if (N2 == 3) {
                    z12 = System.currentTimeMillis() % 10 == 0;
                }
                if (N2 != 4) {
                    z10 = z12;
                }
            }
        }
        if (!z10) {
            com.uc.crashsdk.a.a.a("crashsdk", "SIG 3 is disabled by settings");
        }
        boolean L2 = com.uc.crashsdk.b.L();
        if (Looper.getMainLooper() == Looper.myLooper() || !z10) {
            z11 = z10;
        } else {
            com.uc.crashsdk.a.f.a(2, new com.uc.crashsdk.a.e(413));
        }
        JNIBridge.nativeCmd(7, L2 ? 1L : 0L, null, null);
        if (z11) {
            JNIBridge.cmd(8);
        }
    }

    public static ParcelFileDescriptor E() {
        if (!com.uc.crashsdk.b.f16349d) {
            com.uc.crashsdk.a.a.d("crashsdk", "Crash so is not loaded!");
            return null;
        }
        synchronized (ad) {
            ParcelFileDescriptor parcelFileDescriptor = ae;
            if (parcelFileDescriptor != null) {
                return parcelFileDescriptor;
            }
            int cmd = (int) JNIBridge.cmd(14);
            if (cmd == -1) {
                return null;
            }
            ParcelFileDescriptor adoptFd = ParcelFileDescriptor.adoptFd(cmd);
            ae = adoptFd;
            af = true;
            return adoptFd;
        }
    }

    public static boolean F() {
        return ag;
    }

    public static void G() {
        String X2 = g.X();
        File file = new File(X2);
        if (file.exists() && file.isDirectory()) {
            File[] listFiles = file.listFiles();
            if (listFiles == null) {
                com.uc.crashsdk.a.a.b("Ucebu can not list folder: " + X2);
                return;
            }
            for (File file2 : listFiles) {
                if (file2.isFile() && file2.getName().contains("ucebu")) {
                    a(false, false);
                    return;
                }
            }
        }
    }

    static boolean I() {
        return O();
    }

    static int J() {
        int i10 = M + 1;
        M = i10;
        return i10;
    }

    static void K() {
        StringBuilder Y2;
        if (com.uc.crashsdk.b.f16349d && (Y2 = Y()) != null) {
            JNIBridge.set(125, Y2.toString());
        }
        L = true;
        Z();
    }

    static int L() {
        M = 0;
        return 0;
    }

    private void M() {
        int I2 = g.I();
        for (int i10 = 0; i10 < I2; i10++) {
            try {
                this.f16407e.add(new FileInputStream("/dev/null"));
            } catch (Exception e10) {
                com.uc.crashsdk.a.g.a(e10);
                return;
            }
        }
    }

    private void N() {
        for (FileInputStream fileInputStream : this.f16407e) {
            com.uc.crashsdk.a.g.a(fileInputStream);
        }
        this.f16407e.clear();
    }

    private static boolean O() {
        if (g.P()) {
            return true;
        }
        return a();
    }

    private static String P() {
        return g.e() + "_";
    }

    private static String Q() {
        return com.uc.crashsdk.b.B() ? "fg" : "bg";
    }

    private static byte[] R() {
        byte[] bArr = null;
        int i10 = 1024;
        while (bArr == null && i10 > 0) {
            try {
                bArr = new byte[i10];
            } catch (Throwable unused) {
                i10 /= 2;
                if (i10 < 16) {
                    break;
                }
            }
        }
        return bArr;
    }

    private static String S() {
        return (!com.uc.crashsdk.b.F() || f16385d) ? "java" : "ucebujava";
    }

    private static void T() {
        String str;
        BufferedReader bufferedReader;
        Throwable th;
        FileReader fileReader;
        String str2 = "-";
        try {
            str = Build.HARDWARE;
        } catch (Throwable th2) {
            com.uc.crashsdk.a.g.a(th2);
            str = "-";
        }
        try {
            fileReader = new FileReader(new File("/proc/cpuinfo"));
            try {
                bufferedReader = new BufferedReader(fileReader, 512);
                int i10 = 0;
                do {
                    try {
                        String readLine = bufferedReader.readLine();
                        if (readLine == null) {
                            break;
                        }
                        if (readLine.startsWith("Hardware")) {
                            str = readLine.substring(readLine.indexOf(":") + 1).trim();
                        } else if (readLine.startsWith("Processor")) {
                            str2 = readLine.substring(readLine.indexOf(":") + 1).trim();
                        }
                        i10++;
                    } catch (Throwable th3) {
                        th = th3;
                        try {
                            com.uc.crashsdk.a.g.a(th);
                            com.uc.crashsdk.a.g.a(fileReader);
                            com.uc.crashsdk.a.g.a(bufferedReader);
                            f16391k = str;
                            f16392l = str2;
                        } catch (Throwable th4) {
                            com.uc.crashsdk.a.g.a(fileReader);
                            com.uc.crashsdk.a.g.a(bufferedReader);
                            throw th4;
                        }
                    }
                } while (i10 < 2);
            } catch (Throwable th5) {
                bufferedReader = null;
                th = th5;
            }
        } catch (Throwable th6) {
            bufferedReader = null;
            th = th6;
            fileReader = null;
        }
        com.uc.crashsdk.a.g.a(fileReader);
        com.uc.crashsdk.a.g.a(bufferedReader);
        f16391k = str;
        f16392l = str2;
    }

    private static String U() {
        return g.W() + "bytes";
    }

    private static boolean V() {
        return Build.VERSION.SDK_INT < 29;
    }

    private static void W() {
        if (O || com.uc.crashsdk.b.F() || com.uc.crashsdk.b.L()) {
            return;
        }
        JNIBridge.cmd(18);
    }

    private static void X() {
        com.uc.crashsdk.a.f.a(3, new com.uc.crashsdk.a.e(414), 1000L);
    }

    private static StringBuilder Y() {
        String str;
        try {
            StringBuilder sb = new StringBuilder();
            sb.append("level: ");
            sb.append(C);
            sb.append("\n");
            sb.append("scale: ");
            sb.append(D);
            sb.append("\n");
            switch (F) {
                case 1:
                    str = " (Unknown)";
                    break;
                case 2:
                    str = " (Good)";
                    break;
                case 3:
                    str = " (Overheat)";
                    break;
                case 4:
                    str = " (Dead)";
                    break;
                case 5:
                    str = " (Over voltage)";
                    break;
                case 6:
                    str = " (Unspecified failure)";
                    break;
                case 7:
                    str = " (Cold)";
                    break;
                default:
                    str = " (?)";
                    break;
            }
            sb.append("health: ");
            sb.append(F);
            sb.append(str);
            sb.append("\n");
            int i10 = G;
            String str2 = i10 != 0 ? i10 != 1 ? i10 != 2 ? i10 != 4 ? " (?)" : " (Wireless)" : " (USB port)" : " (AC charger)" : " (None)";
            sb.append("pluged: ");
            sb.append(G);
            sb.append(str2);
            sb.append("\n");
            int i11 = H;
            String str3 = i11 != 1 ? i11 != 2 ? i11 != 3 ? i11 != 4 ? i11 != 5 ? " (?)" : " (Full)" : " (Not charging)" : " (Discharging)" : " (Charging)" : " (Unknown)";
            sb.append("status: ");
            sb.append(H);
            sb.append(str3);
            sb.append("\n");
            sb.append("voltage: ");
            sb.append(E);
            sb.append("\n");
            sb.append("temperature: ");
            sb.append(I);
            sb.append("\n");
            sb.append("technology: ");
            sb.append(J);
            sb.append("\n");
            sb.append("battery low: ");
            sb.append(K);
            sb.append("\n");
            return sb;
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return null;
        }
    }

    private static void Z() {
        if (com.uc.crashsdk.b.f16348c && L && com.uc.crashsdk.a.f16267c) {
            L = false;
            if (com.uc.crashsdk.a.f.b(P)) {
                return;
            }
            com.uc.crashsdk.a.f.a(0, P, 2000L);
        }
    }

    public static int a(OutputStream outputStream, String str, int i10) {
        int i11 = 0;
        if (str == null) {
            a(outputStream);
            return 0;
        }
        try {
            String a10 = com.uc.crashsdk.a.b.a(str);
            if (a10 == null) {
                a10 = "file: '" + str + "' not found or decode failed!";
            }
            int length = a10.length();
            if (length <= i10 + 32) {
                i10 = length;
            }
            if (i10 > 0) {
                try {
                    outputStream.write(a10.getBytes(RSA.CHAR_ENCODING), 0, i10);
                    outputStream.write("\n".getBytes(RSA.CHAR_ENCODING));
                } catch (Throwable th) {
                    th = th;
                    i11 = i10;
                    a(th, outputStream);
                    i10 = i11;
                    a(outputStream);
                    return i10;
                }
            }
            if (i10 < a10.length()) {
                outputStream.write(String.format(Locale.US, "(truncated %d bytes)\n", Integer.valueOf(a10.length() - i10)).getBytes(RSA.CHAR_ENCODING));
            }
        } catch (Throwable th2) {
            th = th2;
        }
        a(outputStream);
        return i10;
    }

    private static long a(StatFs statFs, String str, String str2) {
        try {
            if (Build.VERSION.SDK_INT >= 18) {
                Method declaredMethod = StatFs.class.getDeclaredMethod(str, new Class[0]);
                declaredMethod.setAccessible(true);
                Object invoke = declaredMethod.invoke(statFs, new Object[0]);
                if (invoke != null && (invoke instanceof Long)) {
                    return ((Long) invoke).longValue();
                }
            }
        } catch (Throwable unused) {
        }
        try {
            Method declaredMethod2 = StatFs.class.getDeclaredMethod(str2, new Class[0]);
            declaredMethod2.setAccessible(true);
            Object invoke2 = declaredMethod2.invoke(statFs, new Object[0]);
            if (invoke2 == null || !(invoke2 instanceof Integer)) {
                return 0L;
            }
            return ((Integer) invoke2).intValue();
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return 0L;
        }
    }

    private static BufferedReader a(InputStreamReader inputStreamReader) {
        BufferedReader bufferedReader = null;
        int i10 = OSSConstants.DEFAULT_BUFFER_SIZE;
        while (bufferedReader == null && i10 > 0) {
            try {
                bufferedReader = new BufferedReader(inputStreamReader, i10);
            } catch (Throwable unused) {
                i10 /= 2;
                if (i10 < 512) {
                    break;
                }
            }
        }
        return bufferedReader;
    }

    public static String a(int i10) {
        try {
            String a10 = com.uc.crashsdk.a.g.a(new File(String.format(Locale.US, "/proc/%d/cmdline", Integer.valueOf(i10))), 128, false);
            return com.uc.crashsdk.a.g.b(a10) ? l(a10) : "unknown";
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return "unknown";
        }
    }

    private static String a(File file) {
        String str;
        try {
            str = file.getCanonicalPath();
        } catch (Throwable unused) {
            str = null;
        }
        return com.uc.crashsdk.a.g.a(str) ? file.getPath() : str;
    }

    public static String a(String str) {
        int lastIndexOf;
        int indexOf;
        int i10;
        int indexOf2;
        File file;
        byte[] e10;
        if (g.x() && (lastIndexOf = str.lastIndexOf(47)) > 0 && (indexOf = str.indexOf(95, lastIndexOf)) > lastIndexOf && (indexOf2 = str.indexOf(95, (i10 = indexOf + 1))) > indexOf) {
            String d10 = com.uc.crashsdk.a.g.d("CrashSDK" + str.substring(lastIndexOf + 1, indexOf) + str.substring(i10, indexOf2));
            if (d10 == null || (e10 = com.uc.crashsdk.a.g.e((file = new File(str)))) == null || e10.length <= 0) {
                return str;
            }
            byte[] bArr = null;
            try {
                bArr = com.uc.crashsdk.a.c.b(e10, d10.substring(0, 16).getBytes());
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
            if (bArr == null) {
                return str;
            }
            String str2 = str + ".ec";
            File file2 = new File(str2 + ".tmp");
            if (com.uc.crashsdk.a.g.a(file2, bArr)) {
                if (file2.renameTo(new File(str2))) {
                    file.delete();
                    return str2;
                }
                file2.delete();
                return str;
            }
            return str;
        }
        return str;
    }

    public static String a(String str, String str2) {
        try {
            BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec(Build.VERSION.SDK_INT >= 26 ? new String[]{"ps", "-ef"} : new String[]{"ps"}).getInputStream()));
            boolean b10 = com.uc.crashsdk.a.g.b(str);
            boolean b11 = com.uc.crashsdk.a.g.b(str2);
            ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
            while (true) {
                String readLine = bufferedReader.readLine();
                if (readLine == null) {
                    return byteArrayOutputStream.toString(RSA.CHAR_ENCODING);
                }
                boolean z10 = true;
                if ((!b10 || !readLine.contains(str)) && ((!b11 || !readLine.contains(str2)) && (readLine.indexOf(47) >= 0 || readLine.indexOf(46) <= 0))) {
                    z10 = false;
                }
            }
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return "exception exists.";
        }
    }

    private static String a(Throwable th, String str, long j10, boolean z10) {
        FileOutputStream fileOutputStream;
        int i10;
        FileOutputStream fileOutputStream2;
        a aVar;
        String str2;
        int i11;
        String str3;
        HashSet hashSet;
        String a10;
        StatFs statFs;
        long a11;
        long a12;
        a aVar2 = null;
        try {
            if (!com.uc.crashsdk.b.L()) {
                try {
                    g.a();
                    a(true);
                } catch (Throwable th2) {
                    th = th2;
                    fileOutputStream = null;
                    try {
                        a(th, aVar2);
                        if (j10 != 0) {
                        }
                        com.uc.crashsdk.a.g.a(aVar2);
                        com.uc.crashsdk.a.g.a(fileOutputStream);
                        if (!ag) {
                        }
                        b(!ag ? a(m(str)) : str, "java");
                        return str;
                    } catch (Throwable th3) {
                        if (j10 != 0) {
                            b(aVar2);
                        }
                        com.uc.crashsdk.a.g.a(aVar2);
                        com.uc.crashsdk.a.g.a(fileOutputStream);
                        throw th3;
                    }
                }
            }
            i10 = (j10 > 0L ? 1 : (j10 == 0L ? 0 : -1));
            fileOutputStream2 = i10 == 0 ? new FileOutputStream(str) : null;
            try {
                aVar = new a(j10, fileOutputStream2);
                try {
                    if (com.uc.crashsdk.b.f16349d) {
                        JNIBridge.set(126, str);
                    }
                    b(aVar, str, S());
                    if (z10) {
                        aVar.flush();
                    }
                    aVar.write(("Process Name: '" + h() + "'\n").getBytes(RSA.CHAR_ENCODING));
                    aVar.write(("Thread Name: '" + Thread.currentThread().getName() + "'\n").getBytes(RSA.CHAR_ENCODING));
                    aVar.write("Back traces starts.\n".getBytes(RSA.CHAR_ENCODING));
                    Field declaredField = Throwable.class.getDeclaredField("detailMessage");
                    declaredField.setAccessible(true);
                    Object obj = declaredField.get(th);
                    if (obj != null) {
                        declaredField.set(th, ((String) obj).replaceAll("\n\t", "\n->  "));
                    }
                    String message = th.getMessage();
                    if (message != null && !message.equals(th.getLocalizedMessage())) {
                        aVar.write(("Message: " + message + "\n").getBytes(RSA.CHAR_ENCODING));
                    }
                    th.printStackTrace(new PrintStream(aVar));
                    aVar.write("Back traces ends.\n".getBytes(RSA.CHAR_ENCODING));
                    a((OutputStream) aVar);
                    aVar.flush();
                    com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n");
                    if (z10) {
                        aVar.flush();
                    }
                    aVar.write("meminfo:\n".getBytes(RSA.CHAR_ENCODING));
                    b(aVar, "/proc/meminfo", 10240);
                    String format = String.format(Locale.US, "/proc/%d/status", Integer.valueOf(Process.myPid()));
                    aVar.write("status:\n".getBytes(RSA.CHAR_ENCODING));
                    b(aVar, format, 10240);
                    aVar.write(("memory info:\n" + g()).getBytes(RSA.CHAR_ENCODING));
                    a((OutputStream) aVar);
                    f(aVar);
                    com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, (ArrayList<String>) null);
                    if (ag) {
                        f16388h = false;
                        aVar.write(s("JAVADUMPFILES").getBytes(RSA.CHAR_ENCODING));
                        f16388h = true;
                    }
                    aVar.flush();
                    b((OutputStream) aVar);
                    aVar.flush();
                    aVar.write("battery info:\n".getBytes(RSA.CHAR_ENCODING));
                    if (ag) {
                        f16388h = false;
                        aVar.write(s("BATTERYINFO").getBytes(RSA.CHAR_ENCODING));
                        f16388h = true;
                    } else {
                        StringBuilder Y2 = Y();
                        if (Y2 != null) {
                            aVar.write(Y2.toString().getBytes(RSA.CHAR_ENCODING));
                        }
                    }
                    a((OutputStream) aVar);
                    aVar.write("disk info:\n".getBytes(RSA.CHAR_ENCODING));
                }
            } catch (Throwable th4) {
                th = th4;
                fileOutputStream = fileOutputStream2;
            }
        } catch (Throwable th5) {
            th = th5;
        }
        if (ag) {
            f16388h = false;
            aVar.write(s("FSSTAT").getBytes(RSA.CHAR_ENCODING));
            f16388h = true;
        } else {
            try {
                hashSet = new HashSet();
                a10 = a(new File(com.uc.crashsdk.a.g.b()));
            } catch (Throwable th6) {
                th = th6;
                str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
                i11 = i10;
            }
            if (!com.uc.crashsdk.a.g.a(a10) && !hashSet.contains(a10) && !a10.equals("/storage/emulated")) {
                hashSet.add(a10);
                try {
                    statFs = new StatFs(a10);
                    a11 = a(statFs, "getBlockCountLong", "getBlockCount");
                    i11 = i10;
                    try {
                        a12 = a(statFs, "getBlockSizeLong", "getBlockSize");
                    } catch (Throwable th7) {
                        th = th7;
                        str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
                    }
                } catch (Throwable unused) {
                }
                if ((a11 / 1024) * a12 < 10240) {
                    str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
                    fileOutputStream = fileOutputStream2;
                    str3 = "\n";
                    a((OutputStream) aVar);
                    aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
                    if (ag) {
                    }
                    a((OutputStream) aVar);
                    c(aVar);
                    d(aVar);
                    String str4 = str2;
                    com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str4, null);
                    if (ag) {
                    }
                    aVar.flush();
                    com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str4, null);
                    if (ag) {
                    }
                    aVar.a();
                    a(aVar);
                    aVar.flush();
                    if (i11 != 0) {
                    }
                    com.uc.crashsdk.a.g.a(aVar);
                    com.uc.crashsdk.a.g.a(fileOutputStream);
                    if (!ag) {
                    }
                    b(!ag ? a(m(str)) : str, "java");
                    return str;
                }
                long a13 = a(statFs, "getAvailableBlocksLong", "getAvailableBlocks");
                try {
                    long a14 = a(statFs, "getFreeBlocksLong", "getFreeBlocks");
                    try {
                        Locale locale = Locale.US;
                        str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
                        fileOutputStream = fileOutputStream2;
                        try {
                            aVar.write(String.format(locale, "%s:\n", a10).getBytes(RSA.CHAR_ENCODING));
                            Object[] objArr = new Object[1];
                            str3 = "\n";
                            double d10 = a12;
                            try {
                                objArr[0] = Long.valueOf((long) (((a11 * 1.0d) * d10) / 1024.0d));
                                aVar.write(String.format(locale, "  total:      %d kB\n", objArr).getBytes(RSA.CHAR_ENCODING));
                                aVar.write(String.format(locale, "  available:  %d kB\n", Long.valueOf((long) (((a13 * 1.0d) * d10) / 1024.0d))).getBytes(RSA.CHAR_ENCODING));
                                aVar.write(String.format(locale, "  free:       %d kB\n", Long.valueOf((long) (((a14 * 1.0d) * d10) / 1024.0d))).getBytes(RSA.CHAR_ENCODING));
                                aVar.write(String.format(locale, "  block size: %d B\n\n", Long.valueOf(a12)).getBytes(RSA.CHAR_ENCODING));
                            } catch (Throwable th8) {
                                th = th8;
                                try {
                                    a(th, aVar);
                                } catch (Throwable th9) {
                                    th = th9;
                                    try {
                                        a(th, aVar);
                                        a((OutputStream) aVar);
                                        aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
                                        if (ag) {
                                        }
                                        a((OutputStream) aVar);
                                        c(aVar);
                                        d(aVar);
                                        String str42 = str2;
                                        com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str42, null);
                                        if (ag) {
                                        }
                                        aVar.flush();
                                        com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str42, null);
                                        if (ag) {
                                        }
                                        aVar.a();
                                        a(aVar);
                                        aVar.flush();
                                        if (i11 != 0) {
                                        }
                                        com.uc.crashsdk.a.g.a(aVar);
                                    } catch (Throwable th10) {
                                        th = th10;
                                        aVar2 = aVar;
                                        a(th, aVar2);
                                        if (j10 != 0) {
                                            b(aVar2);
                                        }
                                        com.uc.crashsdk.a.g.a(aVar2);
                                        com.uc.crashsdk.a.g.a(fileOutputStream);
                                        if (!ag) {
                                        }
                                        b(!ag ? a(m(str)) : str, "java");
                                        return str;
                                    }
                                    com.uc.crashsdk.a.g.a(fileOutputStream);
                                    if (!ag) {
                                    }
                                    b(!ag ? a(m(str)) : str, "java");
                                    return str;
                                }
                                a((OutputStream) aVar);
                                aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
                                if (ag) {
                                }
                                a((OutputStream) aVar);
                                c(aVar);
                                d(aVar);
                                String str422 = str2;
                                com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str422, null);
                                if (ag) {
                                }
                                aVar.flush();
                                com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str422, null);
                                if (ag) {
                                }
                                aVar.a();
                                a(aVar);
                                aVar.flush();
                                if (i11 != 0) {
                                }
                                com.uc.crashsdk.a.g.a(aVar);
                                com.uc.crashsdk.a.g.a(fileOutputStream);
                                if (!ag) {
                                }
                                b(!ag ? a(m(str)) : str, "java");
                                return str;
                            }
                        } catch (Throwable th11) {
                            th = th11;
                            str3 = "\n";
                            a(th, aVar);
                            a((OutputStream) aVar);
                            aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
                            if (ag) {
                            }
                            a((OutputStream) aVar);
                            c(aVar);
                            d(aVar);
                            String str4222 = str2;
                            com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str4222, null);
                            if (ag) {
                            }
                            aVar.flush();
                            com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str4222, null);
                            if (ag) {
                            }
                            aVar.a();
                            a(aVar);
                            aVar.flush();
                            if (i11 != 0) {
                            }
                            com.uc.crashsdk.a.g.a(aVar);
                            com.uc.crashsdk.a.g.a(fileOutputStream);
                            if (!ag) {
                            }
                            b(!ag ? a(m(str)) : str, "java");
                            return str;
                        }
                    } catch (Throwable th12) {
                        th = th12;
                        str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
                        fileOutputStream = fileOutputStream2;
                    }
                } catch (Throwable th13) {
                    th = th13;
                    str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
                    fileOutputStream = fileOutputStream2;
                    str3 = "\n";
                    a(th, aVar);
                    a((OutputStream) aVar);
                    aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
                    if (ag) {
                    }
                    a((OutputStream) aVar);
                    c(aVar);
                    d(aVar);
                    String str42222 = str2;
                    com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str42222, null);
                    if (ag) {
                    }
                    aVar.flush();
                    com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str42222, null);
                    if (ag) {
                    }
                    aVar.a();
                    a(aVar);
                    aVar.flush();
                    if (i11 != 0) {
                    }
                    com.uc.crashsdk.a.g.a(aVar);
                    com.uc.crashsdk.a.g.a(fileOutputStream);
                    if (!ag) {
                    }
                    b(!ag ? a(m(str)) : str, "java");
                    return str;
                }
                a((OutputStream) aVar);
                aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
                if (ag) {
                    try {
                        f16388h = false;
                        aVar.write(s("DEVICESTATUS").getBytes(RSA.CHAR_ENCODING));
                        f16388h = true;
                    } catch (Throwable th14) {
                        th = th14;
                        a(th, aVar);
                        a((OutputStream) aVar);
                        c(aVar);
                        d(aVar);
                        String str422222 = str2;
                        com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str422222, null);
                        if (ag) {
                        }
                        aVar.flush();
                        com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str422222, null);
                        if (ag) {
                        }
                        aVar.a();
                        a(aVar);
                        aVar.flush();
                        if (i11 != 0) {
                        }
                        com.uc.crashsdk.a.g.a(aVar);
                        com.uc.crashsdk.a.g.a(fileOutputStream);
                        if (!ag) {
                        }
                        b(!ag ? a(m(str)) : str, "java");
                        return str;
                    }
                } else {
                    try {
                        Locale locale2 = Locale.US;
                        aVar.write(String.format(locale2, "has root: %s\n", Boolean.valueOf(com.uc.crashsdk.a.g.e())).getBytes(RSA.CHAR_ENCODING));
                        String str5 = Build.TAGS;
                        String str6 = str5 != null ? str5 : "";
                        StringBuilder sb = new StringBuilder();
                        sb.append("build tags: ");
                        sb.append(str6);
                        if (com.uc.crashsdk.a.g.f()) {
                            sb.append(" (default root)");
                        }
                        sb.append(str3);
                        aVar.write(sb.toString().getBytes(RSA.CHAR_ENCODING));
                        String h10 = com.uc.crashsdk.a.g.h();
                        if (com.uc.crashsdk.a.g.b(h10)) {
                            aVar.write(String.format(locale2, "su binary: %s\n", h10).getBytes(RSA.CHAR_ENCODING));
                            StringBuilder sb2 = new StringBuilder();
                            sb2.append("su permission: ");
                            sb2.append(com.uc.crashsdk.a.g.g() ? "valid (" : "invalid (");
                            sb2.append(com.uc.crashsdk.a.g.i());
                            sb2.append(")\n");
                            aVar.write(sb2.toString().getBytes(RSA.CHAR_ENCODING));
                        }
                    } catch (Throwable th15) {
                        th = th15;
                        a(th, aVar);
                        a((OutputStream) aVar);
                        c(aVar);
                        d(aVar);
                        String str4222222 = str2;
                        com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str4222222, null);
                        if (ag) {
                        }
                        aVar.flush();
                        com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str4222222, null);
                        if (ag) {
                        }
                        aVar.a();
                        a(aVar);
                        aVar.flush();
                        if (i11 != 0) {
                        }
                        com.uc.crashsdk.a.g.a(aVar);
                        com.uc.crashsdk.a.g.a(fileOutputStream);
                        if (!ag) {
                        }
                        b(!ag ? a(m(str)) : str, "java");
                        return str;
                    }
                }
                a((OutputStream) aVar);
                c(aVar);
                d(aVar);
                String str42222222 = str2;
                com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str42222222, null);
                if (ag) {
                    f16388h = false;
                    aVar.write(s("JAVACACHEDINFOS").getBytes(RSA.CHAR_ENCODING));
                    f16388h = true;
                }
                aVar.flush();
                com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str42222222, null);
                if (ag) {
                    f16388h = false;
                    aVar.write(s("JAVACALLBACKINFOS").getBytes(RSA.CHAR_ENCODING));
                    f16388h = true;
                }
                aVar.a();
                a(aVar);
                aVar.flush();
                if (i11 != 0) {
                    b(aVar);
                }
                com.uc.crashsdk.a.g.a(aVar);
                com.uc.crashsdk.a.g.a(fileOutputStream);
                if (!ag) {
                    r(str);
                }
                b(!ag ? a(m(str)) : str, "java");
                return str;
            }
        }
        str2 = "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n";
        i11 = i10;
        fileOutputStream = fileOutputStream2;
        str3 = "\n";
        a((OutputStream) aVar);
        aVar.write("device status:\n".getBytes(RSA.CHAR_ENCODING));
        if (ag) {
        }
        a((OutputStream) aVar);
        c(aVar);
        d(aVar);
        String str422222222 = str2;
        com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, str422222222, null);
        if (ag) {
        }
        aVar.flush();
        com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, str422222222, null);
        if (ag) {
        }
        aVar.a();
        a(aVar);
        aVar.flush();
        if (i11 != 0) {
        }
        com.uc.crashsdk.a.g.a(aVar);
        com.uc.crashsdk.a.g.a(fileOutputStream);
        if (!ag) {
        }
        b(!ag ? a(m(str)) : str, "java");
        return str;
    }

    private static String a(Date date) {
        return String.format(Locale.US, "%d%02d%02d%02d%02d%02d", Integer.valueOf(date.getYear() + 1900), Integer.valueOf(date.getMonth() + 1), Integer.valueOf(date.getDate()), Integer.valueOf(date.getHours()), Integer.valueOf(date.getMinutes()), Integer.valueOf(date.getSeconds()));
    }

    public static StringBuilder a(StackTraceElement[] stackTraceElementArr, String str) {
        StringBuilder sb = new StringBuilder();
        int i10 = 0;
        if (stackTraceElementArr != null && stackTraceElementArr.length > 0) {
            boolean z10 = str == null;
            int i11 = 0;
            for (StackTraceElement stackTraceElement : stackTraceElementArr) {
                i11++;
                sb.append("  at ");
                sb.append(stackTraceElement.toString());
                sb.append("\n");
                if (!z10 && stackTraceElement.getMethodName().contains(str)) {
                    sb.delete(0, sb.length());
                    z10 = true;
                    i11 = 0;
                }
            }
            i10 = i11;
        }
        if (i10 == 0) {
            sb.append("  (no java stack)\n");
        }
        return sb;
    }

    public static void a(int i10, Object[] objArr) {
        int i11;
        switch (i10) {
            case 401:
                JNIBridge.nativeCmd(10, com.uc.crashsdk.b.I() == 5 ? 1L : 0L, null, null);
                com.uc.crashsdk.a.f16267c = true;
                com.uc.crashsdk.a.a(false);
                L = true;
                Z();
                y();
                return;
            case 402:
                Object obj = Y;
                synchronized (obj) {
                    if (X == null) {
                        return;
                    }
                    W = true;
                    if (com.uc.crashsdk.b.q()) {
                        return;
                    }
                    if (!com.uc.crashsdk.a.d.e()) {
                        com.uc.crashsdk.a.a.c("DEBUG", com.uc.crashsdk.a.d.b());
                        return;
                    } else if (!d("unexp")) {
                        com.uc.crashsdk.a.a.d("DEBUG", "unexp sample miss");
                        return;
                    } else {
                        int nativeGenerateUnexpLog = JNIBridge.nativeGenerateUnexpLog(g.o(), g.p());
                        if (nativeGenerateUnexpLog != 0) {
                            f.a(11);
                            if ((nativeGenerateUnexpLog & 4352) != 0) {
                                Z = 105;
                                i11 = 30;
                            } else if ((nativeGenerateUnexpLog & LogType.UNEXP_EXIT) != 0) {
                                Z = 104;
                                i11 = 31;
                            } else if ((nativeGenerateUnexpLog & LogType.UNEXP_RESTART) != 0) {
                                Z = 106;
                                i11 = 32;
                            } else {
                                if ((nativeGenerateUnexpLog & LogType.UNEXP_ANR) != 0) {
                                    Z = 103;
                                    f.a(10);
                                } else if ((nativeGenerateUnexpLog & LogType.UNEXP_LOW_MEMORY) != 0) {
                                    Z = 107;
                                    f.a(29);
                                } else {
                                    Z = 102;
                                }
                                a(true);
                            }
                            f.a(i11);
                            a(true);
                        }
                        synchronized (obj) {
                            X = null;
                        }
                        return;
                    }
                }
            case 403:
                ab();
                return;
            case 404:
            default:
                if (!f16381a) {
                    throw new AssertionError();
                }
                return;
            case 405:
                L = false;
                StringBuilder Y2 = Y();
                String g10 = com.uc.crashsdk.b.g();
                if (Y2 != null) {
                    com.uc.crashsdk.a.g.a(new File(g10), Y2.toString());
                    return;
                }
                return;
            case 406:
                if (!f16381a && objArr == null) {
                    throw new AssertionError();
                }
                a((String) objArr[0], ((Boolean) objArr[1]).booleanValue(), ((Boolean) objArr[2]).booleanValue());
                return;
            case 407:
                try {
                    com.uc.crashsdk.a.d();
                    return;
                } catch (Throwable th) {
                    com.uc.crashsdk.a.g.a(th);
                    return;
                }
            case 408:
                synchronized (ab) {
                    if (!ac && g.Q() && com.uc.crashsdk.b.z()) {
                        com.uc.crashsdk.b.s();
                        h.f();
                        f.c();
                        if (com.uc.crashsdk.b.F()) {
                            C();
                        }
                        if (g.Q()) {
                            a(Calendar.getInstance());
                        }
                        ac = true;
                        return;
                    }
                    return;
                }
            case 409:
                d(false);
                return;
            case 410:
                a(false, true);
                return;
            case 411:
                if (com.uc.crashsdk.b.f16349d) {
                    JNIBridge.set(28, d("jni"));
                    JNIBridge.set(29, d("anr"));
                    return;
                }
                return;
            case 412:
                if (!R && com.uc.crashsdk.b.B() && g.M()) {
                    b(com.uc.crashsdk.a.g.a());
                    return;
                } else if (R) {
                    if (com.uc.crashsdk.b.B() && g.M()) {
                        return;
                    }
                    try {
                        com.uc.crashsdk.a.g.a().unregisterReceiver(Q);
                        R = false;
                        return;
                    } catch (Throwable th2) {
                        com.uc.crashsdk.a.g.a(th2);
                        return;
                    }
                } else {
                    return;
                }
            case 413:
                JNIBridge.cmd(8);
                return;
            case 414:
                try {
                    if (d(com.uc.crashsdk.a.g.a())) {
                        return;
                    }
                    int i12 = N + 1;
                    N = i12;
                    if (i12 < 10) {
                        X();
                        return;
                    } else if (com.uc.crashsdk.b.f16349d) {
                        JNIBridge.set(130, "(get failed)");
                        return;
                    } else {
                        return;
                    }
                } catch (Throwable th3) {
                    com.uc.crashsdk.a.g.a(th3);
                    return;
                }
            case 415:
                if (!f16381a && objArr == null) {
                    throw new AssertionError();
                }
                long longValue = ((Long) objArr[0]).longValue();
                Calendar calendar = Calendar.getInstance();
                if (calendar.getTimeInMillis() >= longValue) {
                    h.g();
                    f.a(100);
                    d(true);
                    f.a(true);
                    h.b();
                } else {
                    h.h();
                    h.i();
                    h.c();
                }
                a(calendar);
                break;
            case 416:
                break;
        }
        W();
    }

    public static void a(Context context) {
        try {
            if (V()) {
                context.registerReceiver(new c((byte) 0), new IntentFilter("android.intent.action.ANR"), null, com.uc.crashsdk.a.f.a(3));
            }
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
    }

    private static void a(a aVar) {
        try {
            aVar.a(String.format(Locale.US, "log end: %s\n", n()));
        } catch (Throwable th) {
            a(th, aVar);
        }
    }

    private static void a(a aVar, String str, long j10) {
        String nativeDumpThreads;
        String str2 = null;
        if (com.uc.crashsdk.b.f16349d) {
            try {
                aVar.flush();
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
            nativeDumpThreads = JNIBridge.nativeDumpThreads(str, j10);
            if (ag || nativeDumpThreads == null || nativeDumpThreads.length() >= 512 || !nativeDumpThreads.startsWith("/") || nativeDumpThreads.indexOf(10) >= 0) {
                str2 = nativeDumpThreads;
            } else {
                if (!new File(nativeDumpThreads).exists()) {
                    str2 = "Can not found " + nativeDumpThreads;
                }
                String str3 = str2;
                str2 = nativeDumpThreads;
                nativeDumpThreads = str3;
            }
        } else {
            nativeDumpThreads = "Native not initialized, skip dump!";
        }
        if (nativeDumpThreads != null) {
            try {
                aVar.write(nativeDumpThreads.getBytes(RSA.CHAR_ENCODING));
                aVar.write("\n".getBytes(RSA.CHAR_ENCODING));
            } catch (Throwable th2) {
                com.uc.crashsdk.a.g.a(th2);
            }
            a((OutputStream) aVar);
        } else if (str2 != null && !ag) {
            b(aVar, str2, (int) LogType.ANR);
            File file = new File(str2);
            if (file.exists()) {
                file.delete();
            }
        }
        try {
            aVar.flush();
        } catch (Throwable th3) {
            com.uc.crashsdk.a.g.a(th3);
        }
    }

    private static void a(OutputStream outputStream) {
        try {
            outputStream.write("--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n".getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th) {
            a(th, outputStream);
        }
    }

    public static void a(OutputStream outputStream, String str, String str2) {
        f16388h = false;
        try {
            outputStream.write(String.format(Locale.US, "$^%s`%s^$", str, str2).getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
        f16388h = true;
    }

    public static void a(OutputStream outputStream, String str, String str2, int i10, boolean z10, boolean z11) {
        f16388h = false;
        try {
            Locale locale = Locale.US;
            Object[] objArr = new Object[5];
            objArr[0] = str;
            objArr[1] = str2;
            objArr[2] = Integer.valueOf(i10);
            objArr[3] = Integer.valueOf(z10 ? 1 : 0);
            objArr[4] = Integer.valueOf(z11 ? 1 : 0);
            outputStream.write(String.format(locale, "$^%s`%s`%d`%d,%d^$", objArr).getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
        f16388h = true;
        a(outputStream);
    }

    private static void a(String str, boolean z10, boolean z11) {
        String str2;
        String str3;
        int i10;
        boolean z12;
        boolean z13;
        int i11;
        String path;
        String b10;
        File a10;
        int i12;
        String str4;
        String str5;
        int i13;
        File file;
        boolean z14;
        com.uc.crashsdk.a.a.a("crashsdk", "crashsdk uploading logs");
        synchronized (f16394n) {
            try {
                if (com.uc.crashsdk.a.g.b(str)) {
                    String X2 = g.X();
                    File file2 = new File(X2);
                    if (file2.exists()) {
                        File[] listFiles = file2.listFiles();
                        if (listFiles == null) {
                            com.uc.crashsdk.a.a.b("List folder failed: " + X2);
                        } else {
                            int length = listFiles.length;
                            int i14 = 0;
                            int i15 = 0;
                            int i16 = 0;
                            int i17 = 0;
                            int i18 = 0;
                            int i19 = 0;
                            int i20 = 0;
                            int i21 = 0;
                            int i22 = 0;
                            boolean z15 = false;
                            boolean z16 = false;
                            boolean z17 = false;
                            while (true) {
                                if (i14 >= length) {
                                    i10 = i17;
                                    z12 = z15;
                                    z13 = z16;
                                    break;
                                }
                                File file3 = listFiles[i14];
                                File[] fileArr = listFiles;
                                if (file3.isFile()) {
                                    String name = file3.getName();
                                    if (!name.endsWith(".tmp")) {
                                        i11 = length;
                                        z12 = z15;
                                        z13 = z16;
                                        if (file3.length() == 0) {
                                            i15++;
                                            com.uc.crashsdk.a.g.a(file3);
                                        } else {
                                            if (z10) {
                                                long currentTimeMillis = (System.currentTimeMillis() - file3.lastModified()) / 1000;
                                                if (currentTimeMillis < 0 || (currentTimeMillis >= 2 && (currentTimeMillis >= 5 || !file3.getName().endsWith(".log")))) {
                                                    z14 = true;
                                                    com.uc.crashsdk.a.a.a(String.format(Locale.US, "file: %s, modify interval: %d s, safe upload: %s", file3.getName(), Long.valueOf(currentTimeMillis), Boolean.valueOf(z14)));
                                                    if (!z14) {
                                                        i17++;
                                                    }
                                                }
                                                z14 = false;
                                                com.uc.crashsdk.a.a.a(String.format(Locale.US, "file: %s, modify interval: %d s, safe upload: %s", file3.getName(), Long.valueOf(currentTimeMillis), Boolean.valueOf(z14)));
                                                if (!z14) {
                                                }
                                            }
                                            try {
                                            } catch (Throwable th) {
                                                th = th;
                                                i10 = i17;
                                            }
                                            if (g.k()) {
                                                Matcher matcher = Pattern.compile("([^_]+)_([^_]+)_([^_]+)\\.crashsdk").matcher(file3.getName());
                                                if (matcher.matches()) {
                                                    i10 = i17;
                                                    try {
                                                        file = new File(g.X() + String.format(Locale.US, "%s%s_%s_%s.%s", j(matcher.group(2)), n(), Q(), matcher.group(1), matcher.group(3)));
                                                        com.uc.crashsdk.a.a.a("crashsdk", "File " + file3.getPath() + " matches, rename to " + file.getPath());
                                                        file3.renameTo(file);
                                                        if (file != file3) {
                                                            i21++;
                                                        }
                                                        file3 = file;
                                                    } catch (Throwable th2) {
                                                        th = th2;
                                                        com.uc.crashsdk.a.g.a(th);
                                                        path = file3.getPath();
                                                        boolean[] n6 = n(path);
                                                        b10 = b(path, n6[0], n6[1]);
                                                        if (path != b10) {
                                                        }
                                                        a10 = com.uc.crashsdk.d.a(file3);
                                                        if (a10 == null) {
                                                        }
                                                        if (a10 == null) {
                                                        }
                                                        z16 = z13;
                                                        i14++;
                                                        listFiles = fileArr;
                                                        length = i11;
                                                        z15 = z12;
                                                        i17 = i10;
                                                    }
                                                    path = file3.getPath();
                                                    boolean[] n62 = n(path);
                                                    b10 = b(path, n62[0], n62[1]);
                                                    if (path != b10) {
                                                        if (n62[0]) {
                                                            i20++;
                                                        }
                                                        if (n62[1]) {
                                                            i18++;
                                                        }
                                                        file3 = new File(b10);
                                                    }
                                                    a10 = com.uc.crashsdk.d.a(file3);
                                                    if (a10 == null) {
                                                        a10 = null;
                                                    } else if (file3 != a10 && !file3.getName().equals(a10.getName()) && file3.exists()) {
                                                        file3.delete();
                                                    }
                                                    if (a10 == null) {
                                                        com.uc.crashsdk.a.a.b("onBeforeUploadLog return null, skip upload: " + file3.getAbsolutePath());
                                                    } else {
                                                        int B2 = g.B();
                                                        if (B2 <= 0 || a10.length() < B2) {
                                                            d dVar = new d((byte) 0);
                                                            dVar.f16414b = 0L;
                                                            dVar.f16413a = System.currentTimeMillis();
                                                            String U2 = U();
                                                            if (new File(U2).exists()) {
                                                                a(U2, new com.uc.crashsdk.a.e(451, new Object[]{U2, dVar}));
                                                            }
                                                            long C2 = g.C();
                                                            int D2 = g.D();
                                                            int E2 = g.E();
                                                            if (C2 >= 0) {
                                                                i12 = i18;
                                                                if (dVar.f16414b + a10.length() > C2) {
                                                                    dVar.f16417e = true;
                                                                    str4 = "Reach max upload bytes: " + C2;
                                                                    com.uc.crashsdk.a.a.b(str4);
                                                                    if (!dVar.f16417e) {
                                                                        i18 = i12;
                                                                        z16 = z13;
                                                                        z12 = true;
                                                                    } else if (dVar.f16419g) {
                                                                        i18 = i12;
                                                                        z16 = true;
                                                                    } else if (dVar.f16418f) {
                                                                        i18 = i12;
                                                                        z16 = z13;
                                                                        z17 = true;
                                                                    } else {
                                                                        String name2 = a10.getName();
                                                                        if (name2.startsWith(P())) {
                                                                            String[] split = name2.split("_", 10);
                                                                            if (split.length == 9) {
                                                                                str5 = split[1];
                                                                                boolean z18 = str5 == null && str5.equals(g.T());
                                                                                if (com.uc.crashsdk.a.c.a(a10, a10.getName(), str)) {
                                                                                    i22++;
                                                                                    if (z18) {
                                                                                        f.a(14);
                                                                                    }
                                                                                    i13 = 3;
                                                                                } else {
                                                                                    com.uc.crashsdk.a.a.a("crashsdk", "Uploaded log: " + a10.getName(), null);
                                                                                    if (z18) {
                                                                                        f.a(13);
                                                                                    }
                                                                                    dVar.f16414b += a10.length();
                                                                                    if (b(a10)) {
                                                                                        dVar.f16415c++;
                                                                                    } else {
                                                                                        dVar.f16416d++;
                                                                                    }
                                                                                    String U3 = U();
                                                                                    a(U3, new com.uc.crashsdk.a.e(452, new Object[]{U3, dVar}));
                                                                                    a10.delete();
                                                                                    i13 = 3;
                                                                                    i22 = 0;
                                                                                }
                                                                                if (i22 < i13) {
                                                                                    com.uc.crashsdk.a.a.a("crashsdk", "Upload failed 3 times continuously, abort upload!", null);
                                                                                    i18 = i12;
                                                                                    break;
                                                                                }
                                                                                i18 = i12;
                                                                                z16 = z13;
                                                                            }
                                                                        }
                                                                        str5 = null;
                                                                        if (str5 == null) {
                                                                        }
                                                                        if (com.uc.crashsdk.a.c.a(a10, a10.getName(), str)) {
                                                                        }
                                                                        if (i22 < i13) {
                                                                        }
                                                                    }
                                                                    i14++;
                                                                    listFiles = fileArr;
                                                                    length = i11;
                                                                    z15 = z12;
                                                                    i17 = i10;
                                                                }
                                                            } else {
                                                                i12 = i18;
                                                            }
                                                            if (!g.f()) {
                                                                if (b(a10)) {
                                                                    if (D2 >= 0 && dVar.f16415c >= D2) {
                                                                        dVar.f16419g = true;
                                                                        str4 = "Reach max upload builtin log count: " + D2;
                                                                        com.uc.crashsdk.a.a.b(str4);
                                                                    }
                                                                } else if (E2 >= 0 && dVar.f16416d >= E2) {
                                                                    dVar.f16418f = true;
                                                                    str4 = "Reach max upload custom log count: " + E2;
                                                                    com.uc.crashsdk.a.a.b(str4);
                                                                }
                                                            }
                                                            if (!dVar.f16417e) {
                                                            }
                                                            i14++;
                                                            listFiles = fileArr;
                                                            length = i11;
                                                            z15 = z12;
                                                            i17 = i10;
                                                        } else {
                                                            i19++;
                                                            com.uc.crashsdk.a.g.a(a10);
                                                        }
                                                    }
                                                    z16 = z13;
                                                    i14++;
                                                    listFiles = fileArr;
                                                    length = i11;
                                                    z15 = z12;
                                                    i17 = i10;
                                                }
                                            }
                                            i10 = i17;
                                            file = file3;
                                            if (file != file3) {
                                            }
                                            file3 = file;
                                            path = file3.getPath();
                                            boolean[] n622 = n(path);
                                            b10 = b(path, n622[0], n622[1]);
                                            if (path != b10) {
                                            }
                                            a10 = com.uc.crashsdk.d.a(file3);
                                            if (a10 == null) {
                                            }
                                            if (a10 == null) {
                                            }
                                            z16 = z13;
                                            i14++;
                                            listFiles = fileArr;
                                            length = i11;
                                            z15 = z12;
                                            i17 = i10;
                                        }
                                        i10 = i17;
                                        z16 = z13;
                                        i14++;
                                        listFiles = fileArr;
                                        length = i11;
                                        z15 = z12;
                                        i17 = i10;
                                    } else if ((System.currentTimeMillis() - file3.lastModified()) / 1000 > 30) {
                                        i11 = length;
                                        com.uc.crashsdk.a.a.b("delete legacy tmp file: " + name);
                                        i16++;
                                        com.uc.crashsdk.a.g.a(file3);
                                        i10 = i17;
                                        z12 = z15;
                                        i14++;
                                        listFiles = fileArr;
                                        length = i11;
                                        z15 = z12;
                                        i17 = i10;
                                    }
                                } else {
                                    com.uc.crashsdk.a.g.a(file3);
                                }
                                i11 = length;
                                i10 = i17;
                                z12 = z15;
                                i14++;
                                listFiles = fileArr;
                                length = i11;
                                z15 = z12;
                                i17 = i10;
                            }
                            if (i16 > 0) {
                                f.a(200, i16);
                            }
                            if (i15 > 0) {
                                f.a(15, i15);
                            }
                            if (i19 > 0) {
                                f.a(17, i19);
                            }
                            if (z12) {
                                f.a(19);
                            }
                            if (z13) {
                                f.a(20);
                            }
                            if (z17) {
                                f.a(21);
                            }
                            if (z12 || z13 || z17) {
                                f.a(18);
                            }
                            if (i20 > 0) {
                                f.a(24, i20);
                            }
                            if (i18 > 0) {
                                f.a((int) CrashStatKey.LOG_UPLOAD_ENCRYPT_COUNT, i18);
                            }
                            if (i21 > 0) {
                                f.a(25, i21);
                            }
                            if (i10 > 0) {
                                f.a(26, i10);
                            }
                        }
                        if (z11) {
                            f16395o.open();
                        }
                    } else {
                        str2 = "Folder not exist: " + X2;
                        str3 = "crashsdk";
                    }
                } else {
                    str2 = "upload url is empty!";
                    str3 = "crashsdk";
                }
                com.uc.crashsdk.a.a.a(str3, str2);
                if (z11) {
                }
            } catch (Throwable th3) {
                throw th3;
            }
        }
    }

    private static void a(Throwable th) {
        try {
            com.uc.crashsdk.a.a.d("DEBUG", a(th.getStackTrace(), (String) null).toString());
        } catch (Throwable unused) {
        }
    }

    public static void a(Throwable th, OutputStream outputStream) {
        if (outputStream != null) {
            try {
                outputStream.write("[DEBUG] CrashHandler occurred new exception:\n".getBytes(RSA.CHAR_ENCODING));
                th.printStackTrace(new PrintStream(outputStream));
                outputStream.write("\n\n".getBytes(RSA.CHAR_ENCODING));
            } catch (Throwable th2) {
                com.uc.crashsdk.a.g.a(th2);
            }
        }
        com.uc.crashsdk.a.g.a(th);
    }

    private static void a(Calendar calendar) {
        if (g.S()) {
            long timeInMillis = calendar.getTimeInMillis();
            calendar.add(5, 1);
            calendar.set(11, 0);
            calendar.set(12, 0);
            calendar.set(13, 0);
            long timeInMillis2 = calendar.getTimeInMillis();
            long j10 = timeInMillis2 - timeInMillis;
            com.uc.crashsdk.a.f.a(0, new com.uc.crashsdk.a.e(415, new Object[]{Long.valueOf(timeInMillis2)}), j10 <= 3600000 ? 1000 + j10 : 3600000L);
        }
    }

    public static void a(boolean z10) {
        File[] listFiles;
        try {
            if (com.uc.crashsdk.b.y() && (listFiles = new File(g.X()).listFiles()) != null) {
                int l6 = g.l();
                int m6 = g.m();
                if (listFiles.length < Math.min(l6, m6)) {
                    return;
                }
                int i10 = 0;
                int i11 = 0;
                for (File file : listFiles) {
                    if (b(file)) {
                        i10++;
                    } else {
                        i11++;
                    }
                }
                int i12 = (!z10 || i10 < l6) ? 0 : (i10 - l6) + 1;
                int i13 = (z10 || i11 < m6) ? 0 : (i11 - m6) + 1;
                if (i12 == 0 && i13 == 0) {
                    return;
                }
                Arrays.sort(listFiles, new b((byte) 0));
                int i14 = i12;
                int i15 = i13;
                for (File file2 : listFiles) {
                    boolean b10 = b(file2);
                    if (b10 && i14 > 0) {
                        com.uc.crashsdk.a.a.a("crashsdk", "Delete oldest crash log: " + file2.getPath());
                        file2.delete();
                        i14 += -1;
                    } else if (!b10 && i15 > 0) {
                        com.uc.crashsdk.a.a.a("crashsdk", "Delete oldest custom log: " + file2.getPath());
                        file2.delete();
                        i15 += -1;
                    }
                    if (i14 == 0 && i15 == 0) {
                        break;
                    }
                }
                f.a(16, i12 + i13);
                if (i12 > 0) {
                    f.a(22, i12);
                }
                if (i13 > 0) {
                    f.a(23, i13);
                }
            }
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
    }

    public static boolean a() {
        if (f16386f == 0) {
            f16386f = 2L;
            if (h(com.uc.crashsdk.b.b("logs")) == 1) {
                f16386f = 1L;
            }
        }
        return f16386f == 1;
    }

    public static boolean a(ParcelFileDescriptor parcelFileDescriptor) {
        String str;
        if (af) {
            str = "Can not call setHostFd and getHostFd in the same process!";
        } else if (com.uc.crashsdk.b.f16349d) {
            if (ae != null) {
                com.uc.crashsdk.a.a.c("crashsdk", "Has already set host fd!");
            }
            ae = parcelFileDescriptor;
            int fd = parcelFileDescriptor.getFd();
            int nativeCmd = (int) JNIBridge.nativeCmd(13, fd, null, null);
            ag = nativeCmd != -1;
            return fd == -1 || nativeCmd != -1;
        } else {
            str = "Crash so is not loaded!";
        }
        com.uc.crashsdk.a.a.d("crashsdk", str);
        return false;
    }

    private static boolean a(String str, long j10, StringBuffer stringBuffer, String str2, long j11, ArrayList<String> arrayList, ArrayList<String> arrayList2, ArrayList<String> arrayList3, String str3) {
        FileOutputStream fileOutputStream;
        a aVar;
        int i10 = (j10 > 0L ? 1 : (j10 == 0L ? 0 : -1));
        if (i10 == 0) {
            try {
                fileOutputStream = new FileOutputStream(str);
            } catch (Throwable th) {
                th = th;
                fileOutputStream = null;
                aVar = null;
                com.uc.crashsdk.a.g.a(th);
                if (aVar == null) {
                }
            }
        } else {
            fileOutputStream = null;
        }
        try {
            aVar = new a(j10, fileOutputStream);
            try {
                synchronized (f16399s) {
                    f16401u = str;
                    if (com.uc.crashsdk.b.f16349d) {
                        JNIBridge.set(126, f16401u);
                    }
                }
            } catch (Throwable th2) {
                th = th2;
                com.uc.crashsdk.a.g.a(th);
                if (aVar == null) {
                }
            }
        } catch (Throwable th3) {
            th = th3;
            aVar = null;
        }
        if (aVar == null) {
            return false;
        }
        if ((j11 & 1) != 0) {
            try {
                b(aVar, str, str2);
            } catch (Throwable th4) {
                try {
                    a(th4, aVar);
                } finally {
                    com.uc.crashsdk.a.g.a(aVar);
                    com.uc.crashsdk.a.g.a(fileOutputStream);
                }
            }
        }
        aVar.write(stringBuffer.toString().getBytes());
        aVar.write("\n".getBytes(RSA.CHAR_ENCODING));
        aVar.flush();
        a((OutputStream) aVar);
        if ((j11 & 4) != 0) {
            b((OutputStream) aVar);
            aVar.flush();
        }
        if (arrayList != null && arrayList.size() > 0) {
            com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, arrayList);
        }
        if (arrayList2 != null && arrayList2.size() > 0) {
            com.uc.crashsdk.a.a(aVar, RSA.CHAR_ENCODING, "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n", arrayList2);
        }
        if (arrayList3 != null && arrayList3.size() > 0) {
            com.uc.crashsdk.a.b(aVar, RSA.CHAR_ENCODING, "--- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n", arrayList3);
        }
        if (str3 != null) {
            aVar.flush();
            aVar.write("threads dump:\n".getBytes(RSA.CHAR_ENCODING));
            f16388h = false;
            f16403w = str3;
            a(aVar, str3, j10);
            f16403w = null;
            f16388h = true;
        }
        if ((j11 & 8) != 0 && i10 == 0) {
            aVar.flush();
            aVar.write("all threads dump:\n".getBytes(RSA.CHAR_ENCODING));
            f16402v = true;
            a(aVar, "all", 0L);
            f16402v = false;
        }
        if ((j11 & 16) != 0) {
            e(aVar);
        }
        if ((j11 & 2) != 0) {
            aVar.a();
            a(aVar);
        }
        if (i10 != 0) {
            b(aVar);
        }
        try {
            ArrayList<String> arrayList4 = f16399s;
            synchronized (arrayList4) {
                f16400t++;
                String str4 = f16401u;
                if (str4 != null) {
                    arrayList4.add(str4);
                    if (arrayList4.size() > 3) {
                        arrayList4.remove(0);
                    }
                    if (com.uc.crashsdk.b.f16349d) {
                        JNIBridge.set(127, f16401u);
                    }
                    f16401u = null;
                }
                if (com.uc.crashsdk.b.f16349d) {
                    JNIBridge.set(25, f16400t);
                }
            }
        } catch (Throwable th5) {
            com.uc.crashsdk.a.g.a(th5);
        }
        return true;
    }

    private static boolean a(String str, com.uc.crashsdk.a.e eVar) {
        boolean z10;
        FileChannel fileChannel;
        Exception e10;
        synchronized (f16396p) {
            File file = new File(str);
            if (!file.exists()) {
                try {
                    file.createNewFile();
                } catch (Exception e11) {
                    com.uc.crashsdk.a.g.a(e11);
                }
            }
            ?? r52 = 0;
            r5 = null;
            FileLock lock = null;
            z10 = false;
            try {
                try {
                    try {
                        fileChannel = new RandomAccessFile(file, "rw").getChannel();
                    } catch (Throwable th) {
                        th = th;
                        r52 = file;
                        com.uc.crashsdk.a.g.a((Closeable) r52);
                        throw th;
                    }
                } catch (Exception e12) {
                    try {
                        com.uc.crashsdk.a.g.a(e12);
                        fileChannel = null;
                    } catch (Exception e13) {
                        fileChannel = null;
                        e10 = e13;
                        com.uc.crashsdk.a.g.a(e10);
                        com.uc.crashsdk.a.g.a(fileChannel);
                        return z10;
                    }
                }
                if (fileChannel != null) {
                    try {
                        lock = fileChannel.lock();
                    } catch (Exception e14) {
                        try {
                            com.uc.crashsdk.a.g.a(e14);
                        } catch (Exception e15) {
                            e10 = e15;
                            com.uc.crashsdk.a.g.a(e10);
                            com.uc.crashsdk.a.g.a(fileChannel);
                            return z10;
                        }
                    }
                }
                try {
                    z10 = eVar.a();
                    com.uc.crashsdk.a.g.a(fileChannel);
                } finally {
                    if (lock != null) {
                        try {
                            lock.release();
                        } catch (Exception e16) {
                            com.uc.crashsdk.a.g.a(e16);
                        }
                    }
                }
            } catch (Throwable th2) {
                th = th2;
            }
        }
        return z10;
    }

    private static boolean a(String str, d dVar) {
        String a10 = com.uc.crashsdk.a.g.a(new File(str), 64, false);
        if (a10 == null) {
            return false;
        }
        try {
            Matcher matcher = Pattern.compile("(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)").matcher(a10);
            if (matcher.find()) {
                long parseLong = Long.parseLong(matcher.group(1));
                if (System.currentTimeMillis() - parseLong < 86400000) {
                    dVar.f16414b = Long.parseLong(matcher.group(2));
                    dVar.f16415c = Integer.parseInt(matcher.group(3));
                    dVar.f16416d = Integer.parseInt(matcher.group(4));
                    dVar.f16413a = parseLong;
                }
            }
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
        return true;
    }

    public static boolean a(String str, String str2, boolean z10) {
        if (o(str2)) {
            h.a(str, str2, true, z10);
            com.uc.crashsdk.a.a.b(String.format(Locale.US, "Custom log '%s' has reach max count!", str2));
            return true;
        }
        return false;
    }

    public static boolean a(StringBuffer stringBuffer, String str, long j10, ArrayList<String> arrayList, ArrayList<String> arrayList2, ArrayList<String> arrayList3, String str2) {
        long j11;
        boolean z10;
        boolean a10;
        if (f16384c.get()) {
            com.uc.crashsdk.a.a.b("Processing java crash, skip generate custom log: " + str);
            return false;
        }
        boolean z11 = ag || com.uc.crashsdk.b.L();
        if (!z11 && !com.uc.crashsdk.a.d.e()) {
            com.uc.crashsdk.a.a.c("DEBUG", com.uc.crashsdk.a.d.b());
            return false;
        } else if (!d(str)) {
            com.uc.crashsdk.a.a.d("DEBUG", "custom log sample miss: " + str);
            return false;
        } else if (aa()) {
            com.uc.crashsdk.a.a.b("Processing native crash, skip generate custom log: " + str);
            return false;
        } else if (stringBuffer == null || str == null) {
            return false;
        } else {
            String str3 = g.X() + k(str);
            ?? r11 = (j10 & 32) != 0 ? 1 : 0;
            if (z11) {
                long nativeClientCreateConnection = com.uc.crashsdk.b.f16349d ? JNIBridge.nativeClientCreateConnection(str3, "custom", str, r11) : 0L;
                if (nativeClientCreateConnection == 0) {
                    com.uc.crashsdk.a.a.d("DEBUG", "skip custom log: " + str);
                    return false;
                }
                j11 = nativeClientCreateConnection;
            } else if (a(h(), str, (boolean) r11)) {
                return false;
            } else {
                g.a();
                a(false);
                j11 = 0;
            }
            synchronized (f16397q) {
                z10 = r11;
                a10 = a(str3, j11, stringBuffer, str, j10, arrayList, arrayList2, arrayList3, str2);
            }
            if (a10 && !z11) {
                b(h(), str, z10);
            }
            if (j11 != 0) {
                JNIBridge.nativeClientCloseConnection(j11);
            }
            if (a10) {
                if (!z11) {
                    r(str3);
                }
                if (!z11) {
                    str3 = a(m(str3));
                }
                b(str3, str);
                if (!z10 || z11) {
                    return true;
                }
                try {
                    a(true, false);
                    return true;
                } catch (Throwable th) {
                    com.uc.crashsdk.a.g.a(th);
                    return true;
                }
            }
            return false;
        }
    }

    public static boolean a(boolean z10, boolean z11) {
        if (!f16385d) {
            if (com.uc.crashsdk.b.f16349d) {
                JNIBridge.set(1, true);
            }
            f16385d = true;
        }
        try {
            String k6 = k();
            if (com.uc.crashsdk.a.g.a(k6)) {
                com.uc.crashsdk.a.a.a("crashsdk", "CrashHandler url is empty!");
                return false;
            }
            if (com.uc.crashsdk.a.f.a(z10 ? 1 : 0, new com.uc.crashsdk.a.e(406, new Object[]{k6, Boolean.valueOf(z11), Boolean.valueOf(z10)})) && z10) {
                ConditionVariable conditionVariable = f16395o;
                conditionVariable.close();
                if (!conditionVariable.block(3000L)) {
                    com.uc.crashsdk.a.a.a("crashsdk", "timeout to wait for uploading");
                    return false;
                }
            }
            return true;
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return false;
        }
    }

    private static boolean aa() {
        return com.uc.crashsdk.b.f16349d && JNIBridge.nativeIsCrashing();
    }

    private static void ab() {
        String Y2 = g.Y();
        File file = new File(Y2);
        if (file.isDirectory()) {
            try {
                File[] listFiles = file.listFiles();
                if (listFiles != null && listFiles.length > 150) {
                    Arrays.sort(listFiles, new b((byte) 0));
                    int length = listFiles.length - 150;
                    int i10 = length < 0 ? 0 : length;
                    long currentTimeMillis = System.currentTimeMillis();
                    int i11 = 0;
                    int i12 = 0;
                    while (i11 < listFiles.length) {
                        File file2 = listFiles[i11];
                        boolean z10 = i11 < i10;
                        if (!z10 && currentTimeMillis - file2.lastModified() >= 432000000) {
                            z10 = true;
                        }
                        if (!z10) {
                            break;
                        }
                        file2.delete();
                        i12++;
                        if (0 >= 3) {
                            break;
                        }
                        i11++;
                    }
                    com.uc.crashsdk.a.a.a("Removed " + i12 + " logs in " + Y2);
                }
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
        }
    }

    public static int b(OutputStream outputStream, String str, int i10) {
        int i11;
        DataInputStream dataInputStream;
        int i12;
        DataInputStream dataInputStream2 = null;
        int i13 = 0;
        try {
            File file = new File(str);
            if (file.exists()) {
                byte[] R2 = R();
                if (R2 == null) {
                    outputStream.write("(alloc buffer failed!)\n".getBytes(RSA.CHAR_ENCODING));
                    return 0;
                }
                dataInputStream = new DataInputStream(new FileInputStream(file));
                i12 = 0;
                i11 = 0;
                loop0: while (true) {
                    boolean z10 = false;
                    while (true) {
                        try {
                            int read = dataInputStream.read(R2);
                            if (read == -1) {
                                break loop0;
                            }
                            i12 += read;
                            int i14 = i10 - i11;
                            if (read <= i14 + 32) {
                                i14 = read;
                            }
                            if (i14 > 0 && !z10) {
                                outputStream.write(R2, 0, i14);
                                i11 += i14;
                            }
                            if (!z10) {
                                if (i14 < read || i11 >= i10) {
                                    z10 = true;
                                }
                            }
                        } catch (Throwable th) {
                            th = th;
                            i13 = i11;
                            dataInputStream2 = dataInputStream;
                            try {
                                a(th, outputStream);
                                com.uc.crashsdk.a.g.a(dataInputStream2);
                                i11 = i13;
                                a(outputStream);
                                return i11;
                            } finally {
                                com.uc.crashsdk.a.g.a(dataInputStream2);
                            }
                        }
                    }
                }
            } else {
                outputStream.write(("file: '" + str + "' not exists!\n").getBytes(RSA.CHAR_ENCODING));
                dataInputStream = null;
                i12 = 0;
                i11 = 0;
            }
            if (i11 > 0) {
                outputStream.write("\n".getBytes(RSA.CHAR_ENCODING));
            }
            if (i11 < i12) {
                outputStream.write(String.format(Locale.US, "(truncated %d bytes)\n", Integer.valueOf(i12 - i11)).getBytes(RSA.CHAR_ENCODING));
            }
        } catch (Throwable th2) {
            th = th2;
        }
        a(outputStream);
        return i11;
    }

    public static long b() {
        if (f16387g == -1) {
            f16387g = h(com.uc.crashsdk.b.b("local"));
        }
        return f16387g;
    }

    private static String b(String str, boolean z10, boolean z11) {
        if (z10) {
            try {
                str = m(str);
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
        }
        if (z11) {
            try {
                return a(str);
            } catch (Throwable th2) {
                com.uc.crashsdk.a.g.a(th2);
                return str;
            }
        }
        return str;
    }

    public static void b(int i10) {
        com.uc.crashsdk.a.f.a(0, new com.uc.crashsdk.a.e(410), i10 * 1000);
    }

    public static void b(Context context) {
        if (g.M()) {
            try {
                IntentFilter intentFilter = new IntentFilter();
                intentFilter.addAction("android.intent.action.BATTERY_CHANGED");
                intentFilter.addAction("android.intent.action.BATTERY_LOW");
                intentFilter.addAction("android.intent.action.BATTERY_OKAY");
                context.registerReceiver(Q, intentFilter, null, com.uc.crashsdk.a.f.a(1));
                R = true;
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
        }
    }

    private static void b(a aVar) {
        f16388h = false;
        try {
            aVar.write((s("LOG_END") + "\n").getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
        f16388h = true;
    }

    private static void b(OutputStream outputStream) {
        BufferedReader bufferedReader = null;
        try {
            outputStream.write("logcat:\n".getBytes(RSA.CHAR_ENCODING));
        } finally {
            try {
                com.uc.crashsdk.a.g.a(bufferedReader);
                a(outputStream);
            } finally {
            }
        }
        if (g.n() <= 0) {
            outputStream.write("[DEBUG] custom java logcat lines count is 0!\n".getBytes(RSA.CHAR_ENCODING));
            a(outputStream);
            return;
        }
        int n6 = g.n();
        bufferedReader = a(new InputStreamReader(Runtime.getRuntime().exec(new String[]{"logcat", "-d", "-b", com.umeng.analytics.pro.d.ar, "-b", "main", "-v", "threadtime", "-t", String.valueOf(n6)}).getInputStream()));
        if (bufferedReader == null) {
            outputStream.write("[DEBUG] alloc buffer failed!\n".getBytes(RSA.CHAR_ENCODING));
            a(outputStream);
            return;
        }
        f16388h = false;
        int i10 = 0;
        int i11 = 0;
        while (true) {
            String readLine = bufferedReader.readLine();
            if (readLine == null) {
                break;
            }
            i10++;
            if (i11 < n6 && !readLine.contains(" I auditd ") && !readLine.contains(" I liblog ")) {
                outputStream.write(readLine.getBytes(RSA.CHAR_ENCODING));
                outputStream.write("\n".getBytes(RSA.CHAR_ENCODING));
                i11++;
            }
        }
        outputStream.write(String.format(Locale.US, "[DEBUG] Read %d lines, wrote %d lines.\n", Integer.valueOf(i10), Integer.valueOf(i11)).getBytes(RSA.CHAR_ENCODING));
        f16388h = true;
        com.uc.crashsdk.a.g.a(bufferedReader);
        a(outputStream);
    }

    private static void b(OutputStream outputStream, String str, String str2) {
        String str3;
        try {
            outputStream.write("*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***\n".getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th) {
            a(th, outputStream);
        }
        try {
            Locale locale = Locale.US;
            outputStream.write(String.format(locale, "Basic Information: 'pid: %d/tid: %d/time: %s'\n", Integer.valueOf(Process.myPid()), Integer.valueOf(Process.myTid()), n()).getBytes(RSA.CHAR_ENCODING));
            Object[] objArr = new Object[3];
            objArr[0] = e();
            if (com.uc.crashsdk.a.g.a(f16392l)) {
                T();
            }
            objArr[1] = f16392l;
            objArr[2] = f();
            outputStream.write(String.format(locale, "Cpu Information: 'abi: %s/processor: %s/hardware: %s'\n", objArr).getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th2) {
            a(th2, outputStream);
        }
        try {
            Locale locale2 = Locale.US;
            outputStream.write(String.format(locale2, "Mobile Information: 'model: %s/version: %s/sdk: %d'\n", Build.MODEL, Build.VERSION.RELEASE, Integer.valueOf(Build.VERSION.SDK_INT)).getBytes(RSA.CHAR_ENCODING));
            outputStream.write(("Build fingerprint: '" + Build.FINGERPRINT + "'\n").getBytes(RSA.CHAR_ENCODING));
            Object[] objArr2 = new Object[4];
            objArr2[0] = a(new Date(f16383b));
            objArr2[1] = Long.valueOf(Runtime.getRuntime().maxMemory());
            objArr2[2] = com.uc.crashsdk.a.g.d();
            objArr2[3] = com.uc.crashsdk.b.B() ? "fg" : "bg";
            outputStream.write(String.format(locale2, "Runtime Information: 'start: %s/maxheap: %s/primaryabi: %s/ground: %s'\n", objArr2).getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th3) {
            a(th3, outputStream);
        }
        try {
            Locale locale3 = Locale.US;
            outputStream.write(String.format(locale3, "Application Information: 'version: %s/subversion: %s/buildseq: %s/versioncode: %d'\n", g.T(), g.U(), g.V(), Integer.valueOf(com.uc.crashsdk.a.c())).getBytes(RSA.CHAR_ENCODING));
            String str4 = "0";
            String str5 = "";
            if (com.uc.crashsdk.b.f16349d) {
                String nativeGet = JNIBridge.nativeGet(1, 0L, null);
                str3 = JNIBridge.nativeGet(2, 0L, null);
                str4 = nativeGet;
            } else {
                str3 = "";
            }
            outputStream.write(String.format(locale3, "CrashSDK Information: 'version: %s/nativeseq: %s/javaseq: %s/arch: %s/target: %s'\n", "3.3.2.2", str4, "211215141717", str3, "release").getBytes(RSA.CHAR_ENCODING));
            if (str != null) {
                str5 = str;
            }
            outputStream.write(("Report Name: " + str5.substring(str5.lastIndexOf(47) + 1) + "\n").getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th4) {
            a(th4, outputStream);
        }
        try {
            outputStream.write(String.format("UUID: %s\n", ag ? s("UUID") : B).getBytes(RSA.CHAR_ENCODING));
            outputStream.write(("Log Type: " + str2 + "\n").getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th5) {
            a(th5, outputStream);
        }
        try {
            String E2 = com.uc.crashsdk.b.E();
            if (com.uc.crashsdk.a.g.a(E2)) {
                E2 = "(none)";
            }
            outputStream.write(("Activity: " + E2 + "\n").getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th6) {
            a(th6, outputStream);
        }
        a(outputStream);
        try {
            com.uc.crashsdk.a.a(outputStream, RSA.CHAR_ENCODING);
            if (ag) {
                f16388h = false;
                outputStream.write(s("HEADER").getBytes(RSA.CHAR_ENCODING));
                f16388h = true;
            }
        } catch (Throwable th7) {
            a(th7, outputStream);
        }
        a(outputStream);
    }

    public static void b(String str) {
        synchronized (f16405y) {
            f16404x = str;
            com.uc.crashsdk.a.b.a(com.uc.crashsdk.b.i(), str + "\n");
        }
    }

    private static void b(String str, String str2) {
        try {
            com.uc.crashsdk.d.a(str, h(), str2);
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
    }

    public static void b(String str, String str2, boolean z10) {
        h.a(str, str2, false, z10);
    }

    public static void b(boolean z10) {
        try {
            boolean z11 = g.r() && com.uc.crashsdk.b.F() && !f16385d;
            if (!z11) {
                z11 = g.s();
            }
            if (z11) {
                if (!z10) {
                    a(true, false);
                    return;
                }
                String k6 = k();
                if (com.uc.crashsdk.a.g.a(k6)) {
                    return;
                }
                j();
                a(k6, false, false);
            }
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
    }

    public static boolean b(int i10, Object[] objArr) {
        if (i10 == 451) {
            if (f16381a || objArr != null) {
                return a((String) objArr[0], (d) objArr[1]);
            }
            throw new AssertionError();
        } else if (i10 != 452) {
            if (f16381a) {
                return false;
            }
            throw new AssertionError();
        } else if (f16381a || objArr != null) {
            d dVar = (d) objArr[1];
            return com.uc.crashsdk.a.g.a(new File((String) objArr[0]), String.format(Locale.US, "%d %d %d %d", Long.valueOf(dVar.f16413a), Long.valueOf(dVar.f16414b), Integer.valueOf(dVar.f16415c), Integer.valueOf(dVar.f16416d)).getBytes());
        } else {
            throw new AssertionError();
        }
    }

    private static boolean b(File file) {
        int indexOf;
        String name = file.getName();
        int lastIndexOf = name.lastIndexOf(95);
        if (lastIndexOf > 0 && (indexOf = name.indexOf(46, lastIndexOf)) > 0) {
            String substring = name.substring(lastIndexOf + 1, indexOf);
            return "java".equals(substring) || "ucebujava".equals(substring) || "jni".equals(substring) || "ucebujni".equals(substring) || "unexp".equals(substring) || "anr".equals(substring);
        }
        return false;
    }

    public static void c() {
        f16389i = null;
    }

    private static void c(OutputStream outputStream) {
        if (com.uc.crashsdk.b.f16349d) {
            String o10 = com.uc.crashsdk.b.o();
            f16388h = false;
            if (1 == JNIBridge.cmd(17, o10)) {
                File file = new File(o10);
                try {
                    byte[] e10 = com.uc.crashsdk.a.g.e(file);
                    if (e10 != null) {
                        outputStream.write(e10);
                    }
                } catch (Throwable th) {
                    a(th, outputStream);
                }
                try {
                    file.delete();
                } catch (Throwable th2) {
                    a(th2, outputStream);
                }
                f16388h = true;
                a(outputStream);
            }
            f16388h = true;
            return;
        }
        File[] fileArr = null;
        int i10 = 900;
        try {
            i10 = g.J();
            fileArr = new File("/proc/self/fd").listFiles();
            if (fileArr != null) {
                outputStream.write(String.format(Locale.US, "opened file count: %d, write limit: %d.\n", Integer.valueOf(fileArr.length), Integer.valueOf(i10)).getBytes(RSA.CHAR_ENCODING));
            } else {
                outputStream.write("[DEBUG] listFiles failed!\n".getBytes(RSA.CHAR_ENCODING));
            }
        } catch (Throwable th3) {
            a(th3, outputStream);
        }
        if (fileArr != null) {
            try {
                if (fileArr.length >= i10) {
                    outputStream.write("opened files:\n".getBytes(RSA.CHAR_ENCODING));
                    StringBuilder sb = new StringBuilder();
                    for (File file2 : fileArr) {
                        sb.append(file2.getName());
                        sb.append(" -> ");
                        sb.append(file2.getCanonicalPath());
                        sb.append("\n");
                    }
                    outputStream.write(sb.toString().getBytes(RSA.CHAR_ENCODING));
                }
            } catch (Throwable th4) {
                a(th4, outputStream);
            }
        }
        a(outputStream);
    }

    public static void c(String str) {
        synchronized (f16406z) {
            String l6 = com.uc.crashsdk.b.l();
            com.uc.crashsdk.a.b.a(l6, str + "\n");
        }
    }

    public static void c(boolean z10) {
        boolean z11 = true;
        if (!R ? !z10 || !g.M() : z10 && g.M()) {
            z11 = false;
        }
        if (z11) {
            com.uc.crashsdk.a.e eVar = S;
            if (com.uc.crashsdk.a.f.b(eVar)) {
                com.uc.crashsdk.a.f.a(eVar);
            }
            com.uc.crashsdk.a.f.a(0, eVar, 3000L);
        }
    }

    public static String d() {
        String str = f16389i;
        if (str != null) {
            return str;
        }
        String j10 = j(null);
        f16389i = j10;
        return j10;
    }

    private static void d(OutputStream outputStream) {
        int i10;
        int i11;
        File[] fileArr = null;
        try {
            i10 = g.K();
            try {
                fileArr = new File("/proc/self/task").listFiles();
            } catch (Throwable th) {
                th = th;
                com.uc.crashsdk.a.g.a(th);
                i11 = 0;
                if (fileArr != null) {
                }
            }
        } catch (Throwable th2) {
            th = th2;
            i10 = 300;
        }
        if (fileArr == null) {
            return;
        }
        i11 = fileArr.length;
        if (i11 < i10) {
            return;
        }
        if (fileArr != null) {
            return;
        }
        try {
            outputStream.write("threads info:\n".getBytes(RSA.CHAR_ENCODING));
            outputStream.write(String.format(Locale.US, "threads count: %d, dump limit: %d.\n", Integer.valueOf(i11), Integer.valueOf(i10)).getBytes(RSA.CHAR_ENCODING));
            outputStream.write(" tid     name\n".getBytes(RSA.CHAR_ENCODING));
            for (File file : fileArr) {
                outputStream.write(String.format(Locale.US, "%5s %s\n", file.getName(), l(com.uc.crashsdk.a.g.a(new File(file.getPath(), "comm"), 128, false))).getBytes(RSA.CHAR_ENCODING));
            }
        } catch (Throwable th3) {
            a(th3, outputStream);
        }
        a(outputStream);
    }

    public static void d(boolean z10) {
        f.d(false);
        if (z10) {
            f.a(com.uc.crashsdk.b.c(), false);
        } else {
            f.a();
        }
        h.i();
    }

    public static boolean d(Context context) {
        List<ActivityManager.ProcessErrorStateInfo> processesInErrorState;
        ActivityManager activityManager = (ActivityManager) context.getSystemService("activity");
        boolean z10 = false;
        if (activityManager == null || (processesInErrorState = activityManager.getProcessesInErrorState()) == null) {
            return false;
        }
        int myPid = Process.myPid();
        Iterator<ActivityManager.ProcessErrorStateInfo> it = processesInErrorState.iterator();
        while (true) {
            if (!it.hasNext()) {
                break;
            }
            ActivityManager.ProcessErrorStateInfo next = it.next();
            if (next.pid == myPid) {
                O = true;
                if (O()) {
                    com.uc.crashsdk.a.a.d("crashsdk", "ANR occurred in process: " + next.processName);
                }
                if (com.uc.crashsdk.b.f16349d) {
                    JNIBridge.set(130, next.longMsg);
                }
                z10 = true;
            }
        }
        if (!z10 && com.uc.crashsdk.b.f16349d) {
            W();
        }
        return true;
    }

    public static boolean d(String str) {
        if (ag) {
            return true;
        }
        try {
            return p(str);
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return true;
        }
    }

    public static int e(boolean z10) {
        return f.a(z10);
    }

    public static String e() {
        String str;
        String str2;
        boolean z10;
        String str3;
        String str4;
        Method declaredMethod;
        if (com.uc.crashsdk.a.g.a(f16390j)) {
            String str5 = null;
            try {
                if (Build.VERSION.SDK_INT >= 21) {
                    Field declaredField = Build.class.getDeclaredField("SUPPORTED_ABIS");
                    declaredField.setAccessible(true);
                    Object obj = declaredField.get(null);
                    if (obj != null && (obj instanceof String[])) {
                        String[] strArr = (String[]) obj;
                        StringBuilder sb = new StringBuilder();
                        int length = strArr.length;
                        int i10 = 0;
                        boolean z11 = true;
                        while (i10 < length) {
                            String str6 = strArr[i10];
                            if (!z11) {
                                sb.append(",");
                            }
                            sb.append(str6);
                            i10++;
                            z11 = false;
                        }
                        f16390j = sb.toString();
                    }
                }
            } catch (Throwable unused) {
            }
            if (com.uc.crashsdk.a.g.a(f16390j)) {
                try {
                    str = Build.CPU_ABI;
                } catch (Throwable unused2) {
                    str = null;
                }
                try {
                    str2 = Build.CPU_ABI2;
                } catch (Throwable unused3) {
                    str2 = null;
                    z10 = !com.uc.crashsdk.a.g.a(str);
                    if (z10) {
                    }
                    if (!com.uc.crashsdk.a.g.a(str2)) {
                    }
                    declaredMethod = Class.forName("android.os.SystemProperties").getDeclaredMethod("get", String.class, String.class);
                    if (declaredMethod != null) {
                    }
                }
                z10 = !com.uc.crashsdk.a.g.a(str);
                if (z10) {
                    f16390j = str;
                }
                if (!com.uc.crashsdk.a.g.a(str2)) {
                    if (z10) {
                        f16390j += ",";
                        f16390j += str2;
                    } else {
                        f16390j = str2;
                    }
                }
            }
            try {
                declaredMethod = Class.forName("android.os.SystemProperties").getDeclaredMethod("get", String.class, String.class);
            } catch (Throwable th) {
                th = th;
                str3 = null;
            }
            if (declaredMethod != null) {
                str4 = null;
                if (!com.uc.crashsdk.a.g.a(str5)) {
                    f16390j += ",";
                    f16390j += str5;
                }
                if (!com.uc.crashsdk.a.g.a(str4)) {
                    f16390j += ",";
                    f16390j += str4;
                }
                return f16390j;
            }
            declaredMethod.setAccessible(true);
            str3 = (String) declaredMethod.invoke(null, "ro.product.cpu.abi", null);
            try {
                str4 = (String) declaredMethod.invoke(null, "ro.product.cpu.abi2", null);
            } catch (Throwable th2) {
                th = th2;
                com.uc.crashsdk.a.g.a(th);
                str4 = null;
                str5 = str3;
                if (!com.uc.crashsdk.a.g.a(str5)) {
                }
                if (!com.uc.crashsdk.a.g.a(str4)) {
                }
                return f16390j;
            }
            str5 = str3;
            if (!com.uc.crashsdk.a.g.a(str5) && !f16390j.contains(str5)) {
                f16390j += ",";
                f16390j += str5;
            }
            if (!com.uc.crashsdk.a.g.a(str4) && !f16390j.contains(str4)) {
                f16390j += ",";
                f16390j += str4;
            }
            return f16390j;
        }
        return f16390j;
    }

    private static void e(OutputStream outputStream) {
        BufferedReader bufferedReader;
        int indexOf;
        boolean z10;
        if (com.uc.crashsdk.b.f16349d) {
            try {
                outputStream.write("solib build id:\n".getBytes(RSA.CHAR_ENCODING));
            } catch (Throwable th) {
                a(th, outputStream);
            }
            FileReader fileReader = null;
            try {
                ArrayList arrayList = new ArrayList();
                FileReader fileReader2 = new FileReader(new File("/proc/self/maps"));
                try {
                    bufferedReader = new BufferedReader(fileReader2, 512);
                    while (true) {
                        try {
                            String readLine = bufferedReader.readLine();
                            if (readLine == null) {
                                break;
                            } else if (readLine.endsWith(".so") && (indexOf = readLine.indexOf(47)) != -1) {
                                String substring = readLine.substring(indexOf);
                                if (!substring.contains("/data/") && !substring.contains(com.uc.crashsdk.a.f16265a)) {
                                    z10 = false;
                                    if (z10 && !arrayList.contains(substring)) {
                                        arrayList.add(substring);
                                        if (ag) {
                                            outputStream.write(String.format(Locale.US, "%s: %s\n", substring, JNIBridge.nativeGet(3, 0L, substring)).getBytes(RSA.CHAR_ENCODING));
                                        } else {
                                            outputStream.write((String.format("$^%s`%s^$", "SOBUILDID", substring) + "\n").getBytes(RSA.CHAR_ENCODING));
                                        }
                                    }
                                }
                                z10 = true;
                                if (z10) {
                                    arrayList.add(substring);
                                    if (ag) {
                                    }
                                }
                            }
                        } catch (Throwable th2) {
                            th = th2;
                            fileReader = fileReader2;
                            try {
                                a(th, outputStream);
                                com.uc.crashsdk.a.g.a(fileReader);
                                com.uc.crashsdk.a.g.a(bufferedReader);
                                a(outputStream);
                            } catch (Throwable th3) {
                                com.uc.crashsdk.a.g.a(fileReader);
                                com.uc.crashsdk.a.g.a(bufferedReader);
                                throw th3;
                            }
                        }
                    }
                    com.uc.crashsdk.a.g.a(fileReader2);
                } catch (Throwable th4) {
                    th = th4;
                    bufferedReader = null;
                }
            } catch (Throwable th5) {
                th = th5;
                bufferedReader = null;
            }
            com.uc.crashsdk.a.g.a(bufferedReader);
            a(outputStream);
        }
    }

    public static boolean e(String str) {
        try {
            if (com.uc.crashsdk.a.g.b(str) && str.startsWith("lib") && str.endsWith(".so")) {
                System.loadLibrary(str.substring(3, str.length() - 3));
                return true;
            }
            return false;
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return false;
        }
    }

    public static int f(boolean z10) {
        int b10 = z10 ? f.a(com.uc.crashsdk.b.c()) ? 1 : 0 : f.b();
        int b11 = f.b(z10);
        return b11 > b10 ? b11 : b10;
    }

    public static String f() {
        if (com.uc.crashsdk.a.g.a(f16391k)) {
            T();
        }
        return f16391k;
    }

    public static StringBuilder f(String str) {
        return a(Thread.currentThread().getStackTrace(), str);
    }

    private static void f(OutputStream outputStream) {
        try {
            outputStream.write("recent status:\n".getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th) {
            a(th, outputStream);
        }
        try {
            outputStream.write(String.format(Locale.US, "last version: '%s'\n", ag ? s("LASTVER") : com.uc.crashsdk.a.m()).getBytes(RSA.CHAR_ENCODING));
        } catch (Throwable th2) {
            a(th2, outputStream);
        }
        try {
            ArrayList<String> arrayList = f16399s;
            synchronized (arrayList) {
                if (f16401u != null) {
                    outputStream.write(String.format(Locale.US, "generating log: %s\n", f16401u).getBytes(RSA.CHAR_ENCODING));
                }
                if (f16400t > 0 || arrayList.size() > 0) {
                    outputStream.write(String.format(Locale.US, "generated %d logs, recent are:\n", Integer.valueOf(f16400t)).getBytes(RSA.CHAR_ENCODING));
                    Iterator<String> it = arrayList.iterator();
                    while (it.hasNext()) {
                        outputStream.write(String.format(Locale.US, "* %s\n", it.next()).getBytes(RSA.CHAR_ENCODING));
                    }
                }
            }
            Locale locale = Locale.US;
            outputStream.write(String.format(locale, "dumping all threads: %s\n", Boolean.valueOf(f16402v)).getBytes(RSA.CHAR_ENCODING));
            String str = f16403w;
            if (str != null) {
                outputStream.write(String.format(locale, "dumping threads: %s\n", str).getBytes(RSA.CHAR_ENCODING));
            }
        } catch (Throwable th3) {
            a(th3, outputStream);
        }
        a(outputStream);
    }

    public static String g() {
        try {
            StringBuilder sb = new StringBuilder();
            sb.append("JavaMax:    ");
            sb.append(Runtime.getRuntime().maxMemory() / 1024);
            sb.append(" kB\n");
            sb.append("JavaTotal:  ");
            sb.append(Runtime.getRuntime().totalMemory() / 1024);
            sb.append(" kB\n");
            sb.append("JavaFree:   ");
            sb.append(Runtime.getRuntime().freeMemory() / 1024);
            sb.append(" kB\n");
            sb.append("NativeHeap: ");
            sb.append(Debug.getNativeHeapSize() / 1024);
            sb.append(" kB\n");
            sb.append("NativeAllocated: ");
            sb.append(Debug.getNativeHeapAllocatedSize() / 1024);
            sb.append(" kB\n");
            sb.append("NativeFree: ");
            sb.append(Debug.getNativeHeapFreeSize() / 1024);
            sb.append(" kB\n");
            ActivityManager activityManager = (ActivityManager) com.uc.crashsdk.a.g.a().getSystemService("activity");
            if (activityManager != null) {
                ActivityManager.MemoryInfo memoryInfo = new ActivityManager.MemoryInfo();
                activityManager.getMemoryInfo(memoryInfo);
                sb.append("availMem:   ");
                sb.append(memoryInfo.availMem / 1024);
                sb.append(" kB\n");
                sb.append("threshold:  ");
                sb.append(memoryInfo.threshold / 1024);
                sb.append(" kB\n");
                sb.append("lowMemory:  ");
                sb.append(memoryInfo.lowMemory);
                sb.append("\n");
            }
            return sb.toString();
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
            return "";
        }
    }

    private static long h(String str) {
        try {
            Method declaredMethod = Class.forName("android.os.SystemProperties").getDeclaredMethod("getLong", String.class, Long.TYPE);
            if (declaredMethod != null) {
                declaredMethod.setAccessible(true);
                return ((Long) declaredMethod.invoke(null, str, 0L)).longValue();
            }
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
        return 0L;
    }

    public static String h() {
        String str = f16393m;
        if (str != null) {
            return str;
        }
        String a10 = a(Process.myPid());
        f16393m = a10;
        return a10;
    }

    private static String i(String str) {
        try {
            return str.replaceAll("[^0-9a-zA-Z-.]", "-");
        } catch (Throwable unused) {
            return "unknown";
        }
    }

    public static boolean i() {
        return f16385d;
    }

    private static String j(String str) {
        if (str == null) {
            str = String.valueOf(System.currentTimeMillis()) + new Random().nextInt(65536);
        }
        return String.format(Locale.US, "%s%s_%s_%s_%s_%s_", P(), g.T(), g.V(), i(Build.MODEL), i(Build.VERSION.RELEASE), str);
    }

    public static void j() {
        try {
            StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder(StrictMode.getThreadPolicy()).permitNetwork().build());
        } catch (Throwable th) {
            com.uc.crashsdk.a.g.a(th);
        }
    }

    public static String k() {
        String str = f16404x;
        if (com.uc.crashsdk.a.g.a(str)) {
            synchronized (f16405y) {
                str = com.uc.crashsdk.a.g.a(com.uc.crashsdk.b.i(), g.y(), true);
                f16404x = str;
            }
        }
        return str;
    }

    private static String k(String str) {
        return String.format(Locale.US, "%s%s_%s_%s.log", d(), n(), Q(), str);
    }

    private static String l(String str) {
        if (com.uc.crashsdk.a.g.b(str)) {
            int indexOf = str.indexOf(0);
            if (indexOf >= 0) {
                str = str.substring(0, indexOf);
            }
            return str.trim();
        }
        return "";
    }

    public static void l() {
        synchronized (f16405y) {
            f16404x = null;
        }
    }

    private static String m(String str) {
        String a10 = com.uc.crashsdk.a.b.a(str, g.w(), g.v());
        if (!str.equals(a10)) {
            File file = new File(str);
            if (file.exists()) {
                file.delete();
            }
        }
        return a10;
    }

    public static void m() {
        if (ag) {
            return;
        }
        com.uc.crashsdk.a.f.a(1, new com.uc.crashsdk.a.e(411), 1000L);
    }

    public static String n() {
        return a(new Date());
    }

    private static boolean[] n(String str) {
        boolean v10 = g.v();
        boolean x10 = g.x();
        if (v10 || x10) {
            if (!str.endsWith(".tmp") && !str.contains(".ec")) {
                int lastIndexOf = str.lastIndexOf(File.separatorChar);
                if (lastIndexOf < 0) {
                    lastIndexOf = 0;
                }
                int i10 = 0;
                do {
                    lastIndexOf = str.indexOf(95, lastIndexOf);
                    if (lastIndexOf >= 0) {
                        i10++;
                        lastIndexOf++;
                        continue;
                    }
                } while (lastIndexOf >= 0);
                if (i10 == 8) {
                    String w10 = g.w();
                    if (str.endsWith(".log")) {
                        if (!com.uc.crashsdk.a.g.a(w10)) {
                        }
                    } else if (!com.uc.crashsdk.a.g.a(w10)) {
                    }
                    v10 = false;
                }
            }
            v10 = false;
            x10 = false;
        }
        return new boolean[]{v10, x10};
    }

    public static void o() {
        f16383b = System.currentTimeMillis();
    }

    private static boolean o(String str) {
        boolean z10;
        boolean z11;
        int parseInt;
        synchronized (f16398r) {
            File file = new File(g.W() + "customlog");
            String a10 = com.uc.crashsdk.a.g.a(file, 1024, false);
            long currentTimeMillis = System.currentTimeMillis();
            StringBuffer stringBuffer = new StringBuffer();
            try {
                if (a10 != null) {
                    stringBuffer.append(a10);
                    Matcher matcher = Pattern.compile("([^\\n\\r\\t\\s]+) (\\d+) (\\d+)").matcher(stringBuffer);
                    for (int i10 = 0; matcher.find(i10); i10 = matcher.end()) {
                        if (str.equals(matcher.group(1))) {
                            long parseLong = Long.parseLong(matcher.group(2));
                            if (currentTimeMillis - parseLong < 86400000) {
                                try {
                                    parseInt = Integer.parseInt(matcher.group(3));
                                } catch (Exception e10) {
                                    com.uc.crashsdk.a.g.a(e10);
                                }
                                int F2 = g.F();
                                z11 = F2 < 0 && parseInt >= F2;
                                stringBuffer.replace(matcher.start(), matcher.end(), String.format(Locale.US, "%s %d %d", str, Long.valueOf(parseLong), Integer.valueOf(parseInt + 1)));
                                z10 = true;
                                if (!z10) {
                                    stringBuffer.append(String.format(Locale.US, "%s %d 1\n", str, Long.valueOf(currentTimeMillis)));
                                }
                                FileWriter fileWriter = null;
                                FileWriter fileWriter2 = new FileWriter(file);
                                String stringBuffer2 = stringBuffer.toString();
                                fileWriter2.write(stringBuffer2, 0, stringBuffer2.length());
                                com.uc.crashsdk.a.g.a(fileWriter2);
                            } else {
                                parseLong = currentTimeMillis;
                            }
                            parseInt = 0;
                            int F22 = g.F();
                            if (F22 < 0) {
                            }
                            stringBuffer.replace(matcher.start(), matcher.end(), String.format(Locale.US, "%s %d %d", str, Long.valueOf(parseLong), Integer.valueOf(parseInt + 1)));
                            z10 = true;
                            if (!z10) {
                            }
                            FileWriter fileWriter3 = null;
                            FileWriter fileWriter22 = new FileWriter(file);
                            String stringBuffer22 = stringBuffer.toString();
                            fileWriter22.write(stringBuffer22, 0, stringBuffer22.length());
                            com.uc.crashsdk.a.g.a(fileWriter22);
                        }
                    }
                }
                FileWriter fileWriter222 = new FileWriter(file);
                String stringBuffer222 = stringBuffer.toString();
                fileWriter222.write(stringBuffer222, 0, stringBuffer222.length());
                com.uc.crashsdk.a.g.a(fileWriter222);
            } catch (Throwable th) {
                th = th;
            }
            z10 = false;
            z11 = false;
            if (!z10) {
            }
            FileWriter fileWriter32 = null;
        }
        return z11;
    }

    public static void p() {
        String str;
        Throwable th;
        if (com.uc.crashsdk.a.g.a(B)) {
            String str2 = null;
            try {
                File file = new File(g.W() + "unique");
                if (file.exists()) {
                    str = com.uc.crashsdk.a.g.a(file, 48, false);
                    try {
                        if (str != null) {
                            try {
                                if (str.length() == 36) {
                                    str2 = str.replaceAll("[^0-9a-zA-Z-]", "-");
                                }
                            } catch (Exception e10) {
                                com.uc.crashsdk.a.g.a(e10);
                            }
                        }
                        str2 = str;
                    } catch (Throwable th2) {
                        th = th2;
                        com.uc.crashsdk.a.g.a(th);
                        str2 = str;
                        B = str2;
                    }
                }
                if (com.uc.crashsdk.a.g.a(str2)) {
                    com.uc.crashsdk.b.G();
                    str2 = UUID.randomUUID().toString();
                    if (!com.uc.crashsdk.a.g.a(str2)) {
                        com.uc.crashsdk.a.g.a(file, str2.getBytes());
                    }
                }
            } catch (Throwable th3) {
                str = str2;
                th = th3;
            }
            B = str2;
        }
    }

    private static boolean p(String str) {
        boolean z10;
        boolean z11;
        int i10;
        Integer num;
        synchronized (f16406z) {
            z10 = false;
            if (A == null) {
                A = q(com.uc.crashsdk.a.g.a(com.uc.crashsdk.b.l(), "all:1", false));
            }
            if (A.containsKey("all")) {
                num = A.get("all");
            } else if (A.containsKey(str)) {
                num = A.get(str);
            } else {
                if (!"java".equals(str) && !"jni".equals(str) && !"anr".equals(str) && !"unexp".equals(str)) {
                    z11 = false;
                    if (!z11 && A.containsKey("crash")) {
                        num = A.get("crash");
                    } else if (z11 && A.containsKey("nocrash")) {
                        num = A.get("nocrash");
                    } else if (A.containsKey("other")) {
                        i10 = 1;
                        if (i10 != 0) {
                            long j10 = i10;
                            if (j10 < 0) {
                                long j11 = 30;
                                if (j10 == -2) {
                                    j11 = 7;
                                } else if (j10 == -3) {
                                    j11 = 15;
                                } else if (j10 == -4) {
                                    j11 = 60;
                                }
                                long b10 = com.uc.crashsdk.a.b();
                                long currentTimeMillis = b10 == 0 ? -1L : (System.currentTimeMillis() - b10) / 86400000;
                                j10 = currentTimeMillis <= j11 ? 1L : currentTimeMillis - j11;
                            }
                            if (j10 != 1) {
                                if (j10 > 0) {
                                    if (System.currentTimeMillis() % j10 == 0) {
                                    }
                                }
                            }
                            z10 = true;
                        }
                    } else {
                        num = A.get("other");
                    }
                }
                z11 = true;
                if (!z11) {
                }
                if (z11) {
                }
                if (A.containsKey("other")) {
                }
            }
            i10 = num.intValue();
            if (i10 != 0) {
            }
        }
        return z10;
    }

    public static String q() {
        return B;
    }

    private static Map<String, Integer> q(String str) {
        HashMap hashMap = new HashMap();
        for (String str2 : str.split("\\|", 30)) {
            String[] split = str2.split(":", 3);
            if (split.length == 2) {
                String trim = split[0].trim();
                if (!com.uc.crashsdk.a.g.a(trim)) {
                    int i10 = 1;
                    try {
                        i10 = Integer.parseInt(split[1].trim(), 10);
                    } catch (Throwable th) {
                        com.uc.crashsdk.a.g.a(th);
                    }
                    hashMap.put(trim, Integer.valueOf(i10));
                }
            }
        }
        return hashMap;
    }

    public static void r() {
        O = false;
        if (!com.uc.crashsdk.b.B()) {
            com.uc.crashsdk.a.f.a(3, new com.uc.crashsdk.a.e(416), 11000L);
        }
        if (V()) {
            return;
        }
        N = 0;
        X();
    }

    private static void r(String str) {
        if (g.q()) {
            try {
                ab();
            } catch (Throwable th) {
                com.uc.crashsdk.a.g.a(th);
            }
            if (str == null || "".equals(str)) {
                return;
            }
            try {
                File file = new File(g.Y());
                if (!file.exists()) {
                    file.mkdirs();
                }
                com.uc.crashsdk.a.a.a("crashsdk", "copy log to: " + file);
                com.uc.crashsdk.a.g.a(new File(str), file);
            } catch (Throwable th2) {
                com.uc.crashsdk.a.g.a(th2);
            }
        }
    }

    private static String s(String str) {
        return String.format("$^%s^$", str);
    }

    public static void s() {
        T = Thread.getDefaultUncaughtExceptionHandler();
        Thread.setDefaultUncaughtExceptionHandler(new e());
    }

    public static void t() {
        Thread.setDefaultUncaughtExceptionHandler(T);
    }

    public static boolean u() {
        return f16384c.get() || aa();
    }

    public static Throwable v() {
        return U;
    }

    public static int w() {
        if (com.uc.crashsdk.b.I() == 5) {
            return Z;
        }
        return 100;
    }

    public static void x() {
        long o10 = g.o();
        if (o10 < 0) {
            return;
        }
        boolean z10 = com.uc.crashsdk.b.I() == 5;
        com.uc.crashsdk.a.f.a(0, new com.uc.crashsdk.a.e(401));
        if (z10) {
            com.uc.crashsdk.a.e eVar = new com.uc.crashsdk.a.e(402);
            X = eVar;
            com.uc.crashsdk.a.f.a(0, eVar, o10);
        }
    }

    public static void y() {
        if (com.uc.crashsdk.b.f16348c && com.uc.crashsdk.a.f16267c && !com.uc.crashsdk.a.f.b(f16382aa)) {
            com.uc.crashsdk.a.f.a(0, f16382aa, 1000L);
        }
    }

    public static boolean z() {
        synchronized (Y) {
            Runnable runnable = X;
            if (runnable == null || W) {
                return false;
            }
            com.uc.crashsdk.a.f.a(runnable);
            X = null;
            return true;
        }
    }

    public final void a(Thread thread, Throwable th, boolean z10) {
        boolean z11;
        long j10;
        boolean z12;
        boolean i10;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler;
        Throwable th2;
        boolean z13;
        boolean i11;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler2;
        boolean z14;
        String str;
        long nativeClientCreateConnection;
        boolean z15;
        boolean i12;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler3;
        boolean z16;
        boolean i13;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler4;
        Throwable th3;
        boolean z17;
        boolean i14;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler5;
        File file;
        boolean z18;
        boolean i15;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler6;
        boolean z19;
        boolean i16;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler7;
        boolean z20;
        boolean i17;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler8;
        boolean z21;
        boolean i18;
        Thread.UncaughtExceptionHandler uncaughtExceptionHandler9;
        boolean z22 = (ag && com.uc.crashsdk.b.f16349d) || com.uc.crashsdk.b.L();
        try {
            j10 = 4;
            if (!f16384c.getAndSet(true) || Process.myPid() <= 0) {
                U = th;
                if (z22 || com.uc.crashsdk.a.d.e()) {
                    com.uc.crashsdk.a.a.d("DEBUG", "encryptLog: " + g.x() + ", zipCrashLog: " + g.x());
                    if (g.f16429a != null) {
                        com.uc.crashsdk.a.a.d("DEBUG", "the set zip log to false stack is:");
                        g.f16429a.printStackTrace();
                    }
                    if (g.f16430b != null) {
                        com.uc.crashsdk.a.a.d("DEBUG", "the set encrypt to true stack is:");
                        g.f16430b.printStackTrace();
                    }
                    com.uc.crashsdk.a.a.d("DEBUG", "begin to generate java report");
                    N();
                    try {
                        z14 = g.t();
                        try {
                            String g10 = g.g();
                            if (g10 == null || g10.equals("")) {
                                g10 = k(S());
                            }
                            str = g.X() + g10;
                            z11 = false;
                        } catch (Throwable th4) {
                            th = th4;
                            com.uc.crashsdk.a.a.d("DEBUG", "get java log name failed: " + th);
                            a(th);
                            com.uc.crashsdk.a.a.d("DEBUG", "original exception is: " + th);
                            a(th);
                            str = null;
                            z11 = true;
                            try {
                                if (z22) {
                                }
                                boolean z23 = th instanceof OutOfMemoryError;
                                a(th, str, nativeClientCreateConnection, z23);
                                com.uc.crashsdk.a.a.d("DEBUG", "generate java report finished");
                                if (!com.uc.crashsdk.b.L()) {
                                    String name = new File(str).getName();
                                    String Y2 = g.Y();
                                    file = new File(Y2);
                                    if (!file.exists()) {
                                    }
                                    String format = String.format(Locale.US, "%s%s.hprof", Y2, name);
                                    com.uc.crashsdk.a.a.d("DEBUG", "begin dump hprof: " + format);
                                    long currentTimeMillis = System.currentTimeMillis();
                                    Debug.dumpHprofData(format);
                                    com.uc.crashsdk.a.a.d("DEBUG", "end dump hprof, use " + (System.currentTimeMillis() - currentTimeMillis) + " ms");
                                }
                                if (nativeClientCreateConnection != 0) {
                                    JNIBridge.nativeClientCloseConnection(nativeClientCreateConnection);
                                }
                                if (z10) {
                                }
                                z17 = false;
                                if (!z17) {
                                }
                                try {
                                    f.c(false);
                                } catch (Throwable th5) {
                                    com.uc.crashsdk.a.g.a(th5);
                                }
                                try {
                                    i14 = g.i();
                                    if (!com.uc.crashsdk.a.d.e()) {
                                    }
                                    com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i14);
                                    if (i14) {
                                    }
                                    if (com.uc.crashsdk.b.B()) {
                                    }
                                } catch (Throwable th6) {
                                    com.uc.crashsdk.a.g.a(th6);
                                }
                                V = true;
                                if (Process.myPid() <= 0) {
                                }
                            }
                        }
                    } catch (Throwable th7) {
                        th = th7;
                        z14 = false;
                    }
                    try {
                        if (z22) {
                            g.a();
                            try {
                                if (com.uc.crashsdk.b.B()) {
                                    f.a(3);
                                } else {
                                    f.a(4);
                                }
                            } catch (Throwable th8) {
                                com.uc.crashsdk.a.g.a(th8);
                            }
                            new File(com.uc.crashsdk.b.b()).createNewFile();
                            if (z14) {
                                com.uc.crashsdk.a.a.d("DEBUG", "omit java crash");
                                if (z10) {
                                    try {
                                    } catch (Throwable th9) {
                                        th = th9;
                                        z19 = false;
                                    }
                                    if (g.r() && !z22) {
                                        try {
                                            a(true, false);
                                            z19 = true;
                                        } catch (Throwable th10) {
                                            th = th10;
                                            z19 = true;
                                            com.uc.crashsdk.a.g.a(th);
                                            if (!z19) {
                                            }
                                            f.c(false);
                                            i16 = g.i();
                                            if (!com.uc.crashsdk.a.d.e()) {
                                            }
                                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i16);
                                            if (i16) {
                                            }
                                            if (com.uc.crashsdk.b.B()) {
                                            }
                                            V = true;
                                            if (Process.myPid() > 0) {
                                            }
                                        }
                                        if (!z19 && !z22) {
                                            b(false);
                                        }
                                        f.c(false);
                                        i16 = g.i();
                                        if (!com.uc.crashsdk.a.d.e()) {
                                            i16 = true;
                                        }
                                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i16);
                                        if (i16 && (uncaughtExceptionHandler7 = T) != null) {
                                            uncaughtExceptionHandler7.uncaughtException(thread, th);
                                        }
                                        if (com.uc.crashsdk.b.B() && !z22) {
                                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                        }
                                        V = true;
                                        if (Process.myPid() > 0) {
                                            Process.killProcess(Process.myPid());
                                            return;
                                        }
                                        return;
                                    }
                                }
                                z19 = false;
                                if (!z19) {
                                    b(false);
                                }
                                f.c(false);
                                i16 = g.i();
                                if (!com.uc.crashsdk.a.d.e()) {
                                }
                                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i16);
                                if (i16) {
                                    uncaughtExceptionHandler7.uncaughtException(thread, th);
                                }
                                if (com.uc.crashsdk.b.B()) {
                                    com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                }
                                V = true;
                                if (Process.myPid() > 0) {
                                }
                            } else if (d("java")) {
                                nativeClientCreateConnection = 0;
                            } else {
                                com.uc.crashsdk.a.a.d("DEBUG", "java log sample miss");
                                if (z10) {
                                    try {
                                    } catch (Throwable th11) {
                                        th = th11;
                                        z18 = false;
                                    }
                                    if (g.r() && !z22) {
                                        try {
                                            a(true, false);
                                            z18 = true;
                                        } catch (Throwable th12) {
                                            th = th12;
                                            z18 = true;
                                            com.uc.crashsdk.a.g.a(th);
                                            if (!z18) {
                                            }
                                            f.c(false);
                                            i15 = g.i();
                                            if (!com.uc.crashsdk.a.d.e()) {
                                            }
                                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i15);
                                            if (i15) {
                                            }
                                            if (com.uc.crashsdk.b.B()) {
                                            }
                                            V = true;
                                            if (Process.myPid() > 0) {
                                            }
                                        }
                                        if (!z18 && !z22) {
                                            b(false);
                                        }
                                        f.c(false);
                                        i15 = g.i();
                                        if (!com.uc.crashsdk.a.d.e()) {
                                            i15 = true;
                                        }
                                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i15);
                                        if (i15 && (uncaughtExceptionHandler6 = T) != null) {
                                            uncaughtExceptionHandler6.uncaughtException(thread, th);
                                        }
                                        if (com.uc.crashsdk.b.B() && !z22) {
                                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                        }
                                        V = true;
                                        if (Process.myPid() > 0) {
                                            Process.killProcess(Process.myPid());
                                            return;
                                        }
                                        return;
                                    }
                                }
                                z18 = false;
                                if (!z18) {
                                    b(false);
                                }
                                f.c(false);
                                i15 = g.i();
                                if (!com.uc.crashsdk.a.d.e()) {
                                }
                                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i15);
                                if (i15) {
                                    uncaughtExceptionHandler6.uncaughtException(thread, th);
                                }
                                if (com.uc.crashsdk.b.B()) {
                                    com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                }
                                V = true;
                                if (Process.myPid() > 0) {
                                }
                            }
                        } else {
                            if (z14) {
                                str = "omit";
                                com.uc.crashsdk.a.a.d("DEBUG", "omit java crash");
                            }
                            nativeClientCreateConnection = com.uc.crashsdk.b.f16349d ? JNIBridge.nativeClientCreateConnection(str, "java", null, 0) : 0L;
                            int i19 = (nativeClientCreateConnection > 0L ? 1 : (nativeClientCreateConnection == 0L ? 0 : -1));
                            if (i19 == 0) {
                                com.uc.crashsdk.a.a.d("DEBUG", "skip java crash:");
                                a(th);
                                if (i19 != 0 && com.uc.crashsdk.b.f16349d) {
                                    JNIBridge.nativeClientCloseConnection(nativeClientCreateConnection);
                                }
                                if (z10) {
                                    try {
                                    } catch (Throwable th13) {
                                        th = th13;
                                        z16 = false;
                                    }
                                    if (g.r() && !z22) {
                                        try {
                                            a(true, false);
                                            z16 = true;
                                        } catch (Throwable th14) {
                                            th = th14;
                                            z16 = true;
                                            com.uc.crashsdk.a.g.a(th);
                                            if (!z16) {
                                            }
                                            f.c(false);
                                            i13 = g.i();
                                            if (!com.uc.crashsdk.a.d.e()) {
                                            }
                                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i13);
                                            if (i13) {
                                            }
                                            if (com.uc.crashsdk.b.B()) {
                                            }
                                            V = true;
                                            if (Process.myPid() > 0) {
                                            }
                                        }
                                        if (!z16 && !z22) {
                                            b(false);
                                        }
                                        f.c(false);
                                        i13 = g.i();
                                        if (!com.uc.crashsdk.a.d.e()) {
                                            i13 = true;
                                        }
                                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i13);
                                        if (i13 && (uncaughtExceptionHandler4 = T) != null) {
                                            uncaughtExceptionHandler4.uncaughtException(thread, th);
                                        }
                                        if (com.uc.crashsdk.b.B() && !z22) {
                                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                        }
                                        V = true;
                                        if (Process.myPid() > 0) {
                                            Process.killProcess(Process.myPid());
                                            return;
                                        }
                                        return;
                                    }
                                }
                                z16 = false;
                                if (!z16) {
                                    b(false);
                                }
                                f.c(false);
                                i13 = g.i();
                                if (!com.uc.crashsdk.a.d.e()) {
                                }
                                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i13);
                                if (i13) {
                                    uncaughtExceptionHandler4.uncaughtException(thread, th);
                                }
                                if (com.uc.crashsdk.b.B()) {
                                    com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                }
                                V = true;
                                if (Process.myPid() > 0) {
                                }
                            } else if (z14) {
                                if (i19 != 0 && com.uc.crashsdk.b.f16349d) {
                                    JNIBridge.nativeClientCloseConnection(nativeClientCreateConnection);
                                }
                                if (z10) {
                                    try {
                                    } catch (Throwable th15) {
                                        th = th15;
                                        z15 = false;
                                    }
                                    if (g.r() && !z22) {
                                        try {
                                            a(true, false);
                                            z15 = true;
                                        } catch (Throwable th16) {
                                            th = th16;
                                            z15 = true;
                                            com.uc.crashsdk.a.g.a(th);
                                            if (!z15) {
                                            }
                                            f.c(false);
                                            i12 = g.i();
                                            if (!com.uc.crashsdk.a.d.e()) {
                                            }
                                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i12);
                                            if (i12) {
                                            }
                                            if (com.uc.crashsdk.b.B()) {
                                            }
                                            V = true;
                                            if (Process.myPid() > 0) {
                                            }
                                        }
                                        if (!z15 && !z22) {
                                            b(false);
                                        }
                                        f.c(false);
                                        i12 = g.i();
                                        if (!com.uc.crashsdk.a.d.e()) {
                                            i12 = true;
                                        }
                                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i12);
                                        if (i12 && (uncaughtExceptionHandler3 = T) != null) {
                                            uncaughtExceptionHandler3.uncaughtException(thread, th);
                                        }
                                        if (com.uc.crashsdk.b.B() && !z22) {
                                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                        }
                                        V = true;
                                        if (Process.myPid() > 0) {
                                            Process.killProcess(Process.myPid());
                                            return;
                                        }
                                        return;
                                    }
                                }
                                z15 = false;
                                if (!z15) {
                                    b(false);
                                }
                                f.c(false);
                                i12 = g.i();
                                if (!com.uc.crashsdk.a.d.e()) {
                                }
                                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i12);
                                if (i12) {
                                    uncaughtExceptionHandler3.uncaughtException(thread, th);
                                }
                                if (com.uc.crashsdk.b.B()) {
                                    com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                }
                                V = true;
                                if (Process.myPid() > 0) {
                                }
                            }
                        }
                        boolean z232 = th instanceof OutOfMemoryError;
                        a(th, str, nativeClientCreateConnection, z232);
                        com.uc.crashsdk.a.a.d("DEBUG", "generate java report finished");
                        if (!com.uc.crashsdk.b.L() && z232 && g.j()) {
                            String name2 = new File(str).getName();
                            String Y22 = g.Y();
                            file = new File(Y22);
                            if (!file.exists()) {
                                file.mkdirs();
                            }
                            String format2 = String.format(Locale.US, "%s%s.hprof", Y22, name2);
                            com.uc.crashsdk.a.a.d("DEBUG", "begin dump hprof: " + format2);
                            long currentTimeMillis2 = System.currentTimeMillis();
                            Debug.dumpHprofData(format2);
                            com.uc.crashsdk.a.a.d("DEBUG", "end dump hprof, use " + (System.currentTimeMillis() - currentTimeMillis2) + " ms");
                        }
                        if (nativeClientCreateConnection != 0 && com.uc.crashsdk.b.f16349d) {
                            JNIBridge.nativeClientCloseConnection(nativeClientCreateConnection);
                        }
                        if (z10) {
                            try {
                            } catch (Throwable th17) {
                                th3 = th17;
                                z17 = false;
                            }
                            if (g.r() && !z22) {
                                try {
                                    a(true, false);
                                    z17 = true;
                                } catch (Throwable th18) {
                                    th3 = th18;
                                    z17 = true;
                                    com.uc.crashsdk.a.g.a(th3);
                                    if (!z17) {
                                    }
                                    f.c(false);
                                    i14 = g.i();
                                    if (!com.uc.crashsdk.a.d.e()) {
                                    }
                                    com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i14);
                                    if (i14) {
                                    }
                                    if (com.uc.crashsdk.b.B()) {
                                    }
                                    V = true;
                                    if (Process.myPid() <= 0) {
                                    }
                                }
                                if (!z17 && !z22) {
                                    b(false);
                                }
                                f.c(false);
                                i14 = g.i();
                                if (!com.uc.crashsdk.a.d.e()) {
                                    i14 = true;
                                }
                                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i14);
                                if (i14 && (uncaughtExceptionHandler5 = T) != null) {
                                    uncaughtExceptionHandler5.uncaughtException(thread, th);
                                }
                                if (com.uc.crashsdk.b.B() && !z22) {
                                    com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                }
                                V = true;
                                if (Process.myPid() <= 0) {
                                    Process.killProcess(Process.myPid());
                                    return;
                                }
                                return;
                            }
                        }
                        z17 = false;
                        if (!z17) {
                            b(false);
                        }
                        f.c(false);
                        i14 = g.i();
                        if (!com.uc.crashsdk.a.d.e()) {
                        }
                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i14);
                        if (i14) {
                            uncaughtExceptionHandler5.uncaughtException(thread, th);
                        }
                        if (com.uc.crashsdk.b.B()) {
                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                        }
                        V = true;
                        if (Process.myPid() <= 0) {
                        }
                    } catch (Throwable th19) {
                        th = th19;
                        try {
                            com.uc.crashsdk.a.a.d("DEBUG", "exception occurs while java log: " + th);
                            a(th);
                            if (!z11) {
                                com.uc.crashsdk.a.a.d("DEBUG", "original exception is: " + th);
                                a(th);
                            }
                            if (j10 != 0 && com.uc.crashsdk.b.f16349d) {
                                JNIBridge.nativeClientCloseConnection(j10);
                            }
                            if (z10) {
                                try {
                                } catch (Throwable th20) {
                                    th2 = th20;
                                    z13 = false;
                                }
                                if (g.r() && !z22) {
                                    try {
                                        a(true, false);
                                        z13 = true;
                                    } catch (Throwable th21) {
                                        th2 = th21;
                                        z13 = true;
                                        com.uc.crashsdk.a.g.a(th2);
                                        if (!z13 && !z22) {
                                            b(false);
                                        }
                                        f.c(false);
                                        i11 = g.i();
                                        if (!com.uc.crashsdk.a.d.e()) {
                                            i11 = true;
                                        }
                                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i11);
                                        if (i11 && (uncaughtExceptionHandler2 = T) != null) {
                                            uncaughtExceptionHandler2.uncaughtException(thread, th);
                                        }
                                        if (com.uc.crashsdk.b.B() && !z22) {
                                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                        }
                                        V = true;
                                        if (Process.myPid() > 0) {
                                            Process.killProcess(Process.myPid());
                                            return;
                                        }
                                        return;
                                    }
                                    if (!z13) {
                                        b(false);
                                    }
                                    f.c(false);
                                    i11 = g.i();
                                    if (!com.uc.crashsdk.a.d.e()) {
                                    }
                                    com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i11);
                                    if (i11) {
                                        uncaughtExceptionHandler2.uncaughtException(thread, th);
                                    }
                                    if (com.uc.crashsdk.b.B()) {
                                        com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                    }
                                    V = true;
                                    if (Process.myPid() > 0) {
                                    }
                                }
                            }
                            z13 = false;
                            if (!z13) {
                            }
                            f.c(false);
                            i11 = g.i();
                            if (!com.uc.crashsdk.a.d.e()) {
                            }
                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i11);
                            if (i11) {
                            }
                            if (com.uc.crashsdk.b.B()) {
                            }
                            V = true;
                            if (Process.myPid() > 0) {
                            }
                        } catch (Throwable th22) {
                            if (j10 != 0 && com.uc.crashsdk.b.f16349d) {
                                JNIBridge.nativeClientCloseConnection(j10);
                            }
                            if (z10) {
                                try {
                                } catch (Throwable th23) {
                                    th = th23;
                                    z12 = false;
                                }
                                if (g.r() && !z22) {
                                    try {
                                        a(true, false);
                                        z12 = true;
                                    } catch (Throwable th24) {
                                        th = th24;
                                        z12 = true;
                                        com.uc.crashsdk.a.g.a(th);
                                        if (!z12 && !z22) {
                                            b(false);
                                        }
                                        f.c(false);
                                        i10 = g.i();
                                        if (!com.uc.crashsdk.a.d.e()) {
                                            i10 = true;
                                        }
                                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i10);
                                        if (i10 && (uncaughtExceptionHandler = T) != null) {
                                            uncaughtExceptionHandler.uncaughtException(thread, th);
                                        }
                                        if (com.uc.crashsdk.b.B() && !z22) {
                                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                        }
                                        V = true;
                                        if (Process.myPid() > 0) {
                                            Process.killProcess(Process.myPid());
                                        }
                                        throw th22;
                                    }
                                    if (!z12) {
                                        b(false);
                                    }
                                    f.c(false);
                                    i10 = g.i();
                                    if (!com.uc.crashsdk.a.d.e()) {
                                    }
                                    com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i10);
                                    if (i10) {
                                        uncaughtExceptionHandler.uncaughtException(thread, th);
                                    }
                                    if (com.uc.crashsdk.b.B()) {
                                        com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                                    }
                                    V = true;
                                    if (Process.myPid() > 0) {
                                    }
                                    throw th22;
                                }
                            }
                            z12 = false;
                            if (!z12) {
                            }
                            f.c(false);
                            i10 = g.i();
                            if (!com.uc.crashsdk.a.d.e()) {
                            }
                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i10);
                            if (i10) {
                            }
                            if (com.uc.crashsdk.b.B()) {
                            }
                            V = true;
                            if (Process.myPid() > 0) {
                            }
                            throw th22;
                        }
                    }
                } else {
                    com.uc.crashsdk.a.a.c("DEBUG", com.uc.crashsdk.a.d.b());
                    if (z10) {
                        try {
                        } catch (Throwable th25) {
                            th = th25;
                            z20 = false;
                        }
                        if (g.r() && !z22) {
                            try {
                                a(true, false);
                                z20 = true;
                            } catch (Throwable th26) {
                                th = th26;
                                z20 = true;
                                com.uc.crashsdk.a.g.a(th);
                                if (!z20) {
                                }
                                f.c(false);
                                i17 = g.i();
                                if (!com.uc.crashsdk.a.d.e()) {
                                }
                                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i17);
                                if (i17) {
                                }
                                if (com.uc.crashsdk.b.B()) {
                                }
                                V = true;
                                if (Process.myPid() > 0) {
                                }
                            }
                            if (!z20 && !z22) {
                                b(false);
                            }
                            f.c(false);
                            i17 = g.i();
                            if (!com.uc.crashsdk.a.d.e()) {
                                i17 = true;
                            }
                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i17);
                            if (i17 && (uncaughtExceptionHandler8 = T) != null) {
                                uncaughtExceptionHandler8.uncaughtException(thread, th);
                            }
                            if (com.uc.crashsdk.b.B() && !z22) {
                                com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                            }
                            V = true;
                            if (Process.myPid() > 0) {
                                Process.killProcess(Process.myPid());
                                return;
                            }
                            return;
                        }
                    }
                    z20 = false;
                    if (!z20) {
                        b(false);
                    }
                    f.c(false);
                    i17 = g.i();
                    if (!com.uc.crashsdk.a.d.e()) {
                    }
                    com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i17);
                    if (i17) {
                        uncaughtExceptionHandler8.uncaughtException(thread, th);
                    }
                    if (com.uc.crashsdk.b.B()) {
                        com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                    }
                    V = true;
                    if (Process.myPid() > 0) {
                    }
                }
            } else {
                com.uc.crashsdk.a.a.d("DEBUG", "another thread is generating java report!");
                com.uc.crashsdk.a.a.d("DEBUG", "current thread exception is:");
                a(th);
                int i20 = 0;
                while (!V) {
                    Thread.sleep(1000L);
                    i20++;
                    if (i20 >= 4) {
                        break;
                    }
                }
                Process.killProcess(Process.myPid());
                if (z10) {
                    try {
                    } catch (Throwable th27) {
                        th = th27;
                        z21 = false;
                    }
                    if (g.r() && !z22) {
                        try {
                            a(true, false);
                            z21 = true;
                        } catch (Throwable th28) {
                            th = th28;
                            z21 = true;
                            com.uc.crashsdk.a.g.a(th);
                            if (!z21) {
                            }
                            f.c(false);
                            i18 = g.i();
                            if (!com.uc.crashsdk.a.d.e()) {
                            }
                            com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i18);
                            if (i18) {
                            }
                            if (com.uc.crashsdk.b.B()) {
                            }
                            V = true;
                            if (Process.myPid() > 0) {
                            }
                        }
                        if (!z21 && !z22) {
                            b(false);
                        }
                        f.c(false);
                        i18 = g.i();
                        if (!com.uc.crashsdk.a.d.e()) {
                            i18 = true;
                        }
                        com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i18);
                        if (i18 && (uncaughtExceptionHandler9 = T) != null) {
                            uncaughtExceptionHandler9.uncaughtException(thread, th);
                        }
                        if (com.uc.crashsdk.b.B() && !z22) {
                            com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                        }
                        V = true;
                        if (Process.myPid() > 0) {
                            Process.killProcess(Process.myPid());
                            return;
                        }
                        return;
                    }
                }
                z21 = false;
                if (!z21) {
                    b(false);
                }
                f.c(false);
                i18 = g.i();
                if (!com.uc.crashsdk.a.d.e()) {
                }
                com.uc.crashsdk.a.a.a("crashsdk", "Call java default handler: " + i18);
                if (i18) {
                    uncaughtExceptionHandler9.uncaughtException(thread, th);
                }
                if (com.uc.crashsdk.b.B()) {
                    com.uc.crashsdk.b.b(com.uc.crashsdk.a.g.a());
                }
                V = true;
                if (Process.myPid() > 0) {
                }
            }
        } catch (Throwable th29) {
            th = th29;
            z11 = false;
            j10 = 0;
        }
    }

    @Override
    public void uncaughtException(Thread thread, Throwable th) {
        a(thread, th, false);
    }
}