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


package com.shizhuang.duapp.common.base.delegate.tasks.net;

import android.annotation.SuppressLint;
import android.text.TextUtils;
import bj1.e;
import com.meituan.robust.ChangeQuickRedirect;
import com.meituan.robust.PatchProxy;
import com.meituan.robust.PatchProxyResult;
import com.meizu.cloud.pushsdk.constants.PushConstants;
import com.shizhuang.dudatastatistics.factory.PoizonAnalyzeFactory;
import io.reactivex.functions.Consumer;
import io.reactivex.functions.Function;
import kotlin.Metadata;
import kotlin.TuplesKt;
import kotlin.collections.MapsKt__MapsJVMKt;
import kotlin.jvm.JvmStatic;
import org.jetbrains.annotations.NotNull;
import org.json.JSONObject;
import retrofit2.http.GET;
import retrofit2.http.Url;
import td.j;

/* compiled from: Ipv4Manager.kt */
public final class Ipv4Manager {
    private static String IPV4_VALUE = "";
    @NotNull

    /* renamed from: a  reason: collision with root package name */
    public static final Ipv4Manager f7452a = new Ipv4Manager();
    public static ChangeQuickRedirect changeQuickRedirect;

    @Metadata(bv = {}, d1 = {"\u0000\u0016\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\bf\u0018\u00002\u00020\u0001J\u0018\u0010\u0005\u001a\b\u0012\u0004\u0012\u00020\u00020\u00042\b\b\u0001\u0010\u0003\u001a\u00020\u0002H'¨\u0006\u0006"}, d2 = {"Lcom/shizhuang/duapp/common/base/delegate/tasks/net/Ipv4Manager$Ipv4Config;", "", "", PushConstants.WEB_URL, "Lbj1/e;", "initIpv4Config", "du-delegate_release"}, k = 1, mv = {1, 4, 2})
    /* compiled from: Ipv4Manager.kt */
    public interface Ipv4Config {
        @GET
        @NotNull
        e<String> initIpv4Config(@Url @NotNull String str);
    }

    /* compiled from: Ipv4Manager.kt */
    public static final class a<T, R> implements Function<String, String> {
        public static final a b = new a();
        public static ChangeQuickRedirect changeQuickRedirect;

        /* Return type fixed from 'java.lang.Object' to match base method */
        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // io.reactivex.functions.Function
        public String apply(String str) {
            String optString;
            String str2 = str;
            PatchProxyResult proxy = PatchProxy.proxy(new Object[]{str2}, this, changeQuickRedirect, false, 1146, new Class[]{String.class}, String.class);
            if (proxy.isSupported) {
                return (String) proxy.result;
            }
            JSONObject optJSONObject = new JSONObject(str2).optJSONObject("data");
            return (optJSONObject == null || (optString = optJSONObject.optString("ipv4")) == null) ? "" : optString;
        }
    }

    /* compiled from: Ipv4Manager.kt */
    public static final class b<T> implements Consumer<String> {
        public static final b b = new b();
        public static ChangeQuickRedirect changeQuickRedirect;

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // io.reactivex.functions.Consumer
        public void accept(String str) {
            String str2 = str;
            if (!PatchProxy.proxy(new Object[]{str2}, this, changeQuickRedirect, false, 1147, new Class[]{String.class}, Void.TYPE).isSupported && !TextUtils.isEmpty(str2)) {
                Ipv4Manager ipv4Manager = Ipv4Manager.f7452a;
                Ipv4Manager.IPV4_VALUE = str2;
                PoizonAnalyzeFactory.a().setGlobalProperties(MapsKt__MapsJVMKt.mapOf(TuplesKt.to("ipvx", str2)));
            }
        }
    }

    /* compiled from: Ipv4Manager.kt */
    public static final class c<T> implements Consumer<Throwable> {
        public static final c b = new c();
        public static ChangeQuickRedirect changeQuickRedirect;

        /* JADX DEBUG: Method arguments types fixed to match base method, original types: [java.lang.Object] */
        @Override // io.reactivex.functions.Consumer
        public void accept(Throwable th2) {
            Throwable th3 = th2;
            if (!PatchProxy.proxy(new Object[]{th3}, this, changeQuickRedirect, false, 1148, new Class[]{Throwable.class}, Void.TYPE).isSupported) {
                th3.printStackTrace();
            }
        }
    }

    @JvmStatic
    @NotNull
    public static final String b() {
        PatchProxyResult proxy = PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 1145, new Class[0], String.class);
        return proxy.isSupported ? (String) proxy.result : IPV4_VALUE;
    }

    @JvmStatic
    @SuppressLint({"CheckResult"})
    public static final void c() {
        if (!PatchProxy.proxy(new Object[0], null, changeQuickRedirect, true, 1144, new Class[0], Void.TYPE).isSupported) {
            ((Ipv4Config) j.getJavaGoApi(Ipv4Config.class)).initIpv4Config("https://ipv4.dewu.com/").subscribeOn(pc.e.g()).map(a.b).subscribe(b.b, c.b);
        }
    }
}