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

import X.4Sh;
import X.AnonymousClass87C;
import X.C11817xc;
import X.C22428Zd;
import X.C22438Ze;
import X.C25518ec;
import X.C29458ky;
import X.C29728lP;
import X.C29918li;
import X.C29998lq;
import X.C42869Ft;
import X.C42909Fx;
import android.app.Application;
import android.content.Context;
import android.os.SystemClock;
import android.text.TextUtils;
import com.bytedance.covode.number.Covode;
import com.bytedance.crash.Npth;
import com.bytedance.librarian.Librarian;
import java.util.List;

public class NpthCoreInitTask implements C22438Ze {
    static {
        Covode.recordClassIndex(90537);
    }

    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 C42869Ft triggerType() {
        return C22428Zd.LIZ(this);
    }

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

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

    public C25518ec type() {
        if (C29458ky.LIZIZ.LIZJ()) {
            return C25518ec.MAIN;
        }
        return C25518ec.BACKGROUND;
    }

    public void run(Context context) {
        Npth.setApplication((Application) context);
        if (!C11817xc.LIZIZ(context).contains("miniapp")) {
            String LIZIZ = C11817xc.LIZIZ(context);
            String str = null;
            if (!TextUtils.isEmpty(LIZIZ) && LIZIZ.contains("bm")) {
                str = "3902";
            }
            if (!C29918li.LIZ.LIZ() && C29998lq.LIZIZ.LIZ() && (C29728lP.LJII.LIZ() & C29728lP.LIZIZ) == C29728lP.LIZIZ) {
                Npth.setNpthStartEventDelayTime(5000);
            } else if (!C29918li.LIZ.LIZ() && C29998lq.LIZIZ.LIZ() && (C29728lP.LJII.LIZ() & C29728lP.LIZJ) == C29728lP.LIZJ) {
                Npth.setNpthStartEventDelayTime(7000);
            }
            Npth.init(context, new AnonymousClass87C(str), true, true, true);
            if (!((Boolean) C29458ky.LIZ.getValue()).booleanValue()) {
                long uptimeMillis = SystemClock.uptimeMillis();
                Librarian.LIZ("npth_tools");
                4Sh.LIZ(uptimeMillis, "npth_tools");
            }
        }
    }
}
