导航菜单

页面标题

页面副标题

CityMall v1.42.1 - b.java 源代码

正在查看: CityMall v1.42.1 应用的 b.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package y7;

import android.os.Build;
import android.security.NetworkSecurityPolicy;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.security.cert.TrustAnchor;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.X509TrustManager;
import kotlin.collections.AbstractC0471p;
import kotlin.jvm.internal.DefaultConstructorMarker;
import okhttp3.internal.platform.android.DeferredSocketAdapter;
import okhttp3.internal.platform.android.SocketAdapter;
import okhttp3.internal.tls.TrustRootIndex;
import z7.k;
import z7.l;

public final class b extends j {
    private static final boolean f;
    public static final a g = new a(null);
    private final List d;
    private final z7.j e;

    public static final class a {
        private a() {
        }

        public final j a() {
            if (b()) {
                return new b();
            }
            return null;
        }

        public final boolean b() {
            return b.f;
        }

        public a(DefaultConstructorMarker defaultConstructorMarker) {
            this();
        }
    }

    public static final class C0116b implements TrustRootIndex {
        private final X509TrustManager a;
        private final Method b;

        public C0116b(X509TrustManager trustManager, Method findByIssuerAndSignatureMethod) {
            kotlin.jvm.internal.j.i(trustManager, "trustManager");
            kotlin.jvm.internal.j.i(findByIssuerAndSignatureMethod, "findByIssuerAndSignatureMethod");
            this.a = trustManager;
            this.b = findByIssuerAndSignatureMethod;
        }

        @Override
        public X509Certificate a(X509Certificate cert) {
            kotlin.jvm.internal.j.i(cert, "cert");
            try {
                Object invoke = this.b.invoke(this.a, cert);
                if (invoke != null) {
                    return ((TrustAnchor) invoke).getTrustedCert();
                }
                throw new NullPointerException("null cannot be cast to non-null type java.security.cert.TrustAnchor");
            } catch (IllegalAccessException e) {
                throw new AssertionError("unable to get issues and signature", e);
            } catch (InvocationTargetException unused) {
                return null;
            }
        }

        public boolean equals(Object obj) {
            if (this == obj) {
                return true;
            }
            if (!(obj instanceof C0116b)) {
                return false;
            }
            C0116b c0116b = (C0116b) obj;
            return kotlin.jvm.internal.j.d(this.a, c0116b.a) && kotlin.jvm.internal.j.d(this.b, c0116b.b);
        }

        public int hashCode() {
            X509TrustManager x509TrustManager = this.a;
            int hashCode = (x509TrustManager != null ? x509TrustManager.hashCode() : 0) * 31;
            Method method = this.b;
            return hashCode + (method != null ? method.hashCode() : 0);
        }

        public String toString() {
            return "CustomTrustRootIndex(trustManager=" + this.a + ", findByIssuerAndSignatureMethod=" + this.b + ")";
        }
    }

    static {
        boolean z = false;
        if (j.c.h() && Build.VERSION.SDK_INT < 30) {
            z = true;
        }
        f = z;
    }

    public b() {
        List p = AbstractC0471p.p(l.a.b(l.j, null, 1, null), new DeferredSocketAdapter(z7.h.g.d()), new DeferredSocketAdapter(k.b.a()), new DeferredSocketAdapter(z7.i.b.a()));
        ArrayList arrayList = new ArrayList();
        for (Object obj : p) {
            if (((SocketAdapter) obj).isSupported()) {
                arrayList.add(obj);
            }
        }
        this.d = arrayList;
        this.e = z7.j.d.a();
    }

    @Override
    public B7.c c(X509TrustManager trustManager) {
        kotlin.jvm.internal.j.i(trustManager, "trustManager");
        z7.d a2 = z7.d.d.a(trustManager);
        return a2 != null ? a2 : super.c(trustManager);
    }

    @Override
    public TrustRootIndex d(X509TrustManager trustManager) {
        kotlin.jvm.internal.j.i(trustManager, "trustManager");
        try {
            Method method = trustManager.getClass().getDeclaredMethod("findTrustAnchorByIssuerAndSignature", X509Certificate.class);
            kotlin.jvm.internal.j.h(method, "method");
            method.setAccessible(true);
            return new C0116b(trustManager, method);
        } catch (NoSuchMethodException unused) {
            return super.d(trustManager);
        }
    }

    @Override
    public void e(SSLSocket sslSocket, String str, List protocols) {
        Object obj;
        kotlin.jvm.internal.j.i(sslSocket, "sslSocket");
        kotlin.jvm.internal.j.i(protocols, "protocols");
        Iterator it = this.d.iterator();
        while (true) {
            if (!it.hasNext()) {
                obj = null;
                break;
            } else {
                obj = it.next();
                if (((SocketAdapter) obj).a(sslSocket)) {
                    break;
                }
            }
        }
        SocketAdapter socketAdapter = (SocketAdapter) obj;
        if (socketAdapter != null) {
            socketAdapter.c(sslSocket, str, protocols);
        }
    }

    @Override
    public void f(Socket socket, InetSocketAddress address, int i) {
        kotlin.jvm.internal.j.i(socket, "socket");
        kotlin.jvm.internal.j.i(address, "address");
        try {
            socket.connect(address, i);
        } catch (ClassCastException e) {
            if (Build.VERSION.SDK_INT != 26) {
                throw e;
            }
            throw new IOException("Exception in connect", e);
        }
    }

    @Override
    public String h(SSLSocket sslSocket) {
        Object obj;
        kotlin.jvm.internal.j.i(sslSocket, "sslSocket");
        Iterator it = this.d.iterator();
        while (true) {
            if (!it.hasNext()) {
                obj = null;
                break;
            }
            obj = it.next();
            if (((SocketAdapter) obj).a(sslSocket)) {
                break;
            }
        }
        SocketAdapter socketAdapter = (SocketAdapter) obj;
        if (socketAdapter != null) {
            return socketAdapter.b(sslSocket);
        }
        return null;
    }

    @Override
    public Object i(String closer) {
        kotlin.jvm.internal.j.i(closer, "closer");
        return this.e.a(closer);
    }

    @Override
    public boolean j(String hostname) {
        kotlin.jvm.internal.j.i(hostname, "hostname");
        return NetworkSecurityPolicy.getInstance().isCleartextTrafficPermitted(hostname);
    }

    @Override
    public void m(String message, Object obj) {
        kotlin.jvm.internal.j.i(message, "message");
        if (this.e.b(obj)) {
            return;
        }
        j.l(this, message, 5, null, 4, null);
    }
}