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

import X.AnonymousClass7U8;
import X.AnonymousClass8LH;
import X.AnonymousClass8RH;
import X.AnonymousClass9Y3;
import X.C07527qh;
import X.C09537tw;
import X.C11817xc;
import X.C22428Zd;
import X.C22438Ze;
import X.C22788aD;
import X.C25518ec;
import X.C42869Ft;
import X.C42909Fx;
import X.ESC;
import X.FLI;
import android.app.Application;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.ss.android.ugc.aweme.services.MainServiceForPush;
import java.util.List;

public class InitPushTask implements C22438Ze {
    static {
        Covode.recordClassIndex(90473);
    }

    public boolean meetTrigger() {
        return true;
    }

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

    public boolean serialExecute() {
        return false;
    }

    public List triggerOtherLegoComponents() {
        return null;
    }

    public C42869Ft triggerType() {
        return C22428Zd.LIZ(this);
    }

    public C42909Fx scenesType() {
        return C42909Fx.DEFAULT;
    }

    public int targetProcess() {
        return C07527qh.LIZ;
    }

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

    public static boolean LIZ() {
        if (AnonymousClass8LH.LIZIZ.LIZ() || AnonymousClass9Y3.LIZ(AnonymousClass9Y3.LIZ(), true, "push_init_optimize_enable", false)) {
            return true;
        }
        return false;
    }

    public C25518ec type() {
        Application LIZ = FLI.LIZ();
        if (LIZ == null || C11817xc.LIZ(LIZ)) {
            return C25518ec.BACKGROUND;
        }
        return C25518ec.MAIN;
    }

    public void run(Context context) {
        if (LIZ()) {
            LIZ(context);
        }
    }

    public static void LIZ(Context context) {
        boolean LIZLLL;
        if (C11817xc.LIZ(context)) {
            if (AnonymousClass8RH.LIZLLL) {
                C22788aD.LIZ(5000);
            }
        } else if (!AnonymousClass7U8.LIZ(context, C11817xc.LIZIZ(context))) {
            return;
        }
        if (AnonymousClass9Y3.LIZ(AnonymousClass9Y3.LIZ(), true, "push_childer_mode_optimize_enable", true)) {
            LIZLLL = ESC.LJ();
        } else {
            LIZLLL = ESC.LIZLLL();
        }
        if (!LIZLLL) {
            C09537tw.LIZ().init(context, new MainServiceForPush());
        } else {
            C09537tw.LIZ().initMessageDepend();
        }
    }
}
