package com.ss.android.ugc.aweme.legoImpl.task;

import X.38l;
import X.3fK;
import X.3h2;
import X.45d;
import X.466;
import X.46U;
import X.46i;
import X.4SD;
import X.4U3;
import X.7nt;
import X.7uv;
import X.8Zb;
import X.8Zd;
import X.8Ze;
import X.8ec;
import X.8ed;
import X.9CU;
import X.9Fh;
import X.9Fi;
import X.9Ft;
import X.9Fx;
import X.9Y3;
import X.C1826Dfy;
import X.C3546EIk;
import X.C4003EZz;
import X.C4110Ebi;
import X.C4269EeH;
import X.C5061Er3;
import X.C5285Euf;
import X.EG4;
import X.EG6;
import X.EGQ;
import X.ESC;
import X.KC2;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.IMandatoryLoginService;
import com.ss.android.ugc.aweme.compliance.api.a;
import com.ss.android.ugc.aweme.im.sdk.common.controller.providedservices.IMService;
import com.ss.android.ugc.aweme.im.service.IIMService;
import com.ss.android.ugc.aweme.lego.wrapper.InitServiceTask;
import com.ss.android.ugc.aweme.legoImp.task.InitServiceSettingTask;
import com.ss.android.ugc.aweme.request_combine.task.FetchCombineSettingsTask;
import com.ss.android.ugc.aweme.requesttask.idle.GeckoCheckInRequest;
import com.ss.android.ugc.aweme.requesttask.idle.GeckoHighPriorityCheckInRequest;
import com.ss.android.ugc.aweme.services.MandatoryLoginService;
import com.ss.android.ugc.aweme.settingsrequest.SettingsRequestServiceImpl;
import java.util.Iterator;
import java.util.List;

public class LegoRequestTask implements 8Ze {
    public static volatile boolean LIZ = true;

    public boolean meetTrigger() {
        return true;
    }

    public String prefix() {
        return "task_";
    }

    public boolean serialExecute() {
        return false;
    }

    public int targetProcess() {
        return 1048575;
    }

    public List triggerOtherLegoComponents() {
        return null;
    }

    public 9Ft triggerType() {
        return 8Zd.LIZ(this);
    }

    public 9Fx scenesType() {
        return 9Fx.DEFAULT;
    }

    public 8ec type() {
        return 8ec.BACKGROUND;
    }

    static {
        Covode.recordClassIndex(90838);
    }

    public String key() {
        return getClass().getSimpleName();
    }

    public void run(Context context) {
        boolean z = LIZ;
        if (z) {
            LIZ = false;
        }
        3fK r1 = new 3fK();
        r1.LIZIZ(46i.LJFF().fetchUserInfoRequest());
        r1.LIZIZ(new 466());
        r1.LIZIZ(new 3h2());
        r1.LIZIZ(46U.LIZ.LIZ());
        r1.LIZIZ(new C4110Ebi());
        r1.LIZIZ(C5285Euf.LIZ.LIZJ());
        r1.LIZIZ(new KC2());
        if (7nt.LIZ() && z) {
            r1.LIZ(new FetchCombineSettingsTask());
        }
        if (7nt.LIZ() || !7uv.LIZ() || !z) {
            r1.LIZIZ(SettingsRequestServiceImpl.LJIIIIZZ().LJI());
        }
        r1.LIZIZ(new 4SD());
        r1.LIZ();
        if (9Y3.LIZ(9Y3.LIZ(), true, "use_new_app_alert", 0) == 1) {
            3fK r12 = new 3fK();
            r12.LIZ(new 9CU());
            r12.LIZ();
        }
        IIMService createIIMServicebyMonsterPlugin = IMService.createIIMServicebyMonsterPlugin(false);
        EGQ relationService = createIIMServicebyMonsterPlugin.getRelationService();
        if (relationService != null) {
            8Zb LIZ2 = relationService.LIZ();
            9Fh r0 = 9Fh.LJIILIIL;
            9Fi r02 = new 9Fi();
            r02.LIZ(LIZ2);
            r02.LIZ();
        }
        IMandatoryLoginService createIMandatoryLoginServicebyMonsterPlugin = MandatoryLoginService.createIMandatoryLoginServicebyMonsterPlugin(false);
        if (38l.LJIIL.LIZ().LIZJ() != 0 && createIMandatoryLoginServicebyMonsterPlugin.shouldShowForcedLogin() && !createIMandatoryLoginServicebyMonsterPlugin.getHasRequestComplianceApi()) {
            createIMandatoryLoginServicebyMonsterPlugin.setHasRequestComplianceApi(true);
            3fK r2 = new 3fK();
            r2.LIZ(new 45d(8ed.NORMAL));
            r2.LIZ();
        }
        a.LJIIZILJ().LIZ();
        4U3 r6 = new 4U3();
        r6.LIZ(new GeckoHighPriorityCheckInRequest());
        r6.LIZ(new GeckoCheckInRequest());
        r6.LIZ(new InitServiceSettingTask());
        C4269EeH familiarService = createIIMServicebyMonsterPlugin.getFamiliarService();
        if (familiarService != null) {
            r6.LIZ(familiarService.LIZIZ());
        }
        C3546EIk systemEmojiService = createIIMServicebyMonsterPlugin.getSystemEmojiService();
        if (systemEmojiService != null) {
            r6.LIZ(new InitServiceTask(systemEmojiService.LIZ(), 1048575, 8ec.BOOT_FINISH));
        }
        r6.LIZ();
        if (46i.LJFF().isLogin() && !ESC.LIZLLL() && 9Y3.LIZ(9Y3.LIZ(), true, "inbox_has_top_msg", false)) {
            EG4 eg4 = (EG4) EG6.LIZ.LIZ(EG4.class);
            if (eg4 != null) {
                eg4.LIZIZ("");
                eg4.LIZLLL("");
                eg4.LJFF("");
                eg4.LJII("");
                eg4.LJIIIZ("");
                eg4.LJIIJJI("");
            }
            3fK r13 = new 3fK();
            r13.LIZ(C5061Er3.LIZ.LJIIIIZZ());
            r13.LIZ();
        }
        List<8Zb> LIZ3 = C1826Dfy.LIZ.LIZ();
        9Fh r03 = 9Fh.LJIILIIL;
        9Fi r22 = new 9Fi();
        Iterator<8Zb> it = LIZ3.iterator();
        while (it.hasNext()) {
            r22.LIZ(it.next());
        }
        Iterator<8Zb> it2 = C4003EZz.LIZ.LJ().iterator();
        while (it2.hasNext()) {
            r22.LIZ(it2.next());
        }
        r22.LIZ();
    }
}
