小红书.apk(点击下载) / p0.java


package xo2;

import a23.u2;
import android.app.Application;
import android.content.Context;
import android.os.SystemClock;
import com.alibaba.alibclinkpartner.linkpartner.constants.ALPParamConstant;
import com.google.android.gms.common.GoogleApiAvailabilityLight;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.xingin.shield.http.XhsHttpInterceptor;
import com.xingin.utils.XYUtilsCenter;
import com.xingin.utils.async.run.task.XYRunnable;
import com.xingin.xhs.develop.bugreport.BugReporter;
import com.xingin.xhs.develop.net.NetSettingActivity;
import d02.d;
import fv2.d;
import gp2.z;
import hl2.u;
import ie2.c;
import java.lang.reflect.Type;
import java.net.InetAddress;
import java.security.GeneralSecurityException;
import java.util.HashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.Executor;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;
import jo2.d0;
import jo2.r;
import kotlin.Metadata;
import kotlin.Unit;
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
import kotlin.collections.CollectionsKt__CollectionsKt;
import kotlin.jvm.JvmClassMappingKt;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.Lambda;
import kotlin.text.StringsKt__StringsJVMKt;
import okhttp3.ConnectionPool;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.internal.Util;
import okhttp3.internal.platform.Platform;
import okhttp3.logging.HttpLoggingInterceptor;
import oz1.c;
import tz1.a;
import tz1.b;
import uz1.a;
import w13.t2;

@Metadata(bv = {}, d1 = {"\u0000–\u0001\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\b\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\bÆ\u0002\u0018\u00002\u00020\u0001B\t\b\u0002¢\u0006\u0004\bD\u0010EJ\u0006\u0010\u0003\u001a\u00020\u0002J\u0006\u0010\u0005\u001a\u00020\u0004J\b\u0010\u0007\u001a\u0004\u0018\u00010\u0006J\b\u0010\b\u001a\u0004\u0018\u00010\u0006J\u0006\u0010\t\u001a\u00020\u0002J\u000e\u0010\f\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\nJ\b\u0010\r\u001a\u00020\u0002H\u0002J\b\u0010\u000e\u001a\u00020\u0002H\u0002J\b\u0010\u000f\u001a\u00020\u0002H\u0002J\b\u0010\u0010\u001a\u00020\u0002H\u0002J\u0010\u0010\u0013\u001a\u00020\u00112\u0006\u0010\u0012\u001a\u00020\u0011H\u0002J\u0010\u0010\u0015\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\u0014H\u0002J\u0010\u0010\u0018\u001a\u00020\u00172\u0006\u0010\u0016\u001a\u00020\u0004H\u0002J\u0010\u0010\u001a\u001a\u00020\u00022\u0006\u0010\u0019\u001a\u00020\u0004H\u0002J\b\u0010\u001b\u001a\u00020\u0002H\u0002J\u0010\u0010\u001c\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\nH\u0002J\u0010\u0010\u001d\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\nH\u0002J\b\u0010\u001e\u001a\u00020\u0002H\u0002J\b\u0010\u001f\u001a\u00020\u0002H\u0002J\u0012\u0010#\u001a\u0004\u0018\u00010\"2\u0006\u0010!\u001a\u00020 H\u0002J\u0010\u0010&\u001a\u00020%2\u0006\u0010$\u001a\u00020\u0011H\u0002J\u0010\u0010)\u001a\u00020(2\u0006\u0010'\u001a\u00020\u0011H\u0002J\b\u0010*\u001a\u00020\u0017H\u0002J\b\u0010+\u001a\u00020\u0017H\u0002J0\u00106\u001a\u00020\u00022\u0006\u0010-\u001a\u00020,2\u0006\u0010/\u001a\u00020.2\u0006\u00101\u001a\u0002002\u0006\u00103\u001a\u0002022\u0006\u00105\u001a\u000204H\u0002J0\u00107\u001a\u00020\u00022\u0006\u0010-\u001a\u00020,2\u0006\u0010/\u001a\u00020.2\u0006\u00101\u001a\u0002002\u0006\u00103\u001a\u0002022\u0006\u00105\u001a\u000204H\u0002J\u0012\u0010:\u001a\u00020\u00042\b\u00109\u001a\u0004\u0018\u000108H\u0002J\u0010\u0010=\u001a\u00020<2\u0006\u0010;\u001a\u00020\u0011H\u0002J\b\u0010?\u001a\u00020>H\u0002J\u0010\u0010A\u001a\u00020@2\u0006\u0010'\u001a\u00020\u0011H\u0002J\u0010\u0010B\u001a\u00020\u00022\u0006\u0010\u000b\u001a\u00020\nH\u0002J\b\u0010C\u001a\u00020\u0004H\u0002¨\u0006F"}, d2 = {"Lxo2/p0;", "", "", "F", "", "H", "Lokhttp3/OkHttpClient;", "v", "u", "y", "Landroid/content/Context;", "context", "D", "E", "P", "O", "M", "", com.alipay.sdk.cons.c.f18128f, "K", "Landroid/app/Application;", "z", "usingLocalDns", "Loz1/a;", "m", "enable", "Q", "x", "w", "L", "N", "s", "Ljavax/net/ssl/X509TrustManager;", "trustManager", "Ljavax/net/ssl/SSLSocketFactory;", "J", "userAgent", "Lnd2/c;", "k", ALPParamConstant.MODULE, "Lnd2/d;", "o", GoogleApiAvailabilityLight.TRACKING_SOURCE_NOTIFICATION, "l", "Lnd2/a;", "callFactory", "Lqd2/b;", "errorHandler", "Lcom/google/gson/Gson;", "gson", "Lfe2/b;", "skynetRxHook", "Ljava/util/concurrent/Executor;", "executorService", "C", "B", "Lokhttp3/Request;", "request", "I", "token", "Lcom/xingin/shield/http/XhsHttpInterceptor;", com.igexin.push.core.d.c.f25536c, "Lhl2/u;", "r", "Llp2/h;", "t", "A", "G", "<init>", "()V", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
/* compiled from: XhsNetworkModule.kt */
public final class p0 {

    /* renamed from: a  reason: collision with root package name */
    public static final p0 f155385a;

    /* renamed from: b  reason: collision with root package name */
    public static ConnectionPool f155386b = new ConnectionPool(20, 180, TimeUnit.SECONDS);

    /* renamed from: c  reason: collision with root package name */
    public static oz1.a f155387c;

    /* renamed from: d  reason: collision with root package name */
    public static final X509TrustManager f155388d;

    /* renamed from: e  reason: collision with root package name */
    public static final SSLSocketFactory f155389e;

    /* renamed from: f  reason: collision with root package name */
    public static boolean f155390f;

    /* renamed from: g  reason: collision with root package name */
    public static nd2.c f155391g;

    /* renamed from: h  reason: collision with root package name */
    public static nd2.c f155392h;

    /* renamed from: i  reason: collision with root package name */
    public static String f155393i;

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    /* compiled from: XhsNetworkModule.kt */
    public static final class a extends Lambda implements Function0<Unit> {

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

        public a() {
            super(0);
        }

        @Override // kotlin.jvm.functions.Function0
        public final void invoke() {
            c0.f155316a.d();
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0017\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\u0006"}, d2 = {"xo2/p0$b", "Lhl2/u$b;", "Lokhttp3/Request;", "request", "", "a", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class b implements u.b {
        @Override // hl2.u.b
        public boolean a(Request request) {
            Intrinsics.checkNotNullParameter(request, "request");
            return p0.f155385a.I(request);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\u0004"}, d2 = {"xo2/p0$c", "Lcom/xingin/utils/async/run/task/XYRunnable;", "", "execute", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class c extends XYRunnable {
        public c() {
            super("tcpstar", null, 2, null);
        }

        @Override // com.xingin.utils.async.run.task.XYRunnable
        public void execute() {
            z zVar = z.f83811a;
            boolean k14 = XYUtilsCenter.k();
            zVar.a("API_NET_DEBUG", "[delayStartApiCompetition], isAppForeground:" + k14);
            jp2.g.w(jp2.g.f96402a, null, 1, null);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\u0004"}, d2 = {"xo2/p0$d", "Lcom/xingin/utils/async/run/task/XYRunnable;", "", "execute", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class d extends XYRunnable {
        public d() {
            super("probe", null, 2, null);
        }

        @Override // com.xingin.utils.async.run.task.XYRunnable
        public void execute() {
            if (XYUtilsCenter.k()) {
                cp2.i.f66088a.j();
            }
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$e", "Lb02/e;", "Lb02/d;", "old", "new", "", com.alipay.sdk.widget.d.f18371g, "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class e implements b02.e {
        @Override // b02.e
        public void onRefresh(b02.d dVar, b02.d dVar2) {
            nd2.c cVar;
            Intrinsics.checkNotNullParameter(dVar, "old");
            Intrinsics.checkNotNullParameter(dVar2, "new");
            w wVar = w.f155433a;
            if (wVar.d()) {
                jp2.g.j(jp2.g.f96402a, dVar2.c(), null, 2, null);
            }
            if (wVar.E() && !dVar.o() && dVar2.o() && (cVar = p0.f155391g) != null) {
                d02.d.f66858b.c("PRE-CONNECT", "start pre connect");
                lz1.a.f103587a.b(cVar, "https://edith.xiaohongshu.com/speedtest");
            }
        }
    }

    @Metadata(d1 = {"\u0000\b\n\u0000\n\u0002\u0010\u0002\n\u0000\u0010\u0000\u001a\u00020\u0001H\n¢\u0006\u0002\b\u0002"}, d2 = {"<anonymous>", "", "invoke"}, k = 3, mv = {1, 6, 0}, xi = 48)
    /* compiled from: XhsNetworkModule.kt */
    public static final class f extends Lambda implements Function0<Unit> {

        /* renamed from: a  reason: collision with root package name */
        public static final f f155395a = new f();

        public f() {
            super(0);
        }

        @Override // kotlin.jvm.functions.Function0
        public final void invoke() {
            c0.f155316a.e();
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"xo2/p0$g", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
    /* compiled from: Config.kt */
    public static final class g extends TypeToken<Boolean> {
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$h", "Ltz1/a$a;", "Ltz1/b;", "old", "aNew", "", "a", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class h implements a.AbstractC2192a {
        @Override // tz1.a.AbstractC2192a
        public void a(tz1.b bVar, tz1.b bVar2) {
            Intrinsics.checkNotNullParameter(bVar, "old");
            Intrinsics.checkNotNullParameter(bVar2, "aNew");
            op2.a.f115156a.e(bVar2);
            d02.d dVar = d02.d.f66858b;
            String name = bVar.a().name();
            b.a a14 = bVar2.a();
            dVar.c("XhsNetworkModule", "NQE::LOW Changed, old quality " + name + ",new quality " + a14);
            int c14 = bVar.c();
            double b14 = bVar.b();
            int c15 = bVar2.c();
            double b15 = bVar2.b();
            dVar.c("XhsNetworkModule", "old detail:  {errorCount: " + c14 + ",speedRate:" + b14 + "},new detail { errorCount:" + c15 + " ,speedRate:" + b15 + com.alipay.sdk.util.f.f18326d);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$i", "Ltz1/a$a;", "Ltz1/b;", "old", "aNew", "", "a", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class i implements a.AbstractC2192a {
        @Override // tz1.a.AbstractC2192a
        public void a(tz1.b bVar, tz1.b bVar2) {
            Intrinsics.checkNotNullParameter(bVar, "old");
            Intrinsics.checkNotNullParameter(bVar2, "aNew");
            op2.a.f115156a.f(bVar2);
            d02.d dVar = d02.d.f66858b;
            String name = bVar.a().name();
            b.a a14 = bVar2.a();
            dVar.c("XhsNetworkModule", "NQE::MEDIAN Changed, old quality " + name + ",new quality " + a14);
            int c14 = bVar.c();
            double b14 = bVar.b();
            int c15 = bVar2.c();
            double b15 = bVar2.b();
            dVar.c("XhsNetworkModule", "old detail:  {errorCount: " + c14 + ",speedRate:" + b14 + "},new detail { errorCount:" + c15 + " ,speedRate:" + b15 + com.alipay.sdk.util.f.f18326d);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$j", "Ltz1/a$a;", "Ltz1/b;", "old", "aNew", "", "a", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class j implements a.AbstractC2192a {
        @Override // tz1.a.AbstractC2192a
        public void a(tz1.b bVar, tz1.b bVar2) {
            Intrinsics.checkNotNullParameter(bVar, "old");
            Intrinsics.checkNotNullParameter(bVar2, "aNew");
            op2.a.f115156a.d(bVar2);
            d02.d dVar = d02.d.f66858b;
            String name = bVar.a().name();
            b.a a14 = bVar2.a();
            dVar.c("XhsNetworkModule", "NQE::HIGH Changed, old quality " + name + ",new quality " + a14);
            int c14 = bVar.c();
            double b14 = bVar.b();
            int c15 = bVar2.c();
            double b15 = bVar2.b();
            dVar.c("XhsNetworkModule", "old detail:  {errorCount: " + c14 + ",speedRate:" + b14 + "},new detail { errorCo·unt:" + c15 + " ,speedRate:" + b15 + com.alipay.sdk.util.f.f18326d);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$k", "Lds0/c;", "", "oldValue", "newValue", "", "onChanged", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class k implements ds0.c {
        @Override // ds0.c
        public void onChanged(String str, String str2) {
            Intrinsics.checkNotNullParameter(str, "oldValue");
            Intrinsics.checkNotNullParameter(str2, "newValue");
            v.f155409a.k(str2);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\b\n\u0002\u0018\u0002\n\u0002\b\u0002\u0010\u0001\u001a\u00020\u0000H\n¢\u0006\u0004\b\u0001\u0010\u0002"}, d2 = {"Lnd2/d;", "a", "()Lnd2/d;"}, k = 3, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class l extends Lambda implements Function0<nd2.d> {

        /* renamed from: a  reason: collision with root package name */
        public static final l f155396a = new l();

        public l() {
            super(0);
        }

        /* renamed from: a */
        public final nd2.d invoke() {
            return p0.f155385a.o("RedMP");
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0010\u0010\u0004\u001a\u00020\u00022\u0006\u0010\u0003\u001a\u00020\u0002H\u0016J\b\u0010\u0006\u001a\u00020\u0005H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$m", "Lfv2/d$a;", "", "enable", "b", "Lfv2/d$b;", "a", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class m implements d.a {
        @Override // fv2.d.a
        public d.b a() {
            p0 p0Var = p0.f155385a;
            return new d.b(p0Var.H(), p0Var.K(NetSettingActivity.WWW_HOST), p0Var.K(NetSettingActivity.EDITH_HOST));
        }

        @Override // fv2.d.a
        public boolean b(boolean z14) {
            p0 p0Var = p0.f155385a;
            p0.f155390f = z14;
            p0Var.Q(z14);
            return true;
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\b\u0010\u0003\u001a\u00020\u0002H\u0016¨\u0006\u0004"}, d2 = {"xo2/p0$n", "Lcom/xingin/utils/async/run/task/XYRunnable;", "", "execute", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class n extends XYRunnable {

        @Metadata(bv = {}, d1 = {"\u0000\f\n\u0002\u0018\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002\u0010\u0002\u001a\u00020\u0001*\u00020\u0000H\n¢\u0006\u0004\b\u0002\u0010\u0003"}, d2 = {"Lw13/t2$a;", "", "a", "(Lw13/t2$a;)V"}, k = 3, mv = {1, 6, 0})
        /* compiled from: XhsNetworkModule.kt */
        public static final class a extends Lambda implements Function1<t2.a, Unit> {

            /* renamed from: a  reason: collision with root package name */
            public final /* synthetic */ HashMap<String, String> f155397a;

            /* JADX INFO: super call moved to the top of the method (can break code semantics) */
            public a(HashMap<String, String> hashMap) {
                super(1);
                this.f155397a = hashMap;
            }

            public final void a(t2.a aVar) {
                Intrinsics.checkNotNullParameter(aVar, "$this$withAndrIpCacheInfo");
                aVar.v(u2.target_request_abort_VALUE);
                aVar.w(1.0f);
                aVar.s(this.f155397a.get("iplist_www"));
                aVar.r(this.f155397a.get("iplist_edith"));
                aVar.u(this.f155397a.get("ipquality_www"));
                aVar.t(this.f155397a.get("ipquality_edith"));
            }

            /* 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 // kotlin.jvm.functions.Function1
            public /* bridge */ /* synthetic */ Unit invoke(t2.a aVar) {
                a(aVar);
                return Unit.INSTANCE;
            }
        }

        public n() {
            super("ns-rep", null, 2, null);
        }

        public static final void h(HashMap hashMap) {
            Intrinsics.checkNotNullParameter(hashMap, "$map");
            qe2.a.a().p4("andr_ip_cache_info").l0(new a(hashMap)).b();
        }

        @Override // com.xingin.utils.async.run.task.XYRunnable
        public void execute() {
            HashMap hashMap = new HashMap();
            jp2.g gVar = jp2.g.f96402a;
            hashMap.put("iplist_www", gVar.r(NetSettingActivity.WWW_HOST));
            hashMap.put("iplist_edith", gVar.r(NetSettingActivity.EDITH_HOST));
            jp2.h hVar = jp2.h.f96417a;
            hashMap.put("ipquality_www", hVar.e(NetSettingActivity.WWW_HOST));
            hashMap.put("ipquality_edith", hVar.e(NetSettingActivity.EDITH_HOST));
            we2.d.c(new q0(hashMap));
            for (Map.Entry entry : hashMap.entrySet()) {
                z zVar = z.f83811a;
                zVar.a("API-INFO-IP-CACHE", "key:" + ((String) entry.getKey()) + ",value=" + ((String) entry.getValue()));
            }
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0004*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016J\u0018\u0010\u0007\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016J\u0018\u0010\b\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\t"}, d2 = {"xo2/p0$o", "Ld02/d$a;", "", "tag", "msg", "", "e", "i", "d", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class o implements d.a {
        @Override // d02.d.a
        public void d(String str, String str2) {
            Intrinsics.checkNotNullParameter(str, "tag");
            Intrinsics.checkNotNullParameter(str2, "msg");
            ko2.e.c(ko2.a.APP_LOG, str, str2);
        }

        @Override // d02.d.a
        public void e(String str, String str2) {
            Intrinsics.checkNotNullParameter(str, "tag");
            Intrinsics.checkNotNullParameter(str2, "msg");
            ko2.e.h(ko2.a.APP_LOG, str, str2);
        }

        @Override // d02.d.a
        public void i(String str, String str2) {
            Intrinsics.checkNotNullParameter(str, "tag");
            Intrinsics.checkNotNullParameter(str2, "msg");
            ko2.e.m(ko2.a.APP_LOG, str, str2);
        }
    }

    @Metadata(bv = {}, d1 = {"\u0000\u0019\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u000e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0002\b\u0002*\u0001\u0000\b\n\u0018\u00002\u00020\u0001J\u0018\u0010\u0006\u001a\u00020\u00052\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0004\u001a\u00020\u0002H\u0016¨\u0006\u0007"}, d2 = {"xo2/p0$p", "Lds0/c;", "", "oldValue", "newValue", "", "onChanged", "app_PublishGooglePlayRelease"}, k = 1, mv = {1, 6, 0})
    /* compiled from: XhsNetworkModule.kt */
    public static final class p implements ds0.c {

        /* renamed from: a  reason: collision with root package name */
        public final int f155398a = com.alipay.security.mobile.module.http.constant.a.f18452a;

        /* renamed from: b  reason: collision with root package name */
        public long f155399b;

        @Metadata(bv = {}, d1 = {"\u0000\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000*\u0001\u0000\b\n\u0018\u00002\b\u0012\u0004\u0012\u00028\u00000\u0001¨\u0006\u0002"}, d2 = {"xo2/p0$p$a", "Lcom/google/gson/reflect/TypeToken;", "xy_configcenter_library_release"}, k = 1, mv = {1, 6, 0})
        /* compiled from: Config.kt */
        public static final class a extends TypeToken<ep2.g> {
        }

        @Override // ds0.c
        public void onChanged(String str, String str2) {
            HashMap<String, List<String>> hashMap;
            Intrinsics.checkNotNullParameter(str, "oldValue");
            Intrinsics.checkNotNullParameter(str2, "newValue");
            d02.d dVar = d02.d.f66858b;
            dVar.c("XhsNetworkModule", "android_api_ip_direct_config changed");
            ds0.f a14 = ds0.b.a();
            ep2.g gVar = new ep2.g();
            Type type = new a().getType();
            Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
            ep2.g gVar2 = (ep2.g) a14.j("android_api_ip_direct_config", type, gVar);
            if (gVar2.getForce()) {
                long elapsedRealtime = SystemClock.elapsedRealtime();
                dVar.c("XhsNetworkModule", "received force clear connection");
                if (elapsedRealtime - this.f155399b < ((long) this.f155398a)) {
                    dVar.c("XhsNetworkModule", "tool frequently clear connection");
                    return;
                }
                this.f155399b = elapsedRealtime;
                for (Map.Entry<String, List<String>> entry : gVar2.getIpMappingListNotNull().entrySet()) {
                    entry.getValue();
                    jp2.g.f96402a.m(entry.getKey());
                }
                try {
                    p0.f155386b.evictAll();
                } catch (Throwable unused) {
                }
                if (gVar2.getOrdered()) {
                    hashMap = gVar2.getIpMappingListNotNull();
                } else {
                    hashMap = new HashMap<>();
                    for (Map.Entry<String, List<String>> entry2 : gVar2.getIpMappingListNotNull().entrySet()) {
                        hashMap.put(entry2.getKey(), CollectionsKt__CollectionsJVMKt.shuffled(entry2.getValue()));
                    }
                }
                p0 p0Var = p0.f155385a;
                p0.f155387c = new c.a().a(new oz1.b(hashMap)).a(new dp2.f()).a(new oz1.d()).b();
                Application e14 = XYUtilsCenter.e();
                Intrinsics.checkNotNullExpressionValue(e14, "getApp()");
                p0Var.L(e14);
                Application e15 = XYUtilsCenter.e();
                Intrinsics.checkNotNullExpressionValue(e15, "getApp()");
                p0Var.D(e15);
                Application e16 = XYUtilsCenter.e();
                Intrinsics.checkNotNullExpressionValue(e16, "getApp()");
                ((s.a) ((d0) l10.c.a(d0.class)).d()).l(e16);
                d02.d dVar2 = d02.d.f66858b;
                dVar2.b("XhsNetworkModule", "REST NETWORK CONNECTION!!!");
                dVar2.b("XhsNetworkModule", "OLD CONFIG:" + str + ",NEW CONFIG:" + str2);
            }
        }
    }

    static {
        p0 p0Var = new p0();
        f155385a = p0Var;
        f155387c = p0Var.m(false);
        X509TrustManager platformTrustManager = Util.platformTrustManager();
        f155388d = platformTrustManager;
        Intrinsics.checkNotNullExpressionValue(platformTrustManager, "trustManager");
        SSLSocketFactory J2 = p0Var.J(platformTrustManager);
        Intrinsics.checkNotNull(J2);
        f155389e = J2;
    }

    public static final boolean q(Request request) {
        return f155385a.I(request);
    }

    public final void A(Context context) {
        nd2.d dVar = new nd2.d();
        String p14 = com.xingin.utils.core.c.p();
        c.a b14 = ie2.c.f90525e.b(context);
        nd2.d q14 = dVar.q(p14 + " NetType/" + b14, false);
        HttpLoggingInterceptor level = new HttpLoggingInterceptor().setLevel(a0.a().convertToOkHttpLogLevel());
        Intrinsics.checkNotNullExpressionValue(level, "HttpLoggingInterceptor()…onvertToOkHttpLogLevel())");
        nd2.d c14 = q14.i(level).b(new ee2.a()).c(new yo2.a());
        qp2.e eVar = qp2.e.f122829a;
        f155392h = c14.o(eVar.i()).j(new pp2.e()).p(new pp2.k()).a(eVar.j()).a(new zo2.b()).a(new ap2.a(f.f155395a)).d();
        nd2.h e14 = new nd2.h().e("https://qa.xiaohongshu.com/");
        nd2.c cVar = f155392h;
        Intrinsics.checkNotNull(cVar);
        fz1.b.f80449a.h(e14.i(cVar).n(c0.f155316a.b()).f());
    }

    public final void B(nd2.a aVar, qd2.b bVar, Gson gson, fe2.b bVar2, Executor executor) {
        nd2.h hVar = new nd2.h();
        String g10 = zp2.a.g();
        Intrinsics.checkNotNullExpressionValue(g10, "getEdithBaseUrl()");
        fz1.b.f80449a.f(hVar.e(g10).i(aVar).n(executor).j(bVar).c(new td2.f()).b(new td2.d()).k(gson).o(true).d(new n()).d(new iz1.a()).l(qp2.e.f122829a.g()).m(bVar2).f());
    }

    public final void C(nd2.a aVar, qd2.b bVar, Gson gson, fe2.b bVar2, Executor executor) {
        nd2.h hVar = new nd2.h();
        String x14 = zp2.a.x();
        Intrinsics.checkNotNullExpressionValue(x14, "getServerBaseUrl()");
        fz1.b.f80449a.g(hVar.e(x14).i(aVar).n(executor).j(bVar).c(new zd2.f()).b(new zd2.d()).k(gson).o(true).d(new m()).d(new iz1.b()).l(qp2.e.f122829a.g()).m(bVar2).f());
    }

    public final void D(Context context) {
        Intrinsics.checkNotNullParameter(context, "context");
        Object G = ((s.a) ((d0) l10.c.a(d0.class)).d()).G(context);
        if (G instanceof OkHttpClient.Builder) {
            OkHttpClient.Builder builder = (OkHttpClient.Builder) G;
            builder.dns(f155387c);
            builder.sslSocketFactory(f155389e, f155388d);
            builder.connectionPool(f155386b);
            qp2.e eVar = qp2.e.f122829a;
            builder.addInterceptor(eVar.k()).addInterceptor(new ee2.a()).addInterceptor(new be2.b(new yo2.a(), false, null, 4, null)).addInterceptor(new lp2.h("RnOkHttp").a(new lp2.d()).a(BugReporter.INSTANCE.getSkynetLogger()).e(a0.a().convertToHttpLogLevel())).addInterceptor(p("main")).addInterceptor(r()).addInterceptor(new pp2.e()).addNetworkInterceptor(new pp2.k()).eventListener(new ld2.a(CollectionsKt__CollectionsKt.listOf((Object[]) new ld2.b[]{eVar.l(), new zo2.b(), new zo2.a()})));
            fz1.c cVar = fz1.c.f80455a;
            OkHttpClient build = builder.build();
            Intrinsics.checkNotNullExpressionValue(build, "builder.build()");
            cVar.a(build);
        }
    }

    public final void E() {
        vz1.d dVar = vz1.d.f141906e;
        dVar.h(d.f155324b);
        dVar.i(c0.f155316a.c());
    }

    public final void F() {
        Application e14 = XYUtilsCenter.e();
        gd2.a.f81806c.h(g20.a.c());
        ce2.a.f11741b.c(g20.a.c());
        O();
        h22.d.f84855g.a("netdiagnose");
        ds0.f a14 = ds0.b.a();
        Boolean bool = Boolean.FALSE;
        Type type = new g().getType();
        Intrinsics.checkExpressionValueIsNotNull(type, "object : TypeToken<T>() {}.type");
        if (((Boolean) a14.h("android_httpdns_flag_2", type, bool)).booleanValue()) {
            try {
                vy0.b bVar = vy0.b.f141841b;
                Intrinsics.checkNotNullExpressionValue(e14, "context");
                bVar.k(e14);
            } catch (Exception e15) {
                z.f83811a.d("API_NET_DEBUG", e15);
            }
        }
        nd2.h.f109661m.a(G());
        ez1.a aVar = ez1.a.f75475b;
        Intrinsics.checkNotNullExpressionValue(e14, "context");
        aVar.b(e14);
        x();
        z(e14);
        s();
        y();
        M();
        ep2.i D = w.f155433a.D();
        a.c cVar = new a.c();
        cVar.u(D.getPeriod());
        cVar.r(D.getLowest_byte_count_limit());
        cVar.m(D.getError_count_capacity());
        cVar.w(D.getSpeed_rate_capacity());
        cVar.v(D.getSpeed_rate_percentile());
        cVar.n(D.getHigh__mode_error_count_threshold());
        cVar.s(D.getMedian_mode_error_count_threshold());
        cVar.p(D.getLow_mode_error_count_threshold());
        cVar.o(D.getHigh_mode_speed_rate_threshold());
        cVar.t(D.getMedian_mode_speed_rate_threshold());
        cVar.q(D.getLow_mode_speed_rate_threshold());
        uz1.a a15 = cVar.a();
        tz1.d dVar = tz1.d.f135424b;
        dVar.b(a15);
        dVar.c(tz1.c.LOW, new h());
        dVar.c(tz1.c.MEDIAN, new i());
        dVar.c(tz1.c.HIGH, new j());
        P();
        ds0.b.a().n("exp_test_ios", new k());
        E();
    }

    public final boolean G() {
        int intValue = ((Number) da.c.c().i("android_skynet_gson_optimize_exp", JvmClassMappingKt.getKotlinClass(Integer.TYPE))).intValue();
        boolean z14 = true;
        if (intValue == 0 || intValue == 1) {
            z14 = false;
        }
        ko2.e.a("XhsNetworkModule", "android_skynet_gson_optimize_exp:" + z14);
        return z14;
    }

    public final boolean H() {
        return f155390f;
    }

    /* JADX WARNING: Code restructure failed: missing block: B:12:0x0033, code lost:
        if (kotlin.text.StringsKt__StringsKt.contains$default((java.lang.CharSequence) r1, (java.lang.CharSequence) "multipart", false, 2, (java.lang.Object) null) == true) goto L_0x0037;
     */
    public final boolean I(Request request) {
        MediaType contentType;
        String mediaType;
        if (request == null) {
            return false;
        }
        RequestBody body = request.body();
        boolean z14 = true;
        if (!(body == null || (contentType = body.contentType()) == null || (mediaType = contentType.toString()) == null)) {
            Locale locale = Locale.getDefault();
            Intrinsics.checkNotNullExpressionValue(locale, "getDefault()");
            String lowerCase = mediaType.toLowerCase(locale);
            Intrinsics.checkNotNullExpressionValue(lowerCase, "this as java.lang.String).toLowerCase(locale)");
            if (lowerCase != null) {
            }
        }
        z14 = false;
        if (z14) {
            return false;
        }
        String host = request.url().host();
        Intrinsics.checkNotNullExpressionValue(host, "request.url().host()");
        return StringsKt__StringsJVMKt.endsWith$default(host, "xiaohongshu.com", false, 2, null);
    }

    public final SSLSocketFactory J(X509TrustManager x509TrustManager) {
        try {
            SSLContext sSLContext = Platform.get().getSSLContext();
            sSLContext.init(null, new X509TrustManager[]{x509TrustManager}, null);
            return sSLContext.getSocketFactory();
        } catch (GeneralSecurityException e14) {
            throw new AssertionError("No System TLS", e14);
        }
    }

    public final String K(String str) {
        try {
            return d02.c.f66856b.b(InetAddress.getByName(str));
        } catch (Exception unused) {
            return "";
        }
    }

    public final void L(Context context) {
        p.a aVar;
        String str;
        String str2 = "";
        if (f155393i == null) {
            l.b bVar = (l.b) e30.c.b(l.b.class);
            if (bVar == null || (str = bVar.D(context)) == null) {
                str = str2;
            }
            f155393i = str;
        }
        fe2.b h10 = qp2.e.f122829a.h();
        qd2.b aVar2 = new fp2.a(context);
        Gson c14 = z.f155452a.c();
        Executor a14 = c0.f155316a.a();
        String str3 = f155393i;
        if (str3 != null) {
            str2 = str3;
        }
        nd2.c k14 = k(str2);
        f155391g = k14;
        Intrinsics.checkNotNull(k14);
        C(k14, aVar2, c14, h10, a14);
        nd2.a aVar3 = f155391g;
        Intrinsics.checkNotNull(aVar3);
        B(aVar3, aVar2, c14, h10, a14);
        nz1.a aVar4 = nz1.a.f112307a;
        String x14 = zp2.a.x();
        Intrinsics.checkNotNullExpressionValue(x14, "getServerBaseUrl()");
        String g10 = zp2.a.g();
        Intrinsics.checkNotNullExpressionValue(g10, "getEdithBaseUrl()");
        nd2.c cVar = f155391g;
        Intrinsics.checkNotNull(cVar);
        aVar4.a(x14, g10, cVar, aVar2, h10, a14);
        if (ki2.d.f98474d.a().d()) {
            l lVar = l.f155396a;
            r rVar = (r) l10.c.a(r.class);
            if (rVar != null && (aVar = (p.a) rVar.d()) != null) {
                aVar.d0(lVar);
            }
        }
    }

    public final void M() {
        fv2.d.f78147a.b(new m());
    }

    public final void N() {
        mi2.a.m(new n());
    }

    public final void O() {
        d02.d.f66858b.e(new o());
    }

    public final void P() {
        ds0.b.a().n("android_api_ip_direct_config", new p());
    }

    public final void Q(boolean z14) {
        f155387c = m(z14);
        y();
        z zVar = z.f83811a;
        zVar.c("API_NET_INFO", "[SwitchUsingLocalDnsOnly:] enable:" + z14);
    }

    public final nd2.c k(String str) {
        return nd2.d.r(o("API"), str, false, 2, null).d();
    }

    public final oz1.a l() {
        return new dp2.a(new c.a().a(new dp2.f()).a(new oz1.d()).a(new oz1.b(w.f155433a.v().getIpMappingListNotNull())).b());
    }

    public final oz1.a m(boolean z14) {
        if (z14) {
            return n();
        }
        return l();
    }

    public final oz1.a n() {
        return new oz1.d();
    }

    public final nd2.d o(String str) {
        nd2.d m14 = new nd2.d().c(new yo2.a()).i(t(str)).m(p("main"));
        qp2.e eVar = qp2.e.f122829a;
        nd2.d a14 = m14.o(eVar.e()).j(new pp2.e()).p(new pp2.k()).b(new yo2.c()).b(new yo2.b()).b(new hl2.e()).b(new uo2.b()).b(new k0()).b(new l0()).b(new r0()).b(new ee2.a()).b(new g()).b(new pp2.c()).b(new tm2.a()).b(r()).a(eVar.f()).a(new zo2.b()).a(new zo2.a()).a(new ap2.a(a.f155394a));
        qp2.g gVar = qp2.g.f122850a;
        w wVar = w.f155433a;
        long b14 = gVar.b(wVar.e().getNet_socket_connect_timeout());
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        nd2.d e14 = a14.f(b14, timeUnit).k(gVar.c(wVar.e().getNet_h2_ping_interval()), timeUnit).l(gVar.d(wVar.e().getNet_socket_read_timeout()), timeUnit).s(gVar.e(wVar.e().getNet_socket_write_timeout()), timeUnit).e(gVar.a(wVar.e().getNet_call_timeout()), timeUnit);
        SSLSocketFactory sSLSocketFactory = f155389e;
        X509TrustManager x509TrustManager = f155388d;
        Intrinsics.checkNotNullExpressionValue(x509TrustManager, "trustManager");
        return e14.n(sSLSocketFactory, x509TrustManager).g(f155386b).h(f155387c);
    }

    public final XhsHttpInterceptor p(String str) {
        XhsHttpInterceptor newInstance = XhsHttpInterceptor.newInstance(str, o0.f155383a);
        Intrinsics.checkNotNullExpressionValue(newInstance, "newInstance(token) { req…stSign(request)\n        }");
        return newInstance;
    }

    public final u r() {
        return new u(new b());
    }

    public final void s() {
        mi2.a.l(new c(), 7000);
        mi2.a.l(new d(), 8000);
    }

    public final lp2.h t(String str) {
        return new lp2.h(str).a(new lp2.d()).a(BugReporter.INSTANCE.getSkynetLogger()).e(a0.a().convertToHttpLogLevel());
    }

    public final OkHttpClient u() {
        nd2.c cVar = f155392h;
        if (cVar != null) {
            return cVar.a();
        }
        return null;
    }

    public final OkHttpClient v() {
        nd2.c cVar = f155391g;
        if (cVar != null) {
            return cVar.a();
        }
        return null;
    }

    public final void w(Context context) {
        lp2.g.f102632a.c(context);
        L(context);
    }

    public final void x() {
        jp2.g gVar = jp2.g.f96402a;
        gVar.u();
        gVar.O();
        jp2.h hVar = jp2.h.f96417a;
        if (mr2.h.a()) {
            gVar.n();
        }
        if (w.f155433a.G()) {
            N();
        }
    }

    public final void y() {
        Application e14 = XYUtilsCenter.e();
        Intrinsics.checkNotNullExpressionValue(e14, "getApp()");
        w(e14);
        Application e15 = XYUtilsCenter.e();
        Intrinsics.checkNotNullExpressionValue(e15, "getApp()");
        A(e15);
    }

    public final void z(Application application) {
        b02.c.f5924t.V(new e());
    }
}