package com.ss.android.ugc.aweme.launcher.serviceimpl.godzilla;

import X.C08377s4;
import X.C08727sd;
import X.C08737se;
import X.C08867sr;
import X.FLI;
import X.Lnj;
import X.TnA;
import com.bytedance.covode.number.Covode;
import com.bytedance.frameworks.apm.trace.MethodCollector;
import com.ss.android.ugc.aweme.launcher.service.godzilla.IGodzillaApi;

public final class GodzillaImpl implements IGodzillaApi {
    static {
        Covode.recordClassIndex(90097);
    }

    public static IGodzillaApi LIZIZ() {
        MethodCollector.i(2659);
        IGodzillaApi iGodzillaApi = (IGodzillaApi) Lnj.LIZ(IGodzillaApi.class, false);
        if (iGodzillaApi != null) {
            MethodCollector.o(2659);
            return iGodzillaApi;
        }
        Object LIZIZ = Lnj.LIZIZ(IGodzillaApi.class, false);
        if (LIZIZ != null) {
            IGodzillaApi iGodzillaApi2 = (IGodzillaApi) LIZIZ;
            MethodCollector.o(2659);
            return iGodzillaApi2;
        }
        if (Lnj.LLLLZLLIL == null) {
            synchronized (IGodzillaApi.class) {
                try {
                    if (Lnj.LLLLZLLIL == null) {
                        Lnj.LLLLZLLIL = new GodzillaImpl();
                    }
                } catch (Throwable th) {
                    MethodCollector.o(2659);
                    throw th;
                }
            }
        }
        GodzillaImpl godzillaImpl = (GodzillaImpl) Lnj.LLLLZLLIL;
        MethodCollector.o(2659);
        return godzillaImpl;
    }

    public final void LIZ() {
        if (TnA.LJFF.LIZIZ()) {
            C08737se.LIZ(FLI.LIZ());
        }
        if (!C08737se.LIZ) {
            return;
        }
        if (C08727sd.LIZ != null) {
            C08727sd.LIZ.LIZ(C08867sr.REGISTER_EXCEPTION);
            if (TnA.LJFF.LJFF() && FLI.LIZ() != null) {
                new C08377s4(FLI.LIZ()).LIZ();
                return;
            }
            return;
        }
        throw new RuntimeException("Godzilla.init() method must be called first");
    }
}
