导航菜单

页面标题

页面副标题

CallApp v2.226 - k.java 源代码

正在查看: CallApp v2.226 应用的 k.java JAVA 源代码文件

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


package mq;

import com.squareup.okhttp.u;
import java.io.IOException;
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.net.ssl.SSLSocket;

public class k {
    public static final k a;

    public static class a extends k {
        public final j b;
        public final j c;
        public final Method d;
        public final Method e;
        public final j f;
        public final j g;

        public a(j jVar, j jVar2, Method method, Method method2, j jVar3, j jVar4) {
            this.b = jVar;
            this.c = jVar2;
            this.d = method;
            this.e = method2;
            this.f = jVar3;
            this.g = jVar4;
        }

        @Override
        public final void b(SSLSocket sSLSocket, String str, List list) {
            this.b.c(sSLSocket, Boolean.TRUE);
            this.c.c(sSLSocket, str);
            j jVar = this.g;
            if (jVar == null || jVar.a(sSLSocket.getClass()) == null) {
                return;
            }
            py.e eVar = new py.e();
            int size = list.size();
            for (int i = 0; i < size; i++) {
                u uVar = (u) list.get(i);
                if (uVar != u.HTTP_1_0) {
                    eVar.Q0(uVar.toString().length());
                    eVar.Y0(uVar.toString());
                }
            }
            try {
                jVar.b(sSLSocket, eVar.G0(eVar.b));
            } catch (InvocationTargetException e) {
                Throwable targetException = e.getTargetException();
                if (targetException instanceof RuntimeException) {
                    throw ((RuntimeException) targetException);
                }
                AssertionError assertionError = new AssertionError("Unexpected exception");
                assertionError.initCause(targetException);
                throw assertionError;
            }
        }

        @Override
        public final void c(Socket socket, InetSocketAddress inetSocketAddress, int i) {
            try {
                socket.connect(inetSocketAddress, i);
            } catch (SecurityException e) {
                IOException iOException = new IOException("Exception in connect");
                iOException.initCause(e);
                throw iOException;
            }
        }

        @Override
        public final String d(SSLSocket sSLSocket) {
            j jVar = this.f;
            if (jVar == null || jVar.a(sSLSocket.getClass()) == null) {
                return null;
            }
            try {
                byte[] bArr = (byte[]) jVar.b(sSLSocket, new Object[0]);
                if (bArr != null) {
                    return new String(bArr, n.c);
                }
                return null;
            } catch (InvocationTargetException e) {
                Throwable targetException = e.getTargetException();
                if (targetException instanceof RuntimeException) {
                    throw ((RuntimeException) targetException);
                }
                AssertionError assertionError = new AssertionError("Unexpected exception");
                assertionError.initCause(targetException);
                throw assertionError;
            }
        }

        @Override
        public final void e(Socket socket) {
            Method method = this.d;
            if (method == null) {
                return;
            }
            try {
                method.invoke(null, socket);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            } catch (InvocationTargetException e2) {
                throw new RuntimeException(e2.getCause());
            }
        }

        @Override
        public final void f(Socket socket) {
            Method method = this.e;
            if (method == null) {
                return;
            }
            try {
                method.invoke(null, socket);
            } catch (IllegalAccessException e) {
                throw new RuntimeException(e);
            } catch (InvocationTargetException e2) {
                throw new RuntimeException(e2.getCause());
            }
        }
    }

    public static class b extends k {
        public final Method b;
        public final Method c;
        public final Method d;
        public final Class e;
        public final Class f;

        public b(Method method, Method method2, Method method3, Class<?> cls, Class<?> cls2) {
            this.b = method;
            this.c = method2;
            this.d = method3;
            this.e = cls;
            this.f = cls2;
        }

        @Override
        public final void a(SSLSocket sSLSocket) {
            try {
                this.d.invoke(null, sSLSocket);
            } catch (IllegalAccessException | InvocationTargetException unused) {
                throw new AssertionError();
            }
        }

        @Override
        public final void b(SSLSocket sSLSocket, String str, List list) {
            ArrayList arrayList = new ArrayList(list.size());
            int size = list.size();
            for (int i = 0; i < size; i++) {
                u uVar = (u) list.get(i);
                if (uVar != u.HTTP_1_0) {
                    arrayList.add(uVar.toString());
                }
            }
            try {
                this.b.invoke(null, sSLSocket, Proxy.newProxyInstance(k.class.getClassLoader(), new Class[]{this.e, this.f}, new c(arrayList)));
            } catch (IllegalAccessException | InvocationTargetException e) {
                throw new AssertionError(e);
            }
        }

        @Override
        public final String d(SSLSocket sSLSocket) {
            try {
                c cVar = (c) Proxy.getInvocationHandler(this.c.invoke(null, sSLSocket));
                boolean z = cVar.b;
                if (!z && cVar.c == null) {
                    f.a.log(Level.INFO, "ALPN callback dropped: SPDY and HTTP/2 are disabled. Is alpn-boot on the boot class path?");
                    return null;
                }
                if (z) {
                    return null;
                }
                return cVar.c;
            } catch (IllegalAccessException | InvocationTargetException unused) {
                throw new AssertionError();
            }
        }
    }

    public static class c implements InvocationHandler {
        public final List a;
        public boolean b;
        public String c;

        public c(List<String> list) {
            this.a = list;
        }

        @Override
        public final Object invoke(Object obj, Method method, Object[] objArr) {
            String name = method.getName();
            Class<?> returnType = method.getReturnType();
            if (objArr == null) {
                objArr = n.b;
            }
            if (name.equals("supports") && Boolean.TYPE == returnType) {
                return Boolean.TRUE;
            }
            if (name.equals("unsupported") && Void.TYPE == returnType) {
                this.b = true;
                return null;
            }
            boolean equals = name.equals("protocols");
            List list = this.a;
            if (equals && objArr.length == 0) {
                return list;
            }
            if ((name.equals("selectProtocol") || name.equals("select")) && String.class == returnType && objArr.length == 1) {
                Object obj2 = objArr[0];
                if (obj2 instanceof List) {
                    List list2 = (List) obj2;
                    int size = list2.size();
                    for (int i = 0; i < size; i++) {
                        if (list.contains(list2.get(i))) {
                            String str = (String) list2.get(i);
                            this.c = str;
                            return str;
                        }
                    }
                    String str2 = (String) list.get(0);
                    this.c = str2;
                    return str2;
                }
            }
            if ((!name.equals("protocolSelected") && !name.equals("selected")) || objArr.length != 1) {
                return method.invoke(this, objArr);
            }
            this.c = (String) objArr[0];
            return null;
        }
    }

    static {
        k kVar;
        Method method;
        j jVar;
        Method method2;
        try {
            try {
                Class.forName("com.android.org.conscrypt.OpenSSLSocketImpl");
            } catch (ClassNotFoundException unused) {
                try {
                    Class<?> cls = Class.forName("org.eclipse.jetty.alpn.ALPN");
                    kVar = new b(cls.getMethod("put", SSLSocket.class, Class.forName("org.eclipse.jetty.alpn.ALPN$Provider")), cls.getMethod("get", SSLSocket.class), cls.getMethod("remove", SSLSocket.class), Class.forName("org.eclipse.jetty.alpn.ALPN$ClientProvider"), Class.forName("org.eclipse.jetty.alpn.ALPN$ServerProvider"));
                } catch (ClassNotFoundException | NoSuchMethodException unused2) {
                    kVar = new k();
                }
            }
        } catch (ClassNotFoundException unused3) {
            Class.forName("org.apache.harmony.xnet.provider.jsse.OpenSSLSocketImpl");
        }
        j jVar2 = new j(null, "setUseSessionTickets", Boolean.TYPE);
        j jVar3 = null;
        j jVar4 = new j(null, "setHostname", String.class);
        try {
            Class<?> cls2 = Class.forName("android.net.TrafficStats");
            method2 = cls2.getMethod("tagSocket", Socket.class);
            try {
                method = cls2.getMethod("untagSocket", Socket.class);
                try {
                    Class.forName("android.net.Network");
                    jVar = new j(byte[].class, "getAlpnSelectedProtocol", new Class[0]);
                    try {
                        jVar3 = new j(null, "setAlpnProtocols", byte[].class);
                    } catch (ClassNotFoundException | NoSuchMethodException unused4) {
                    }
                } catch (ClassNotFoundException | NoSuchMethodException unused5) {
                    jVar = null;
                }
            } catch (ClassNotFoundException | NoSuchMethodException unused6) {
                method = null;
                jVar = null;
            }
        } catch (ClassNotFoundException | NoSuchMethodException unused7) {
            method = null;
            jVar = null;
            method2 = null;
        }
        kVar = new a(jVar2, jVar4, method2, method, jVar, jVar3);
        a = kVar;
    }

    public void a(SSLSocket sSLSocket) {
    }

    public void b(SSLSocket sSLSocket, String str, List list) {
    }

    public void c(Socket socket, InetSocketAddress inetSocketAddress, int i) {
        socket.connect(inetSocketAddress, i);
    }

    public String d(SSLSocket sSLSocket) {
        return null;
    }

    public void e(Socket socket) {
    }

    public void f(Socket socket) {
    }
}