package com.bytedance.bdlocation.traceroute;

import X.4Sh;
import X.C0528K7j;
import android.content.Context;
import android.os.SystemClock;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.bytedance.librarian.Librarian;

public class TraceRoute {
    public static TraceRoute LIZLLL;
    public C0528K7j LIZ;
    public int LIZIZ = 64;
    public int LIZJ = 3;

    public native int execute(String[] strArr);

    static {
        Covode.recordClassIndex(24338);
        long uptimeMillis = SystemClock.uptimeMillis();
        Librarian.LIZ("traceroute-lib", false, (Context) null);
        4Sh.LIZ(uptimeMillis, "traceroute-lib");
    }

    public static TraceRoute LIZ() {
        MethodCollector.i(9750);
        if (LIZLLL == null) {
            synchronized (TraceRoute.class) {
                try {
                    if (LIZLLL == null) {
                        LIZLLL = new TraceRoute();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(9750);
                    throw th;
                }
            }
        }
        TraceRoute traceRoute = LIZLLL;
        MethodCollector.o(9750);
        return traceRoute;
    }

    public void appendResult(String str) {
        C0528K7j k7j = this.LIZ;
        if (k7j != null) {
            k7j.LIZ(str);
        }
    }

    /* JADX WARNING: Can't wrap try/catch for region: R(4:17|18|19|20) */
    /* JADX WARNING: Code restructure failed: missing block: B:18:?, code lost:
        X.C0525K7g.LJ();
        com.bytedance.frameworks.apm.trace.MethodCollector.o(9751);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:20:0x0054, code lost:
        return;
     */
    /* JADX WARNING: Missing exception handler attribute for start block: B:17:0x004d */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public final synchronized void LIZ(java.lang.String r6) {
        /*
            r5 = this;
            monitor-enter(r5)
            r4 = 9751(0x2617, float:1.3664E-41)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r4)     // Catch:{ all -> 0x0055 }
            r0 = 3
            java.lang.String[] r2 = new java.lang.String[r0]     // Catch:{ Exception -> 0x004d }
            r0 = 0
            r2[r0] = r6     // Catch:{ Exception -> 0x004d }
            r1 = 1
            int r0 = r5.LIZJ     // Catch:{ Exception -> 0x004d }
            java.lang.String r0 = java.lang.String.valueOf(r0)     // Catch:{ Exception -> 0x004d }
            r2[r1] = r0     // Catch:{ Exception -> 0x004d }
            r1 = 2
            int r0 = r5.LIZIZ     // Catch:{ Exception -> 0x004d }
            java.lang.String r0 = java.lang.String.valueOf(r0)     // Catch:{ Exception -> 0x004d }
            r2[r1] = r0     // Catch:{ Exception -> 0x004d }
            X.K7l r3 = new X.K7l     // Catch:{ Exception -> 0x004d }
            r3.<init>()     // Catch:{ Exception -> 0x004d }
            int r0 = r5.execute(r2)     // Catch:{ Exception -> 0x004d }
            r3.LIZ = r0     // Catch:{ Exception -> 0x004d }
            int r0 = r3.LIZ     // Catch:{ Exception -> 0x004d }
            if (r0 != 0) goto L_0x003b
            java.lang.String r0 = "execute traceroute successed"
            r3.LIZIZ = r0     // Catch:{ Exception -> 0x004d }
            X.K7j r0 = r5.LIZ     // Catch:{ Exception -> 0x004d }
            r0.LIZ((X.C0530K7l) r3)     // Catch:{ Exception -> 0x004d }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r4)     // Catch:{ Exception -> 0x004d }
            monitor-exit(r5)
            return
        L_0x003b:
            java.lang.String r0 = "execute traceroute failed."
            r3.LIZIZ = r0     // Catch:{ Exception -> 0x004d }
            X.K7j r2 = r5.LIZ     // Catch:{ Exception -> 0x004d }
            int r1 = r3.LIZ     // Catch:{ Exception -> 0x004d }
            java.lang.String r0 = r3.LIZIZ     // Catch:{ Exception -> 0x004d }
            r2.LIZ(r1, r0)     // Catch:{ Exception -> 0x004d }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r4)     // Catch:{ all -> 0x0055 }
            monitor-exit(r5)
            return
        L_0x004d:
            X.C0525K7g.LJ()     // Catch:{ all -> 0x0055 }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r4)     // Catch:{ all -> 0x0055 }
            monitor-exit(r5)
            return
        L_0x0055:
            r0 = move-exception
            monitor-exit(r5)
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.bdlocation.traceroute.TraceRoute.LIZ(java.lang.String):void");
    }
}
