package com.bytedance.sysoptimizer.fake.name;

import android.os.Build;
import com.bytedance.covode.number.Covode;

public class SmFakeNameHandler {
    public static String TAG = "SYSOPTIMIZER";
    public static volatile boolean inited;

    public static native void replace(int i);

    static {
        Covode.recordClassIndex(38439);
    }

    public static boolean inAndroid5x() {
        if (Build.VERSION.SDK_INT == 22 || Build.VERSION.SDK_INT == 21) {
            return true;
        }
        return false;
    }

    public static boolean shouldFix() {
        if (!inAndroid5x() || !Build.MODEL.startsWith("SM-")) {
            return false;
        }
        return true;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:26:?, code lost:
        com.bytedance.frameworks.apm.trace.MethodCollector.o(15418);
     */
    /* JADX WARNING: Code restructure failed: missing block: B:28:0x0033, code lost:
        return;
     */
    /* JADX WARNING: Exception block dominator not found, dom blocks: [B:25:0x002f, B:29:0x0034] */
    /* JADX WARNING: Missing exception handler attribute for start block: B:25:0x002f */
    /* JADX WARNING: Missing exception handler attribute for start block: B:29:0x0034 */
    /* JADX WARNING: Unknown top exception splitter block from list: {B:29:0x0034=Splitter:B:29:0x0034, B:25:0x002f=Splitter:B:25:0x002f} */
    /* Code decompiled incorrectly, please refer to instructions dump. */
    public static synchronized void start(android.content.Context r3) {
        /*
            java.lang.Class<com.bytedance.sysoptimizer.fake.name.SmFakeNameHandler> r2 = com.bytedance.sysoptimizer.fake.name.SmFakeNameHandler.class
            monitor-enter(r2)
            r1 = 15418(0x3c3a, float:2.1605E-41)
            com.bytedance.frameworks.apm.trace.MethodCollector.i(r1)     // Catch:{ all -> 0x0039 }
            boolean r0 = shouldFix()     // Catch:{ all -> 0x0039 }
            if (r0 != 0) goto L_0x0013
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r1)     // Catch:{ all -> 0x0039 }
            monitor-exit(r2)
            return
        L_0x0013:
            boolean r0 = inited     // Catch:{ all -> 0x0039 }
            if (r0 == 0) goto L_0x001c
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r1)     // Catch:{ all -> 0x0039 }
            monitor-exit(r2)
            return
        L_0x001c:
            r0 = 1
            inited = r0     // Catch:{ all -> 0x0039 }
            boolean r0 = com.bytedance.sysoptimizer.SysOptimizer.loadOptimizerLibrary(r3)     // Catch:{ all -> 0x0039 }
            if (r0 == 0) goto L_0x0034
            int r0 = android.os.Build.VERSION.SDK_INT     // Catch:{ UnsatisfiedLinkError -> 0x002f, NoSuchMethodError -> 0x0034 }
            replace(r0)     // Catch:{ UnsatisfiedLinkError -> 0x002f, NoSuchMethodError -> 0x0034 }
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r1)     // Catch:{ all -> 0x0039 }
            monitor-exit(r2)
            return
        L_0x002f:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r1)     // Catch:{ all -> 0x0039 }
            monitor-exit(r2)
            return
        L_0x0034:
            com.bytedance.frameworks.apm.trace.MethodCollector.o(r1)     // Catch:{ all -> 0x0039 }
            monitor-exit(r2)
            return
        L_0x0039:
            r0 = move-exception
            monitor-exit(r2)
            throw r0
        */
        throw new UnsupportedOperationException("Method not decompiled: com.bytedance.sysoptimizer.fake.name.SmFakeNameHandler.start(android.content.Context):void");
    }
}
