package com.bytedance.crash.util;

import X.C27798iI;
import X.C27818iK;
import X.C27908iT;
import X.C28068ij;
import com.bytedance.covode.number.Covode;
import com.bytedance.crash.entity.Header;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;

public class NativeTools {
    public static HashMap<String, String> LIZIZ = new HashMap<>();
    public static NativeTools LIZJ;
    public volatile boolean LIZ;

    public static native void doSetNpthCatchAddr(long j);

    public static native int nativeAnrDump(String str);

    public static native int nativeAnrMonitorInit();

    public static native int nativeAnrMonitorLoop();

    public static native int nativeCloseFile(int i);

    public static native int nativeDumpCrashInfo(String str, String str2, String str3, String str4, String str5, String str6, String str7, boolean z);

    public static native int nativeDumpLogcat(String str, String str2);

    public static native int nativeDumpPthreadList(String str, String str2);

    public static native int nativeDumpThrowable(String str, Throwable th);

    public static native int nativeFillNativeHeapSize(NativeHeapSize nativeHeapSize);

    public static native String nativeGetBuildID(String str);

    public static native int nativeGetFDCount();

    public static native String[] nativeGetFdListForAPM();

    public static native int nativeGetMapsSize(String str);

    public static native String nativeGetOOMReason(String str, String str2);

    public static native long nativeGetPathSize(String str, int i);

    public static native int nativeGetResendSigquit();

    public static native long nativeGetSymbolAddress(String str, String str2, int i);

    public static native long nativeGetThreadCpuTimeMills(int i);

    public static native int nativeGetThreadInfoFromTombStone(String str, String str2);

    public static native boolean nativeIs64BitLibrary();

    public static native int nativeLockFile(String str);

    public static native int nativeOpenFile(String str);

    public static native boolean nativePidExists(int i);

    public static native void nativeSetMallocInfoFunctionAddress(long j);

    public static native void nativeSetResendSigquit(int i);

    public static native int nativeTerminateMonitorWait(long j, String str, String str2, String str3, boolean z, boolean z2, boolean z3);

    public static native int nativeToolsInit(int i, String str);

    public static native int nativeUnlockFile(int i);

    public static native int nativeUpdateEspInfoFromTombStone(String str, String str2);

    public static native int nativeWriteFile(int i, String str, int i2);

    public static void onClearExcept(int[] iArr) {
    }

    public static void onStartAllClear() {
        C27818iK.LJ();
    }

    public final void LIZ(boolean z) {
        MethodCollector.i(13800);
        if (!this.LIZ) {
            MethodCollector.o(13800);
            return;
        }
        try {
            nativeSetResendSigquit(z ? 1 : 0);
            MethodCollector.o(13800);
        } catch (Throwable unused) {
            MethodCollector.o(13800);
        }
    }

    public class NativeHeapSize {
        public long allocate;
        public long free;
        public long total;

        static {
            Covode.recordClassIndex(25255);
        }

        public void print() {
            C27798iI.LJI.isDebugMode();
            C27798iI.LJI.isDebugMode();
            C27798iI.LJI.isDebugMode();
        }

        public NativeHeapSize() {
        }
    }

    static {
        Covode.recordClassIndex(25253);
    }

    public static boolean LJII() {
        if (!Header.LIZIZ()) {
            return true;
        }
        return false;
    }

    public static void onProcessBeWorker() {
        C28068ij.LIZJ(C27798iI.LIZ);
        C27798iI.LJI.isDebugMode();
        C27818iK.LIZLLL();
    }

    public final int LIZIZ() {
        MethodCollector.i(12127);
        if (!this.LIZ) {
            MethodCollector.o(12127);
            return -1;
        }
        try {
            int nativeGetFDCount = nativeGetFDCount();
            MethodCollector.o(12127);
            return nativeGetFDCount;
        } catch (Throwable unused) {
            MethodCollector.o(12127);
            return -1;
        }
    }

    public final int LJ() {
        MethodCollector.i(13023);
        if (!this.LIZ) {
            MethodCollector.o(13023);
            return -1;
        }
        try {
            int nativeAnrMonitorInit = nativeAnrMonitorInit();
            MethodCollector.o(13023);
            return nativeAnrMonitorInit;
        } catch (Throwable unused) {
            MethodCollector.o(13023);
            return -1;
        }
    }

    public final int LJFF() {
        MethodCollector.i(13238);
        if (!this.LIZ) {
            MethodCollector.o(13238);
            return -1;
        }
        try {
            int nativeAnrMonitorLoop = nativeAnrMonitorLoop();
            MethodCollector.o(13238);
            return nativeAnrMonitorLoop;
        } catch (Throwable unused) {
            MethodCollector.o(13238);
            return -1;
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:10:?, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:7:?, code lost:
        com.bytedance.librarian.Librarian.LIZIZ("npth_tools", true, X.C27798iI.LIZ);
        r6.LIZ = true;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:9:?, code lost:
        return;
     */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing exception handler attribute for start block: B:6:0x0020 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public NativeTools() {
        /*
            r6 = this;
            java.lang.String r5 = "npth_tools"
            r6.<init>()
            boolean r0 = r6.LIZ
            if (r0 != 0) goto L_0x0027
            r4 = 1
            long r2 = android.os.SystemClock.uptimeMillis()     // Catch:{ all -> 0x0020 }
            r1 = 0
            r0 = 0
            com.bytedance.librarian.Librarian.LIZIZ(r5, r1, r0)     // Catch:{ all -> 0x0020 }
            X.4Sh.LIZ(r2, r5)     // Catch:{ all -> 0x0020 }
            r6.LIZ = r4     // Catch:{ all -> 0x0020 }
            com.bytedance.crash.util.NativeTools$1 r0 = new com.bytedance.crash.util.NativeTools$1     // Catch:{ all -> 0x0020 }
            r0.<init>()     // Catch:{ all -> 0x0020 }
            X.C29318kk.LIZ = r0     // Catch:{ all -> 0x0020 }
            return
        L_0x0020:
            android.content.Context r0 = X.C27798iI.LIZ     // Catch:{ all -> 0x0027 }
            com.bytedance.librarian.Librarian.LIZIZ(r5, r4, r0)     // Catch:{ all -> 0x0027 }
            r6.LIZ = r4     // Catch:{ all -> 0x0027 }
        L_0x0027:
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.crash.util.NativeTools.<init>():void");
    }

    public final boolean LJI() {
        MethodCollector.i(14023);
        if (!this.LIZ) {
            MethodCollector.o(14023);
            return false;
        }
        try {
            if (nativeGetResendSigquit() != 0) {
                MethodCollector.o(14023);
                return true;
            }
            MethodCollector.o(14023);
            return false;
        } catch (Throwable unused) {
            MethodCollector.o(14023);
            return false;
        }
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(5:4|5|(4:7|8|9|(3:11|(1:13)(1:14)|15))|16|17) */
    /* JADX WARNING: Missing exception handler attribute for start block: B:16:0x0034 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static com.bytedance.crash.util.NativeTools LIZ() {
        /*
            r3 = 13251(0x33c3, float:1.8569E-41)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r3)
            com.bytedance.crash.util.NativeTools r0 = LIZJ
            if (r0 != 0) goto L_0x003c
            java.lang.Class<com.bytedance.crash.util.NativeTools> r2 = com.bytedance.crash.util.NativeTools.class
            monitor-enter(r2)
            com.bytedance.crash.util.NativeTools r0 = LIZJ     // Catch:{ all -> 0x0036 }
            if (r0 != 0) goto L_0x0034
            com.bytedance.crash.util.NativeTools r0 = new com.bytedance.crash.util.NativeTools     // Catch:{ all -> 0x0036 }
            r0.<init>()     // Catch:{ all -> 0x0036 }
            LIZJ = r0     // Catch:{ all -> 0x0036 }
            boolean r0 = r0.LIZ     // Catch:{ all -> 0x0034 }
            if (r0 == 0) goto L_0x0034
            int r1 = android.os.Build.VERSION.SDK_INT     // Catch:{ all -> 0x0034 }
            android.content.Context r0 = X.C27798iI.LIZ     // Catch:{ all -> 0x0034 }
            java.lang.String r0 = com.bytedance.crash.nativecrash.NativeImpl.LIZIZ(r0)     // Catch:{ all -> 0x0034 }
            nativeToolsInit(r1, r0)     // Catch:{ all -> 0x0034 }
            boolean r0 = com.bytedance.crash.nativecrash.NativeImpl.LIZ     // Catch:{ all -> 0x0034 }
            if (r0 != 0) goto L_0x002d
            r0 = 0
            goto L_0x0031
        L_0x002d:
            long r0 = com.bytedance.crash.nativecrash.NativeImpl.doGetNpthCatchAddr()     // Catch:{ all -> 0x0034 }
        L_0x0031:
            doSetNpthCatchAddr(r0)     // Catch:{ all -> 0x0034 }
        L_0x0034:
            monitor-exit(r2)     // Catch:{ all -> 0x0036 }
            goto L_0x003c
        L_0x0036:
            r0 = move-exception
            monitor-exit(r2)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r3)
            throw r0
        L_0x003c:
            com.bytedance.crash.util.NativeTools r0 = LIZJ
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r3)
            return r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.crash.util.NativeTools.LIZ():com.bytedance.crash.util.NativeTools");
    }

    public final List<String> LIZLLL() {
        MethodCollector.i(12817);
        if (!this.LIZ) {
            MethodCollector.o(12817);
            return null;
        }
        try {
            ArrayList arrayList = new ArrayList();
            String[] nativeGetFdListForAPM = nativeGetFdListForAPM();
            if (nativeGetFdListForAPM != null) {
                arrayList.addAll(Arrays.asList(nativeGetFdListForAPM));
            }
            MethodCollector.o(12817);
            return arrayList;
        } catch (Throwable unused) {
            MethodCollector.o(12817);
            return null;
        }
    }

    public final boolean LIZJ() {
        MethodCollector.i(12341);
        if (!this.LIZ) {
            MethodCollector.o(12341);
            return false;
        }
        try {
            boolean nativeIs64BitLibrary = nativeIs64BitLibrary();
            MethodCollector.o(12341);
            return nativeIs64BitLibrary;
        } catch (Throwable unused) {
            MethodCollector.o(12341);
            return false;
        }
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(5:71|72|73|74|75) */
    /* JADX WARNING: Code restructure failed: missing block: B:39:0x008f, code lost:
        return;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:43:0x0093, code lost:
        X.C04097fm.LIZIZ().LIZIZ(X.C27748iD.LJIIIZ);
        X.C27748iD.LIZJ();
        r1 = X.C27748iD.class;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:44:0x00a1, code lost:
        monitor-enter(r1);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:46:?, code lost:
        X.C27748iD.LJI = false;
        X.C27748iD.class.notifyAll();
     */
    /* JADX WARNING: Code restructure failed: missing block: B:47:0x00a9, code lost:
        monitor-exit(r1);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:49:0x00ab, code lost:
        r0 = move-exception;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:51:0x00ad, code lost:
        com.bytedance.frameworks.apm.trace.MethodCollector.o(15189);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:52:0x00b0, code lost:
        throw r0;
     */
    /* JADX WARNING: Code restructure failed: missing block: B:57:0x00b7, code lost:
        X.C04097fm.LIZIZ().LIZ(X.C27748iD.LJIIIZ, 35000);
        X.C04097fm.LIZIZ().LIZ((java.lang.Runnable) new X.C28618jc(), 2000);
     */
    /* JADX WARNING: Missing exception handler attribute for start block: B:74:0x0149 */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static void reportEventForAnrMonitor() {
        /*
            r8 = 15189(0x3b55, float:2.1284E-41)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r8)
            boolean r0 = X.C28458jM.LIZLLL
            r2 = 0
            r7 = 1
            if (r0 == 0) goto L_0x00d5
            java.lang.String r3 = "anr_sigquit"
            java.lang.StringBuilder r1 = new java.lang.StringBuilder
            r1.<init>()
            boolean r0 = X.C27748iD.LJI
            if (r0 == 0) goto L_0x0046
            java.lang.String r0 = "doingTrace"
        L_0x0018:
            r1.append(r0)
            X.8hU r0 = X.C27748iD.LJIIIIZZ
            if (r0 == 0) goto L_0x0043
            java.lang.String r0 = "_HasTraced"
        L_0x0021:
            r1.append(r0)
            java.io.File r0 = X.C27748iD.LJFF
            if (r0 == 0) goto L_0x0040
            java.lang.String r0 = "_HasANRInfo"
        L_0x002a:
            r1.append(r0)
            java.lang.String r0 = r1.toString()
            X.C27858iO.LIZ((java.lang.String) r3, (java.lang.String) r0)
            boolean r0 = X.C27748iD.LJI
            if (r0 != 0) goto L_0x003c
            X.8hU r0 = X.C27748iD.LJIIIIZZ
            if (r0 == 0) goto L_0x0049
        L_0x003c:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            return
        L_0x0040:
            java.lang.String r0 = "_NoANRInfo"
            goto L_0x002a
        L_0x0043:
            java.lang.String r0 = "_NoTraced"
            goto L_0x0021
        L_0x0046:
            java.lang.String r0 = "noDoTrace"
            goto L_0x0018
        L_0x0049:
            long r5 = X.C27748iD.LJ
            r3 = 0
            int r0 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r0 <= 0) goto L_0x005f
            long r5 = java.lang.System.currentTimeMillis()
            long r0 = X.C27748iD.LJ
            long r5 = r5 - r0
            r3 = 100000(0x186a0, double:4.94066E-319)
            int r0 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1))
            if (r0 < 0) goto L_0x00d1
        L_0x005f:
            com.bytedance.crash.util.NativeTools r0 = LIZ()
            boolean r0 = r0.LJI()
            if (r0 == 0) goto L_0x0080
            java.io.File r1 = X.C27748iD.LIZ()     // Catch:{ all -> 0x0078 }
            int r0 = X.C27748iD.LJII     // Catch:{ all -> 0x0078 }
            int r0 = r0 + r7
            java.lang.String r0 = java.lang.String.valueOf(r0)     // Catch:{ all -> 0x0078 }
            X.C27338hY.LIZ((java.io.File) r1, (java.lang.String) r0, (boolean) r2)     // Catch:{ all -> 0x0078 }
            goto L_0x0080
        L_0x0078:
            r3 = move-exception
            X.8in r1 = X.C28338jA.LIZ
            java.lang.String r0 = "NPTH_CATCH"
            r1.LIZ((java.lang.String) r0, (java.lang.Throwable) r3)
        L_0x0080:
            java.lang.Class<X.8iD> r1 = X.C27748iD.class
            monitor-enter(r1)
            boolean r0 = X.C27748iD.LJI     // Catch:{ all -> 0x00b1 }
            if (r0 != 0) goto L_0x008b
            X.8hU r0 = X.C27748iD.LJIIIIZZ     // Catch:{ all -> 0x00b1 }
            if (r0 == 0) goto L_0x0090
        L_0x008b:
            monitor-exit(r1)     // Catch:{ all -> 0x00b1 }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            return
        L_0x0090:
            X.C27748iD.LJI = r7     // Catch:{ all -> 0x00b1 }
            monitor-exit(r1)     // Catch:{ all -> 0x00b1 }
            X.8lI r1 = X.C04097fm.LIZIZ()
            java.lang.Runnable r0 = X.C27748iD.LJIIIZ
            r1.LIZIZ(r0)
            X.C27748iD.LIZJ()
            java.lang.Class<X.8iD> r1 = X.C27748iD.class
            monitor-enter(r1)
            X.C27748iD.LJI = r2     // Catch:{ all -> 0x00ab }
            java.lang.Class<X.8iD> r0 = X.C27748iD.class
            r0.notifyAll()     // Catch:{ all -> 0x00ab }
            monitor-exit(r1)     // Catch:{ all -> 0x00ab }
            goto L_0x00b7
        L_0x00ab:
            r0 = move-exception
            monitor-exit(r1)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            throw r0
        L_0x00b1:
            r0 = move-exception
            monitor-exit(r1)
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            throw r0
        L_0x00b7:
            X.8lI r3 = X.C04097fm.LIZIZ()
            java.lang.Runnable r2 = X.C27748iD.LJIIIZ
            r0 = 35000(0x88b8, double:1.72923E-319)
            r3.LIZ((java.lang.Runnable) r2, (long) r0)
            X.8lI r3 = X.C04097fm.LIZIZ()
            X.8jc r2 = new X.8jc
            r2.<init>()
            r0 = 2000(0x7d0, double:9.88E-321)
            r3.LIZ((java.lang.Runnable) r2, (long) r0)
        L_0x00d1:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            return
        L_0x00d5:
            android.content.Context r0 = X.C27798iI.LIZ
            X.8jz r0 = X.C28848jz.LIZ(r0)
            X.8iE r3 = r0.LIZ     // Catch:{ all -> 0x0173 }
            com.bytedance.crash.util.NativeTools r0 = LIZ()     // Catch:{ all -> 0x0173 }
            boolean r0 = r0.LJI()     // Catch:{ all -> 0x0173 }
            if (r0 == 0) goto L_0x00fe
            java.io.File r1 = r3.LIZJ()     // Catch:{ all -> 0x00f6 }
            int r0 = r3.LJI     // Catch:{ all -> 0x00f6 }
            int r0 = r0 + r7
            java.lang.String r0 = java.lang.String.valueOf(r0)     // Catch:{ all -> 0x00f6 }
            X.C27338hY.LIZ((java.io.File) r1, (java.lang.String) r0, (boolean) r2)     // Catch:{ all -> 0x00f6 }
            goto L_0x00fe
        L_0x00f6:
            r2 = move-exception
            X.8in r1 = X.C28338jA.LIZ     // Catch:{ all -> 0x0173 }
            java.lang.String r0 = "NPTH_CATCH"
            r1.LIZ((java.lang.String) r0, (java.lang.Throwable) r2)     // Catch:{ all -> 0x0173 }
        L_0x00fe:
            X.8jC r0 = r3.LJFF     // Catch:{ all -> 0x0173 }
            r0.LIZ()     // Catch:{ all -> 0x0173 }
            long r0 = android.os.SystemClock.uptimeMillis()     // Catch:{ all -> 0x0173 }
            r3.LIZ((long) r0)     // Catch:{ all -> 0x0173 }
            r0 = -1
            boolean r0 = LJII()     // Catch:{ all -> 0x0173 }
            if (r0 == 0) goto L_0x014f
            java.io.File r5 = X.C27468hl.LIZIZ()     // Catch:{ all -> 0x0173 }
            java.lang.String r1 = "anr_signal_trace"
            java.io.File r0 = r5.getParentFile()     // Catch:{ all -> 0x0173 }
            java.lang.String r0 = r0.getName()     // Catch:{ all -> 0x0173 }
            X.C27858iO.LIZ((java.lang.String) r1, (java.lang.String) r0)     // Catch:{ all -> 0x0173 }
            long r1 = android.os.SystemClock.uptimeMillis()     // Catch:{ all -> 0x0173 }
            java.lang.String r0 = r5.getAbsolutePath()     // Catch:{ all -> 0x0173 }
            nativeAnrDump(r0)     // Catch:{ all -> 0x0173 }
            long r3 = android.os.SystemClock.uptimeMillis()     // Catch:{ all -> 0x0173 }
            long r3 = r3 - r1
            java.lang.String r1 = "after_signal_trace"
            java.io.File r0 = r5.getParentFile()     // Catch:{ all -> 0x0173 }
            java.lang.String r0 = r0.getName()     // Catch:{ all -> 0x0173 }
            X.C27858iO.LIZ((java.lang.String) r1, (java.lang.String) r0)     // Catch:{ all -> 0x0173 }
            java.lang.String r0 = r5.getAbsolutePath()     // Catch:{ all -> 0x0149 }
            org.json.JSONArray r2 = X.C27338hY.LIZ((java.lang.String) r0)     // Catch:{ all -> 0x0149 }
            goto L_0x0158
        L_0x0149:
            org.json.JSONArray r2 = new org.json.JSONArray     // Catch:{ all -> 0x0173 }
            r2.<init>()     // Catch:{ all -> 0x0173 }
            goto L_0x0158
        L_0x014f:
            org.json.JSONArray r2 = new org.json.JSONArray     // Catch:{ all -> 0x0173 }
            r2.<init>()     // Catch:{ all -> 0x0173 }
            r0 = -1
            r3 = -1
        L_0x0158:
            android.content.Context r0 = X.C27798iI.LIZ     // Catch:{ all -> 0x0167 }
            X.8jz r0 = X.C28848jz.LIZ(r0)     // Catch:{ all -> 0x0167 }
            X.8iE r0 = r0.LIZ     // Catch:{ all -> 0x0167 }
            r0.LIZ((org.json.JSONArray) r2, (long) r3)     // Catch:{ all -> 0x0167 }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)     // Catch:{ all -> 0x0173 }
            return
        L_0x0167:
            r2 = move-exception
            X.8in r1 = X.C28338jA.LIZ     // Catch:{ all -> 0x0173 }
            java.lang.String r0 = "NPTH_CATCH"
            r1.LIZ((java.lang.String) r0, (java.lang.Throwable) r2)     // Catch:{ all -> 0x0173 }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            return
        L_0x0173:
            com.bytedance.crash.runtime.ConfigManager r0 = X.C27798iI.LJI
            r0.isDebugMode()
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r8)
            return
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.crash.util.NativeTools.reportEventForAnrMonitor():void");
    }

    public final int LIZ(int i) {
        MethodCollector.i(11915);
        if (!this.LIZ) {
            MethodCollector.o(11915);
            return -1;
        }
        try {
            int nativeCloseFile = nativeCloseFile(i);
            MethodCollector.o(11915);
            return nativeCloseFile;
        } catch (Throwable unused) {
            MethodCollector.o(11915);
            return -1;
        }
    }

    public final long LIZJ(int i) {
        MethodCollector.i(12566);
        if (!this.LIZ) {
            MethodCollector.o(12566);
            return -1;
        }
        try {
            long nativeGetThreadCpuTimeMills = nativeGetThreadCpuTimeMills(i);
            MethodCollector.o(12566);
            return nativeGetThreadCpuTimeMills;
        } catch (Throwable unused) {
            MethodCollector.o(12566);
            return 0;
        }
    }

    public final boolean LJI(String str) {
        MethodCollector.i(13906);
        if (!this.LIZ) {
            MethodCollector.o(13906);
            return false;
        }
        try {
            nativeAnrDump(str);
            MethodCollector.o(13906);
            return true;
        } catch (Throwable unused) {
            MethodCollector.o(13906);
            return false;
        }
    }

    public final String LJIIIIZZ(String str) {
        MethodCollector.i(14138);
        try {
            String nativeGetBuildID = nativeGetBuildID(str);
            MethodCollector.o(14138);
            return nativeGetBuildID;
        } catch (Throwable unused) {
            MethodCollector.o(14138);
            return null;
        }
    }

    public final int LJIIIZ(String str) {
        MethodCollector.i(14140);
        if (!this.LIZ) {
            MethodCollector.o(14140);
            return 0;
        }
        try {
            int nativeGetMapsSize = nativeGetMapsSize(str);
            MethodCollector.o(14140);
            return nativeGetMapsSize;
        } catch (Throwable unused) {
            MethodCollector.o(14140);
            return 0;
        }
    }

    public void setMallocInfoFunc(long j) {
        MethodCollector.i(14985);
        if (!this.LIZ) {
            MethodCollector.o(14985);
            return;
        }
        try {
            nativeSetMallocInfoFunctionAddress(j);
            MethodCollector.o(14985);
        } catch (Throwable unused) {
            MethodCollector.o(14985);
        }
    }

    public final int LIZIZ(int i) {
        MethodCollector.i(12126);
        if (!this.LIZ) {
            MethodCollector.o(12126);
            return -1;
        }
        try {
            int nativeUnlockFile = nativeUnlockFile(i);
            MethodCollector.o(12126);
            return nativeUnlockFile;
        } catch (Throwable unused) {
            MethodCollector.o(12126);
            return -1;
        }
    }

    public final int LIZJ(String str) {
        MethodCollector.i(11210);
        if (!this.LIZ) {
            MethodCollector.o(11210);
            return -1;
        }
        try {
            int nativeDumpCrashInfo = nativeDumpCrashInfo((String) null, (String) null, (String) null, (String) null, (String) null, (String) null, str, false);
            MethodCollector.o(11210);
            return nativeDumpCrashInfo;
        } catch (Throwable unused) {
            MethodCollector.o(11210);
            return -1;
        }
    }

    public final int LIZLLL(String str) {
        MethodCollector.i(11450);
        if (!this.LIZ) {
            MethodCollector.o(11450);
            return -1;
        }
        try {
            int nativeDumpCrashInfo = nativeDumpCrashInfo((String) null, (String) null, (String) null, (String) null, (String) null, str, (String) null, false);
            MethodCollector.o(11450);
            return nativeDumpCrashInfo;
        } catch (Throwable unused) {
            MethodCollector.o(11450);
            return -1;
        }
    }

    public final int LJ(String str) {
        MethodCollector.i(11451);
        if (!this.LIZ) {
            MethodCollector.o(11451);
            return -1;
        }
        try {
            int nativeOpenFile = nativeOpenFile(str);
            MethodCollector.o(11451);
            return nativeOpenFile;
        } catch (Throwable unused) {
            MethodCollector.o(11451);
            return -1;
        }
    }

    public final int LJFF(String str) {
        MethodCollector.i(12125);
        if (!this.LIZ) {
            MethodCollector.o(12125);
            return -1;
        }
        try {
            int nativeLockFile = nativeLockFile(str);
            MethodCollector.o(12125);
            return nativeLockFile;
        } catch (Throwable unused) {
            MethodCollector.o(12125);
            return -1;
        }
    }

    public final int LIZIZ(String str) {
        MethodCollector.i(13253);
        if (!this.LIZ) {
            MethodCollector.o(13253);
            return -1;
        }
        try {
            int nativeDumpCrashInfo = nativeDumpCrashInfo((String) null, (String) null, (String) null, str, (String) null, (String) null, (String) null, false);
            MethodCollector.o(13253);
            return nativeDumpCrashInfo;
        } catch (Throwable unused) {
            MethodCollector.o(13253);
            return -1;
        }
    }

    public static String LJII(String str) {
        StringBuilder sb = new StringBuilder();
        if (str == null) {
            return sb.toString();
        }
        try {
            if (str.length() < 16) {
                sb.append(str);
            } else {
                sb.append(str.charAt(6));
                sb.append(str.charAt(7));
                sb.append(str.charAt(4));
                sb.append(str.charAt(5));
                sb.append(str.charAt(2));
                sb.append(str.charAt(3));
                sb.append(str.charAt(0));
                sb.append(str.charAt(1));
                sb.append(str.charAt(10));
                sb.append(str.charAt(11));
                sb.append(str.charAt(8));
                sb.append(str.charAt(9));
                sb.append(str.charAt(14));
                sb.append(str.charAt(15));
                sb.append(str.charAt(12));
                sb.append(str.charAt(13));
                if (str.length() >= 32) {
                    sb.append(str, 16, 32);
                    sb.append('0');
                }
            }
        } catch (Throwable unused) {
        }
        return sb.toString().toUpperCase();
    }

    public final boolean LIZLLL(int i) {
        MethodCollector.i(14552);
        if (!this.LIZ) {
            MethodCollector.o(14552);
            return false;
        }
        try {
            boolean nativePidExists = nativePidExists(i);
            MethodCollector.o(14552);
            return nativePidExists;
        } catch (Throwable unused) {
            MethodCollector.o(14552);
            return false;
        }
    }

    public final int LIZ(String str) {
        MethodCollector.i(13252);
        if (!this.LIZ) {
            MethodCollector.o(13252);
            return -1;
        }
        try {
            int nativeDumpCrashInfo = nativeDumpCrashInfo((String) null, str, (String) null, (String) null, (String) null, (String) null, (String) null, false);
            MethodCollector.o(13252);
            return nativeDumpCrashInfo;
        } catch (Throwable unused) {
            MethodCollector.o(13252);
            return -1;
        }
    }

    public static void onFindOneDied(int i, String str) {
        C27818iK.LIZ(i, str);
    }

    public final int LIZLLL(String str, String str2) {
        MethodCollector.i(14551);
        if (!this.LIZ) {
            MethodCollector.o(14551);
            return -1;
        }
        try {
            int nativeGetThreadInfoFromTombStone = nativeGetThreadInfoFromTombStone(str, str2);
            MethodCollector.o(14551);
            return nativeGetThreadInfoFromTombStone;
        } catch (Throwable unused) {
            MethodCollector.o(14551);
            return -1;
        }
    }

    public final int LIZ(int i, String str) {
        MethodCollector.i(11677);
        if (!this.LIZ) {
            MethodCollector.o(11677);
            return -1;
        }
        try {
            int nativeWriteFile = nativeWriteFile(i, str, str.length());
            MethodCollector.o(11677);
            return nativeWriteFile;
        } catch (Throwable unused) {
            MethodCollector.o(11677);
            return -1;
        }
    }

    public final String LIZJ(String str, String str2) {
        MethodCollector.i(14352);
        if (!this.LIZ) {
            MethodCollector.o(14352);
            return "UNKNOWN";
        }
        try {
            String nativeGetOOMReason = nativeGetOOMReason(str, str2);
            if (nativeGetOOMReason == null) {
                MethodCollector.o(14352);
                return "UNKNOWN";
            }
            MethodCollector.o(14352);
            return nativeGetOOMReason;
        } catch (Throwable unused) {
            MethodCollector.o(14352);
            return "UNKNOWN";
        }
    }

    public final int LJ(String str, String str2) {
        MethodCollector.i(14772);
        if (!this.LIZ) {
            MethodCollector.o(14772);
            return -1;
        }
        try {
            int nativeUpdateEspInfoFromTombStone = nativeUpdateEspInfoFromTombStone(str, str2);
            MethodCollector.o(14772);
            return nativeUpdateEspInfoFromTombStone;
        } catch (Throwable unused) {
            MethodCollector.o(14772);
            return -1;
        }
    }

    public final void LIZIZ(String str, String str2) {
        MethodCollector.i(14139);
        if (!this.LIZ) {
            MethodCollector.o(14139);
            return;
        }
        try {
            nativeDumpPthreadList(str, str2);
            MethodCollector.o(14139);
        } catch (Throwable unused) {
            MethodCollector.o(14139);
        }
    }

    public final int LIZ(String str, String str2) {
        MethodCollector.i(11212);
        if (!this.LIZ) {
            MethodCollector.o(11212);
            return -1;
        }
        try {
            int nativeDumpLogcat = nativeDumpLogcat(str, str2);
            MethodCollector.o(11212);
            return nativeDumpLogcat;
        } catch (Throwable unused) {
            MethodCollector.o(11212);
            return -1;
        }
    }

    public long getSymbolAddress(String str, String str2, boolean z) {
        int i;
        MethodCollector.i(14773);
        if (!this.LIZ) {
            MethodCollector.o(14773);
            return -1;
        }
        if (z) {
            i = 1;
        } else {
            i = 0;
        }
        try {
            long nativeGetSymbolAddress = nativeGetSymbolAddress(str, str2, i);
            MethodCollector.o(14773);
            return nativeGetSymbolAddress;
        } catch (Throwable unused) {
            MethodCollector.o(14773);
            return 0;
        }
    }

    public final int LIZ(long j, String str, String str2) {
        boolean z;
        boolean z2;
        MethodCollector.i(14350);
        if (!this.LIZ) {
            MethodCollector.o(14350);
            return -1;
        }
        try {
            String LIZJ2 = C28068ij.LIZJ(C27798iI.LIZ);
            boolean LIZIZ2 = C28068ij.LIZIZ(C27798iI.LIZ);
            if (C27908iT.LIZ("custom_event_settings", "npth_simple_setting", "disable_kill_history_data") == 1) {
                z = false;
            } else {
                z = true;
            }
            if (C27908iT.LIZ("custom_event_settings", "npth_simple_setting", "disable_kill_history_subprocess") == 1) {
                z2 = false;
            } else {
                z2 = true;
            }
            int nativeTerminateMonitorWait = nativeTerminateMonitorWait(j, str, str2, LIZJ2, LIZIZ2, z, z2);
            MethodCollector.o(14350);
            return nativeTerminateMonitorWait;
        } catch (Throwable unused) {
            C27798iI.LJI.isDebugMode();
            MethodCollector.o(14350);
            return -1;
        }
    }

    public final void LIZ(String str, String str2, String str3, String str4, String str5) {
        MethodCollector.i(13471);
        nativeDumpCrashInfo(str, str2, str3, str4, str5, (String) null, (String) null, false);
        MethodCollector.o(13471);
    }
}
