package com.ss.android.ugc.aweme.net;

import X.0Gp;
import X.2kf;
import X.AnonymousClass8B3;
import X.AnonymousClass9HT;
import X.AnonymousClass9HU;
import X.AnonymousClass9KG;
import X.C22428Zd;
import X.C22438Ze;
import X.C25348eL;
import X.C25518ec;
import X.C28338jA;
import X.C42869Ft;
import X.C42909Fx;
import X.C43089Gp;
import X.C43189Gz;
import X.C43199Ha;
import X.PhE;
import android.content.Context;
import com.bytedance.covode.number.Covode;
import com.bytedance.keva.Keva;
import com.ss.android.ugc.aweme.network.INetwork;
import java.util.List;
import java.util.concurrent.ExecutorService;
import kotlin.h.b.n;

public final class NetworkInitTask implements C22438Ze {
    static {
        Covode.recordClassIndex(94642);
    }

    public final boolean meetTrigger() {
        return true;
    }

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

    public final boolean serialExecute() {
        return false;
    }

    public final int targetProcess() {
        return 1048575;
    }

    public final List triggerOtherLegoComponents() {
        return null;
    }

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

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

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

    public final C25518ec type() {
        if (((Boolean) C43189Gz.LIZIZ.getValue()).booleanValue()) {
            return C25518ec.BACKGROUND;
        }
        return C25518ec.MAIN;
    }

    public final void run(Context context) {
        ExecutorService LIZ;
        if (Keva.getRepo("ab_repo_cold_boot").getBoolean("network_set_rxjava_error_handler", true)) {
            try {
                if (PhE.LIZ == null) {
                    PhE.LIZ(new AnonymousClass9HU(this));
                }
            } catch (Throwable th) {
                0Gp.LIZ(new AnonymousClass9HT(this, th));
            }
        }
        INetwork LIZ2 = C43199Ha.LIZ();
        AnonymousClass9KG r2 = new AnonymousClass9KG(this);
        if (!AnonymousClass8B3.LJIILIIL.LJIILIIL() || !((Boolean) C43089Gp.LIZIZ.getValue()).booleanValue()) {
            LIZ = C25348eL.LIZ();
        } else {
            LIZ = C25348eL.LIZIZ();
        }
        n.LIZIZ(LIZ, "");
        LIZ2.LIZ(r2, LIZ);
    }

    public final void LIZ(String str, Throwable th) {
        2kf.LIZ(th);
        C28338jA.LIZ(th, str + " " + th.getMessage());
    }
}
