package com.google.android.play.core.e;

import X.4Sh;
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;
import java.io.File;

public final class b {
    public static final com.google.android.play.core.b.b LIZ = new com.google.android.play.core.b.b("SplitInstallHelper");

    static {
        Covode.recordClassIndex(44360);
    }

    public static void LIZ(Context context, String str) {
        MethodCollector.i(11479);
        synchronized (ag.class) {
            try {
                long uptimeMillis = SystemClock.uptimeMillis();
                Librarian.LIZ(str);
                4Sh.LIZ(uptimeMillis, str);
            } catch (UnsatisfiedLinkError e) {
                String str2 = context.getApplicationInfo().nativeLibraryDir;
                String mapLibraryName = System.mapLibraryName(str);
                StringBuilder sb = new StringBuilder(String.valueOf(str2).length() + 1 + String.valueOf(mapLibraryName).length());
                sb.append(str2);
                sb.append("/");
                sb.append(mapLibraryName);
                String sb2 = sb.toString();
                if (new File(sb2).exists()) {
                    System.load(sb2);
                } else {
                    MethodCollector.o(11479);
                    throw e;
                }
            } catch (Throwable th) {
                MethodCollector.o(11479);
                throw th;
            }
        }
        MethodCollector.o(11479);
    }
}
