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

import X.2kf;
import X.4Qj;
import X.AnonymousClass7gY;
import X.AnonymousClass9FH;
import X.C07527qh;
import X.C08137rg;
import X.C08717sc;
import X.C11817xc;
import X.C22428Zd;
import X.C22438Ze;
import X.C23428bF;
import X.C23468bJ;
import X.C23478bK;
import X.C23488bL;
import X.C23498bM;
import X.C23508bN;
import X.C23748bl;
import X.C25518ec;
import X.C28728jn;
import X.C29458ky;
import X.C29988lp;
import X.C42869Ft;
import X.C42909Fx;
import X.C43189Gz;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.bytedance.crash.CrashType;
import com.bytedance.crash.Npth;
import com.bytedance.crash.runtime.ConfigManager;
import com.ss.android.ugc.aweme.dynamicfeature.AddInstalledModulesInfoTask;
import com.ss.android.ugc.aweme.launcher.LauncherServiceImpl;
import com.ss.android.ugc.aweme.out.AVExternalServiceImpl;
import com.ss.android.ugc.aweme.services.performance.ICrashReportService;
import java.util.List;

public class NpthExtentTask implements AnonymousClass9FH, C22438Ze {
    static {
        Covode.recordClassIndex(90539);
    }

    public boolean meetTrigger() {
        return true;
    }

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

    public int priority() {
        return 1;
    }

    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 C29988lp threadType() {
        return C29988lp.CPU;
    }

    public C25518ec type() {
        return C25518ec.BACKGROUND;
    }

    public String[] deps() {
        return new String[]{"AccountInitializerTask"};
    }

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

    public void run(Context context) {
        if (!C11817xc.LIZIZ(context).contains("miniapp")) {
            C23508bN.LIZ.lock();
            if (C29458ky.LIZIZ.LIZIZ()) {
                new NpthCoreInitTask().run(context);
            }
            try {
                if (!C43189Gz.LIZLLL.LIZIZ()) {
                    Npth.registerCrashCallback(new C23488bL(context), CrashType.ALL);
                }
                2kf.LIZ("NpthTask");
                C08137rg.LIZ();
                ConfigManager configManager = Npth.getConfigManager();
                LauncherServiceImpl.LIZIZ();
                configManager.setDebugMode(false);
                Npth.setAttachUserData(new C23428bF(context, new AnonymousClass7gY()), CrashType.ALL);
                if (!C43189Gz.LIZLLL.LIZIZ()) {
                    ICrashReportService provideErrorReporter = AVExternalServiceImpl.LIZ().provideErrorReporter();
                    Npth.registerCrashCallback(new C23498bM(provideErrorReporter), CrashType.NATIVE);
                    Npth.registerCrashCallback(new C23478bK(provideErrorReporter), CrashType.JAVA);
                    new AddInstalledModulesInfoTask().run(context);
                    AVExternalServiceImpl.LIZ().provideErrorReporter().addCrashEffectIdInfoListener(C23468bJ.LIZ);
                }
                if (C29458ky.LIZIZ.LIZIZ()) {
                    C23748bl.LIZ(new Runnable() {
                        static {
                            Covode.recordClassIndex(90540);
                        }

                        public final void run() {
                            new C28728jn().run();
                        }
                    }, 200);
                }
                C08717sc.LIZ.LIZ();
                Npth.customActivityName(4Qj.LIZ);
            } finally {
                C23508bN.LIZ.unlock();
            }
        }
    }
}
