package com.bytedance.vcloud.abrmodule;

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

public class ABRJniLoader {
    public static volatile String exception = "";
    public static volatile boolean isLibraryLoaded;
    public static LibraryLoaderProxy mLibraryLoader;

    /* renamed from: com.bytedance.vcloud.abrmodule.ABRJniLoader$1  reason: invalid class name */
    public static /* synthetic */ class AnonymousClass1 {
        static {
            Covode.recordClassIndex(40160);
        }
    }

    public static class DefaultLoader implements LibraryLoaderProxy {
        static {
            Covode.recordClassIndex(40161);
        }

        public DefaultLoader() {
        }

        public /* synthetic */ DefaultLoader(AnonymousClass1 r1) {
            this();
        }

        public boolean loadLibrary(String str) {
            try {
                INVOKESTATIC_com_bytedance_vcloud_abrmodule_ABRJniLoader$DefaultLoader_com_ss_android_ugc_aweme_lancet_LoadSoLancet_loadLibrary(str);
                return true;
            } catch (Throwable unused) {
                return false;
            }
        }

        public static void INVOKESTATIC_com_bytedance_vcloud_abrmodule_ABRJniLoader$DefaultLoader_com_ss_android_ugc_aweme_lancet_LoadSoLancet_loadLibrary(String str) {
            long uptimeMillis = SystemClock.uptimeMillis();
            Librarian.LIZ(str);
            4Sh.LIZ(uptimeMillis, str);
        }
    }

    static {
        Covode.recordClassIndex(40159);
    }

    public static synchronized boolean loadLibrary() {
        boolean z;
        synchronized (ABRJniLoader.class) {
            MethodCollector.i(9932);
            try {
                if (!isLibraryLoaded) {
                    LibraryLoaderProxy libraryLoaderProxy = mLibraryLoader;
                    if (libraryLoaderProxy == null) {
                        libraryLoaderProxy = new DefaultLoader((AnonymousClass1) null);
                    }
                    isLibraryLoaded = libraryLoaderProxy.loadLibrary("abrmodule");
                }
            } catch (Throwable th) {
                exception = th.toString();
                isLibraryLoaded = false;
            }
            z = isLibraryLoaded;
            MethodCollector.o(9932);
        }
        return z;
    }

    public static void setLoadProxy(LibraryLoaderProxy libraryLoaderProxy) {
        mLibraryLoader = libraryLoaderProxy;
    }
}
