得物.apk(点击下载) / f.java


package qc;

import android.text.TextUtils;
import androidx.annotation.Nullable;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.shizhuang.duapp.common.bean.IMEnvConfig;
import com.tencent.mmkv.MMKV;
import df.c0;
import he.a;
import java.util.ArrayList;
import java.util.List;
import wb.c;

/* compiled from: SCHttpFactory */
public final class f {

    /* renamed from: a  reason: collision with root package name */
    public static List<a> f37330a;
    public static ChangeQuickRedirect changeQuickRedirect;
    private static int hostIndex;

    static {
        ArrayList arrayList = new ArrayList();
        f37330a = arrayList;
        arrayList.add(new d());
        g();
        g();
    }

    public static String a() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2676, new Class[0], String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        if (hostIndex >= f37330a.size()) {
            a.l lVar = a.f33009h;
            StringBuilder h12 = a.f.h("HOST_LIST:");
            h12.append(f37330a);
            lVar.i("httpconfig", h12.toString());
            hostIndex = 0;
        }
        return f37330a.get(hostIndex).c().get("PHP");
    }

    public static a b() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2679, new Class[0], a.class);
        if (proxy.isSupported) {
            return (a) proxy.result;
        }
        return (a) ((ArrayList) f37330a).get(hostIndex);
    }

    public static String c() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2680, new Class[0], String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        if (c0.a(c.a())) {
            return "https://m.dewu.com/";
        }
        return c.a();
    }

    public static int d() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2674, new Class[0], Integer.TYPE);
        return proxy.isSupported ? ((Integer) proxy.result).intValue() : hostIndex;
    }

    @Nullable
    public static IMEnvConfig e() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2681, new Class[0], IMEnvConfig.class);
        if (proxy.isSupported) {
            return (IMEnvConfig) proxy.result;
        }
        if (hostIndex >= ((ArrayList) f37330a).size()) {
            hostIndex = 0;
        }
        return ((a) ((ArrayList) f37330a).get(hostIndex)).b();
    }

    public static String f() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2677, new Class[0], String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        if (hostIndex >= ((ArrayList) f37330a).size()) {
            hostIndex = 0;
        }
        return ((a) ((ArrayList) f37330a).get(hostIndex)).c().get("JAVA");
    }

    public static String g() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2678, new Class[0], String.class);
        if (proxy.isSupported) {
            return (String) proxy.result;
        }
        if (TextUtils.isEmpty(c.d())) {
            return a();
        }
        return c.d();
    }

    public static void h() {
        Object obj;
        Object obj2;
        if (!PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2672, new Class[0], Void.TYPE).isSupported) {
            if (a.f33006a) {
                Integer num = 0;
                PatchProxyResult proxy = PatchProxy.proxy(new Object[]{"sp_key_host_index", num}, null, fe.a.changeQuickRedirect, true, 6633, new Class[]{String.class, Object.class}, Object.class);
                if (proxy.isSupported) {
                    obj = proxy.result;
                } else {
                    PatchProxyResult proxy2 = PatchProxy.proxy(new Object[]{"sp_key_host_index", num, null}, null, fe.a.changeQuickRedirect, true, 6634, new Class[]{String.class, Object.class, String.class}, Object.class);
                    if (proxy2.isSupported) {
                        obj2 = proxy2.result;
                    } else {
                        MMKV a5 = fe.a.a(null);
                        if (num instanceof String) {
                            obj2 = a5.getString("sp_key_host_index", (String) num);
                        } else if (num instanceof Integer) {
                            obj2 = Integer.valueOf(a5.getInt("sp_key_host_index", num.intValue()));
                        } else if (num instanceof Boolean) {
                            obj2 = Boolean.valueOf(a5.getBoolean("sp_key_host_index", ((Boolean) num).booleanValue()));
                        } else if (num instanceof Float) {
                            obj2 = Float.valueOf(a5.getFloat("sp_key_host_index", ((Float) num).floatValue()));
                        } else if (num instanceof Long) {
                            obj2 = Long.valueOf(a5.getLong("sp_key_host_index", ((Long) num).longValue()));
                        } else {
                            boolean z = num instanceof Double;
                            obj2 = num;
                            if (z) {
                                obj2 = Double.valueOf(a5.decodeDouble("sp_key_host_index", ((Double) num).doubleValue()));
                            }
                        }
                    }
                    obj = obj2;
                }
                hostIndex = ((Integer) obj).intValue();
                a.l lVar = a.f33009h;
                StringBuilder h12 = a.f.h("hostIndex:");
                h12.append(hostIndex);
                lVar.i("httpconfig", h12.toString());
                return;
            }
            hostIndex = 0;
        }
    }

    public static boolean i() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2682, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        return hostIndex == 0;
    }

    public static boolean j() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 2683, new Class[0], Boolean.TYPE);
        if (proxy.isSupported) {
            return ((Boolean) proxy.result).booleanValue();
        }
        return hostIndex == 1;
    }
}