导航菜单

页面标题

页面副标题

OVO v3.139.0 - pba.java 源代码

正在查看: OVO v3.139.0 应用的 pba.java JAVA 源代码文件

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


package o.i;

import java.io.IOException;
import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.Socket;
import java.net.URI;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.SSLParameters;
import javax.net.ssl.SSLSocket;
import o.i.rdb;

public class pba {
    public static final Logger b = Logger.getLogger(pba.class.getName());
    public static final rdb c = rdb.d;
    public static final pba d;
    public final rdb a;

    public static final class a extends pba {
        public static final wha<Socket> e;
        public static final wha<Socket> f;
        public static final wha<Socket> g;
        public static final wha<Socket> h;
        public static final wha<Socket> i;
        public static final wha<Socket> j;
        public static final Method k;

        public static final Method f158l;
        public static final Method m;
        public static final Method n;

        public static final Method f159o;
        public static final Method p;
        public static final Constructor<?> q;

        static {
            Method method;
            Method method2;
            Method method3;
            Method method4;
            Method method5;
            Method method6;
            Constructor<?> constructor;
            Class<?> cls;
            Logger logger = pba.b;
            Class<?> cls2 = Boolean.TYPE;
            e = new wha<>(null, "setUseSessionTickets", cls2);
            f = new wha<>(null, "setHostname", String.class);
            g = new wha<>(byte[].class, "getAlpnSelectedProtocol", new Class[0]);
            h = new wha<>(null, "setAlpnProtocols", byte[].class);
            i = new wha<>(byte[].class, "getNpnSelectedProtocol", new Class[0]);
            j = new wha<>(null, "setNpnProtocols", byte[].class);
            try {
                method = SSLParameters.class.getMethod("setApplicationProtocols", String[].class);
                try {
                    method2 = SSLParameters.class.getMethod("getApplicationProtocols", new Class[0]);
                    try {
                        method4 = SSLSocket.class.getMethod("getApplicationProtocol", new Class[0]);
                        try {
                            cls = Class.forName("android.net.ssl.SSLSockets");
                            method3 = cls.getMethod("isSupportedSocket", SSLSocket.class);
                        } catch (ClassNotFoundException e2) {
                            e = e2;
                            method3 = null;
                        } catch (NoSuchMethodException e3) {
                            e = e3;
                            method3 = null;
                        }
                    } catch (ClassNotFoundException e4) {
                        e = e4;
                        method3 = null;
                        method4 = null;
                        logger.log(Level.FINER, "Failed to find Android 10.0+ APIs", (Throwable) e);
                        method5 = null;
                        m = method;
                        n = method2;
                        f159o = method4;
                        k = method3;
                        f158l = method5;
                        method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                        try {
                            constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
                        } catch (ClassNotFoundException e5) {
                            e = e5;
                            logger.log(Level.FINER, "Failed to find Android 7.0+ APIs", (Throwable) e);
                            constructor = null;
                            p = method6;
                            q = constructor;
                        } catch (NoSuchMethodException e6) {
                            e = e6;
                            logger.log(Level.FINER, "Failed to find Android 7.0+ APIs", (Throwable) e);
                            constructor = null;
                            p = method6;
                            q = constructor;
                        }
                        p = method6;
                        q = constructor;
                    } catch (NoSuchMethodException e7) {
                        e = e7;
                        method3 = null;
                        method4 = null;
                        logger.log(Level.FINER, "Failed to find Android 10.0+ APIs", (Throwable) e);
                        method5 = null;
                        m = method;
                        n = method2;
                        f159o = method4;
                        k = method3;
                        f158l = method5;
                        method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                        constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
                        p = method6;
                        q = constructor;
                    }
                } catch (ClassNotFoundException e8) {
                    e = e8;
                    method2 = null;
                    method3 = null;
                    method4 = null;
                    logger.log(Level.FINER, "Failed to find Android 10.0+ APIs", (Throwable) e);
                    method5 = null;
                    m = method;
                    n = method2;
                    f159o = method4;
                    k = method3;
                    f158l = method5;
                    method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                    constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
                    p = method6;
                    q = constructor;
                } catch (NoSuchMethodException e9) {
                    e = e9;
                    method2 = null;
                    method3 = null;
                    method4 = null;
                    logger.log(Level.FINER, "Failed to find Android 10.0+ APIs", (Throwable) e);
                    method5 = null;
                    m = method;
                    n = method2;
                    f159o = method4;
                    k = method3;
                    f158l = method5;
                    method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                    constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
                    p = method6;
                    q = constructor;
                }
                try {
                    method5 = cls.getMethod("setUseSessionTickets", SSLSocket.class, cls2);
                } catch (ClassNotFoundException e10) {
                    e = e10;
                    logger.log(Level.FINER, "Failed to find Android 10.0+ APIs", (Throwable) e);
                    method5 = null;
                    m = method;
                    n = method2;
                    f159o = method4;
                    k = method3;
                    f158l = method5;
                    method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                    constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
                    p = method6;
                    q = constructor;
                } catch (NoSuchMethodException e11) {
                    e = e11;
                    logger.log(Level.FINER, "Failed to find Android 10.0+ APIs", (Throwable) e);
                    method5 = null;
                    m = method;
                    n = method2;
                    f159o = method4;
                    k = method3;
                    f158l = method5;
                    method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                    constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
                    p = method6;
                    q = constructor;
                }
            } catch (ClassNotFoundException e12) {
                e = e12;
                method = null;
            } catch (NoSuchMethodException e13) {
                e = e13;
                method = null;
            }
            m = method;
            n = method2;
            f159o = method4;
            k = method3;
            f158l = method5;
            try {
                method6 = SSLParameters.class.getMethod("setServerNames", List.class);
                constructor = Class.forName("javax.net.ssl.SNIHostName").getConstructor(String.class);
            } catch (ClassNotFoundException e14) {
                e = e14;
                method6 = null;
            } catch (NoSuchMethodException e15) {
                e = e15;
                method6 = null;
            }
            p = method6;
            q = constructor;
        }

        @Override
        public final void a(javax.net.ssl.SSLSocket r9, java.lang.String r10, java.util.List<o.i.dvb> r11) {
            throw new UnsupportedOperationException("Method not decompiled: o.i.pba.a.a(javax.net.ssl.SSLSocket, java.lang.String, java.util.List):void");
        }

        @Override
        public final String b(SSLSocket sSLSocket) {
            Logger logger = pba.b;
            Method method = f159o;
            if (method != null) {
                try {
                    return (String) method.invoke(sSLSocket, new Object[0]);
                } catch (IllegalAccessException e2) {
                    throw new RuntimeException(e2);
                } catch (InvocationTargetException e3) {
                    if (!(e3.getTargetException() instanceof UnsupportedOperationException)) {
                        throw new RuntimeException(e3);
                    }
                    logger.log(Level.FINER, "Socket unsupported for getApplicationProtocol, will try old methods");
                }
            }
            rdb rdbVar = this.a;
            if (rdbVar.e() == rdb.e.ALPN_AND_NPN) {
                try {
                    byte[] bArr = (byte[]) g.e(new Object[0], sSLSocket);
                    if (bArr != null) {
                        return new String(bArr, iag.b);
                    }
                } catch (Exception e4) {
                    logger.log(Level.FINE, "Failed calling getAlpnSelectedProtocol()", (Throwable) e4);
                }
            }
            if (rdbVar.e() == rdb.e.NONE) {
                return null;
            }
            try {
                byte[] bArr2 = (byte[]) i.e(new Object[0], sSLSocket);
                if (bArr2 != null) {
                    return new String(bArr2, iag.b);
                }
                return null;
            } catch (Exception e5) {
                logger.log(Level.FINE, "Failed calling getNpnSelectedProtocol()", (Throwable) e5);
                return null;
            }
        }

        @Override
        public final String d(SSLSocket sSLSocket, String str, List<dvb> list) throws IOException {
            String b = b(sSLSocket);
            return b == null ? super.d(sSLSocket, str, list) : b;
        }
    }

    static {
        boolean z;
        ClassLoader classLoader = pba.class.getClassLoader();
        try {
            classLoader.loadClass("com.android.org.conscrypt.OpenSSLSocketImpl");
        } catch (ClassNotFoundException e) {
            Level level = Level.FINE;
            Logger logger = b;
            logger.log(level, "Unable to find Conscrypt. Skipping", (Throwable) e);
            try {
                classLoader.loadClass("org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl");
            } catch (ClassNotFoundException e2) {
                logger.log(Level.FINE, "Unable to find any OpenSSLSocketImpl. Skipping", (Throwable) e2);
                z = false;
            }
        }
        z = true;
        rdb rdbVar = c;
        d = z ? new a(rdbVar) : new pba(rdbVar);
    }

    public pba(rdb rdbVar) {
        ly6.i(rdbVar, "platform");
        this.a = rdbVar;
    }

    public static boolean c(String str) {
        if (str.contains("_")) {
            return false;
        }
        try {
            URI a2 = bg6.a(str);
            ly6.d(str, "No host in authority '%s'", a2.getHost() != null);
            ly6.d(str, "Userinfo must not be present on authority: '%s'", a2.getUserInfo() == null);
            return true;
        } catch (IllegalArgumentException unused) {
            return false;
        }
    }

    public void a(SSLSocket sSLSocket, String str, List<dvb> list) {
        this.a.c(sSLSocket, str, list);
    }

    public String b(SSLSocket sSLSocket) {
        return this.a.d(sSLSocket);
    }

    public String d(SSLSocket sSLSocket, String str, List<dvb> list) throws IOException {
        rdb rdbVar = this.a;
        if (list != null) {
            a(sSLSocket, str, list);
        }
        try {
            sSLSocket.startHandshake();
            String b2 = b(sSLSocket);
            if (b2 != null) {
                return b2;
            }
            throw new RuntimeException("TLS ALPN negotiation failed with protocols: " + list);
        } finally {
            rdbVar.a(sSLSocket);
        }
    }
}