TikTok.apk(点击下载) / E0F.java


package X;

import android.content.Context;
import com.bytedance.android.livesdk.livesetting.pullstream.LiveStreamStrategySdkEnableSetting;
import com.bytedance.android.livesdkapi.host.IHostApp;
import com.bytedance.android.livesdkapi.host.IHostContext;
import com.bytedance.covode.number.Covode;
import com.ss.videoarch.strategy.LiveStrategyManager;
import kotlin.g.b.m;
import org.json.JSONObject;

public final class E0F implements AbstractC30276Bur {
    public static final E0J LIZ = new E0J((byte) 0);
    public static boolean LIZIZ;

    static {
        Covode.recordClassIndex(12978);
    }

    /* JADX WARNING: Removed duplicated region for block: B:22:0x006e A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:25:0x0099 A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:28:0x00ac A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x00c3 A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:34:0x00d6 A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:37:0x00e9 A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:39:0x00f9 A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:40:0x00fb A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:41:0x00fd A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:42:0x00ff A[Catch:{ Exception -> 0x0104 }] */
    /* JADX WARNING: Removed duplicated region for block: B:43:0x0101 A[Catch:{ Exception -> 0x0104 }] */
    @Override // X.AbstractC30276Bur
    public final void LIZ() {
        String str;
        Context applicationContext;
        IHostContext iHostContext;
        try {
            if (!AnonymousClass25P.LIZ(((IHostContext) C524124w.LIZ(IHostContext.class)).context())) {
                return;
            }
        } catch (Throwable unused) {
        }
        if (LiveStreamStrategySdkEnableSetting.INSTANCE.getValue() != 0 && !LIZIZ) {
            if (C524124w.LIZ(IHostApp.class) != null) {
                AbstractC524424z LIZ2 = C524124w.LIZ(IHostApp.class);
                m.LIZIZ(LIZ2, "");
                if (!((IHostApp) LIZ2).isInMusicallyRegion()) {
                    str = "https://hotapi-sg.tiktokv.com";
                    E0G e0g = new E0G();
                    e0g.LIZ = str;
                    e0g.LIZIZ = new E0D();
                    E0L.LIZ().LIZ(e0g.LIZ());
                    JSONObject jSONObject = new JSONObject();
                    IHostContext iHostContext2 = (IHostContext) C524124w.LIZ(IHostContext.class);
                    Integer num = null;
                    jSONObject.put("device_id", iHostContext2 == null ? iHostContext2.getServerDeviceId() : null);
                    AbstractC31784Ce5 LIZIZ2 = C30146Bsl.LIZ().LIZIZ();
                    m.LIZIZ(LIZIZ2, "");
                    jSONObject.put("user_id", String.valueOf(LIZIZ2.LIZJ()));
                    IHostContext iHostContext3 = (IHostContext) C524124w.LIZ(IHostContext.class);
                    jSONObject.put("channel", iHostContext3 == null ? iHostContext3.getChannel() : null);
                    IHostContext iHostContext4 = (IHostContext) C524124w.LIZ(IHostContext.class);
                    jSONObject.put("host_aid", iHostContext4 == null ? Integer.valueOf(iHostContext4.appId()) : null);
                    IHostContext iHostContext5 = (IHostContext) C524124w.LIZ(IHostContext.class);
                    jSONObject.put("app_session_id", iHostContext5 == null ? iHostContext5.getSessionId() : null);
                    IHostContext iHostContext6 = (IHostContext) C524124w.LIZ(IHostContext.class);
                    jSONObject.put("app_version", iHostContext6 == null ? iHostContext6.getVersionName() : null);
                    iHostContext = (IHostContext) C524124w.LIZ(IHostContext.class);
                    if (iHostContext != null) {
                        num = Integer.valueOf(iHostContext.getUpdateVersionCode());
                    }
                    jSONObject.put("update_version_code", String.valueOf(num));
                    LiveStrategyManager inst = LiveStrategyManager.inst();
                    Context context = ((IHostContext) C524124w.LIZ(IHostContext.class)).context();
                    m.LIZIZ(context, "");
                    applicationContext = context.getApplicationContext();
                    if (C16360kz.LIZJ && applicationContext == null) {
                        applicationContext = C16360kz.LIZ;
                    }
                    inst.init(applicationContext, jSONObject);
                    LiveStrategyManager.inst().setAppInfoBundle(new C55132Fi());
                    LiveStrategyManager.inst().setFunctionStartPTYInit(new E0E());
                    LiveStrategyManager.inst().start();
                    LIZIZ = true;
                }
            }
            str = "https://hotapi-va.tiktokv.com";
            E0G e0g2 = new E0G();
            e0g2.LIZ = str;
            e0g2.LIZIZ = new E0D();
            E0L.LIZ().LIZ(e0g2.LIZ());
            JSONObject jSONObject2 = new JSONObject();
            try {
                IHostContext iHostContext22 = (IHostContext) C524124w.LIZ(IHostContext.class);
                Integer num2 = null;
                jSONObject2.put("device_id", iHostContext22 == null ? iHostContext22.getServerDeviceId() : null);
                AbstractC31784Ce5 LIZIZ22 = C30146Bsl.LIZ().LIZIZ();
                m.LIZIZ(LIZIZ22, "");
                jSONObject2.put("user_id", String.valueOf(LIZIZ22.LIZJ()));
                IHostContext iHostContext32 = (IHostContext) C524124w.LIZ(IHostContext.class);
                jSONObject2.put("channel", iHostContext32 == null ? iHostContext32.getChannel() : null);
                IHostContext iHostContext42 = (IHostContext) C524124w.LIZ(IHostContext.class);
                jSONObject2.put("host_aid", iHostContext42 == null ? Integer.valueOf(iHostContext42.appId()) : null);
                IHostContext iHostContext52 = (IHostContext) C524124w.LIZ(IHostContext.class);
                jSONObject2.put("app_session_id", iHostContext52 == null ? iHostContext52.getSessionId() : null);
                IHostContext iHostContext62 = (IHostContext) C524124w.LIZ(IHostContext.class);
                jSONObject2.put("app_version", iHostContext62 == null ? iHostContext62.getVersionName() : null);
                iHostContext = (IHostContext) C524124w.LIZ(IHostContext.class);
                if (iHostContext != null) {
                }
                jSONObject2.put("update_version_code", String.valueOf(num2));
            } catch (Exception e) {
                D9W.LIZ("ALogger", e);
            }
            LiveStrategyManager inst2 = LiveStrategyManager.inst();
            Context context2 = ((IHostContext) C524124w.LIZ(IHostContext.class)).context();
            m.LIZIZ(context2, "");
            applicationContext = context2.getApplicationContext();
            applicationContext = C16360kz.LIZ;
            inst2.init(applicationContext, jSONObject2);
            LiveStrategyManager.inst().setAppInfoBundle(new C55132Fi());
            LiveStrategyManager.inst().setFunctionStartPTYInit(new E0E());
            try {
                LiveStrategyManager.inst().start();
            } catch (Exception e2) {
                D9W.LIZ("ALogger", e2);
            }
            LIZIZ = true;
        }
    }
}