package com.ss.android.ugc.aweme.i18n.xbridge.worker;

import X.C0499K6g;
import X.C0808KId;
import X.C0809KIe;
import X.C0811KIg;
import X.C0813KIi;
import X.C4672Lnj;
import X.Hhv;
import X.ISg;
import X.ISq;
import X.ISr;
import X.ISs;
import X.ISt;
import X.K75;
import X.KCX;
import X.KJL;
import X.KJM;
import X.M12;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.specact.api.IBDXBridgeService;

public final class BDXBridgeHelper implements IBDXBridgeService {
    static {
        Covode.recordClassIndex(83609);
    }

    public static IBDXBridgeService LIZ() {
        MethodCollector.i(17524);
        IBDXBridgeService iBDXBridgeService = (IBDXBridgeService) C4672Lnj.LIZ(IBDXBridgeService.class, false);
        if (iBDXBridgeService != null) {
            MethodCollector.o(17524);
            return iBDXBridgeService;
        }
        Object LIZIZ = C4672Lnj.LIZIZ(IBDXBridgeService.class, false);
        if (LIZIZ != null) {
            IBDXBridgeService iBDXBridgeService2 = (IBDXBridgeService) LIZIZ;
            MethodCollector.o(17524);
            return iBDXBridgeService2;
        }
        if (C4672Lnj.LLLIILIL == null) {
            synchronized (IBDXBridgeService.class) {
                try {
                    if (C4672Lnj.LLLIILIL == null) {
                        C4672Lnj.LLLIILIL = new BDXBridgeHelper();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(17524);
                    throw th;
                }
            }
        }
        BDXBridgeHelper bDXBridgeHelper = (BDXBridgeHelper) C4672Lnj.LLLIILIL;
        MethodCollector.o(17524);
        return bDXBridgeHelper;
    }

    public final KJL LIZ(String str, String str2) {
        M12.LIZ((Object) str, (Object) str2);
        M12.LIZ((Object) str, (Object) str2);
        KJL kjl = new KJL();
        C0809KIe kIe = new C0809KIe(str);
        String valueOf = String.valueOf(kIe.hashCode());
        M12.LIZ((Object) kIe);
        KJM kjm = kjl.LIZ.LIZ;
        kjm.LIZJ = kIe;
        kjm.LIZ((C0813KIi) new C0811KIg(kjm));
        for (C0813KIi LIZ : kjm.LJFF) {
            LIZ.LIZ();
        }
        kjm.LJ = valueOf;
        kjm.LIZ(ISr.Worker);
        kjl.LIZLLL.LIZ = valueOf;
        kjl.LIZLLL.LIZ(kjl);
        kjl.LIZLLL.LIZIZ(Hhv.class, new C0808KId(valueOf));
        ISt iSt = kjl.LIZ.LIZ.LJII;
        iSt.LIZ(kjl.LIZLLL);
        kjl.LIZ.LIZ(iSt);
        K75.LIZ.LIZ();
        for (ISg iSg : KCX.LIZ(C0499K6g.LIZ)) {
            ISr iSr = ISr.ALL;
            M12.LIZ((Object) iSg, (Object) iSr);
            ISt iSt2 = kjl.LIZ.LIZ.LJII;
            M12.LIZ((Object) iSg, (Object) iSr);
            ISq iSq = iSt2.LIZ;
            M12.LIZ((Object) iSg, (Object) iSr);
            if (ISs.LIZ[iSr.ordinal()] != 1) {
                iSq.LIZ(iSr).put(iSg.LIZ(), iSg);
            } else {
                iSq.LIZ(ISr.WEB).put(iSg.LIZ(), iSg);
                iSq.LIZ(ISr.LYNX).put(iSg.LIZ(), iSg);
                iSq.LIZ(ISr.Worker).put(iSg.LIZ(), iSg);
                iSq.LIZ(ISr.ALL).put(iSg.LIZ(), iSg);
            }
        }
        return kjl;
    }
}
