APK反编译源代码展示 - 南明离火平台提供

应用版本信息
应用名称:Ghostify
版本号:4.0
包名称:com.getghostify

MD5 校验值:a9a821418db4ad35214aeeb08c2f5902

反编译源代码说明

e.java 文件包含反编译后的源代码,请注意,该内容仅供学习和参考使用,不得用于非法用途。


package e7;

import androidx.appcompat.widget.l;
import c2.u;
import d7.s;
import java.io.IOException;
import java.lang.reflect.Field;
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.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.X509TrustManager;

public class e {

    public static final e f4277a;

    public static class a extends e {

        public final Class<?> f4278b;

        public final u f4279c;

        public final u f4280d;

        public final u f4281e;

        public final u f4282f;

        public a(Class<?> cls, u uVar, u uVar2, Method method, Method method2, u uVar3, u uVar4) {
            this.f4278b = cls;
            this.f4279c = uVar;
            this.f4280d = uVar2;
            this.f4281e = uVar3;
            this.f4282f = uVar4;
        }

        @Override
        public void b(SSLSocket sSLSocket, String str, List<s> list) {
            if (str != null) {
                this.f4279c.m(sSLSocket, Boolean.TRUE);
                this.f4280d.m(sSLSocket, str);
            }
            u uVar = this.f4282f;
            if (uVar != null) {
                if (uVar.k(sSLSocket.getClass()) != null) {
                    Object[] objArr = new Object[1];
                    o8.d dVar = new o8.d();
                    int size = list.size();
                    for (int i9 = 0; i9 < size; i9++) {
                        s sVar = list.get(i9);
                        if (sVar != s.HTTP_1_0) {
                            dVar.z0(sVar.f4097k.length());
                            dVar.D0(sVar.f4097k);
                        }
                    }
                    objArr[0] = dVar.a0();
                    this.f4282f.n(sSLSocket, objArr);
                }
            }
        }

        @Override
        public void c(Socket socket, InetSocketAddress inetSocketAddress, int i9) {
            try {
                socket.connect(inetSocketAddress, i9);
            } catch (AssertionError e9) {
                if (!g.j(e9)) {
                    throw e9;
                }
                throw new IOException(e9);
            } catch (SecurityException e10) {
                IOException iOException = new IOException("Exception in connect");
                iOException.initCause(e10);
                throw iOException;
            }
        }

        @Override
        public String d(SSLSocket sSLSocket) {
            byte[] bArr;
            u uVar = this.f4281e;
            if (uVar == null) {
                return null;
            }
            if ((uVar.k(sSLSocket.getClass()) != null) && (bArr = (byte[]) this.f4281e.n(sSLSocket, new Object[0])) != null) {
                return new String(bArr, g.f4296c);
            }
            return null;
        }

        @Override
        public X509TrustManager f(SSLSocketFactory sSLSocketFactory) {
            Object e9 = e.e(sSLSocketFactory, this.f4278b, "sslParameters");
            if (e9 == null) {
                try {
                    e9 = e.e(sSLSocketFactory, Class.forName("com.google.android.gms.org.conscrypt.SSLParametersImpl", false, sSLSocketFactory.getClass().getClassLoader()), "sslParameters");
                } catch (ClassNotFoundException unused) {
                    return null;
                }
            }
            X509TrustManager x509TrustManager = (X509TrustManager) e.e(e9, X509TrustManager.class, "x509TrustManager");
            return x509TrustManager != null ? x509TrustManager : (X509TrustManager) e.e(e9, X509TrustManager.class, "trustManager");
        }

        @Override
        public i7.c g(X509TrustManager x509TrustManager) {
            l lVar;
            try {
                Method declaredMethod = x509TrustManager.getClass().getDeclaredMethod("findTrustAnchorByIssuerAndSignature", X509Certificate.class);
                declaredMethod.setAccessible(true);
                lVar = new l(x509TrustManager, declaredMethod);
            } catch (NoSuchMethodException unused) {
                lVar = null;
            }
            return lVar != null ? lVar : new n6.c(x509TrustManager.getAcceptedIssuers());
        }
    }

    public static class b extends e {

        public final Class<?> f4283b;

        public b(Class<?> cls) {
            this.f4283b = cls;
        }

        @Override
        public X509TrustManager f(SSLSocketFactory sSLSocketFactory) {
            Object e9 = e.e(sSLSocketFactory, this.f4283b, "context");
            if (e9 == null) {
                return null;
            }
            return (X509TrustManager) e.e(e9, X509TrustManager.class, "trustManager");
        }
    }

    public static class c extends b {

        public final Method f4284c;

        public final Method f4285d;

        public final Method f4286e;

        public final Class<?> f4287f;

        public final Class<?> f4288g;

        public c(Class<?> cls, Method method, Method method2, Method method3, Class<?> cls2, Class<?> cls3) {
            super(cls);
            this.f4284c = method;
            this.f4285d = method2;
            this.f4286e = method3;
            this.f4287f = cls2;
            this.f4288g = cls3;
        }

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

        @Override
        public void b(SSLSocket sSLSocket, String str, List<s> list) {
            ArrayList arrayList = new ArrayList(list.size());
            int size = list.size();
            for (int i9 = 0; i9 < size; i9++) {
                s sVar = list.get(i9);
                if (sVar != s.HTTP_1_0) {
                    arrayList.add(sVar.f4097k);
                }
            }
            try {
                this.f4284c.invoke(null, sSLSocket, Proxy.newProxyInstance(e.class.getClassLoader(), new Class[]{this.f4287f, this.f4288g}, new d(arrayList)));
            } catch (IllegalAccessException | InvocationTargetException e9) {
                throw new AssertionError(e9);
            }
        }

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

    public static class d implements InvocationHandler {

        public final List<String> f4289a;

        public boolean f4290b;

        public String f4291c;

        public d(List<String> list) {
            this.f4289a = list;
        }

        @Override
        public Object invoke(Object obj, Method method, Object[] objArr) {
            Object obj2;
            String name = method.getName();
            Class<?> returnType = method.getReturnType();
            if (objArr == null) {
                objArr = g.f4295b;
            }
            if (name.equals("supports") && Boolean.TYPE == returnType) {
                return Boolean.TRUE;
            }
            if (name.equals("unsupported") && Void.TYPE == returnType) {
                this.f4290b = true;
                return null;
            }
            if (name.equals("protocols") && objArr.length == 0) {
                return this.f4289a;
            }
            if ((!name.equals("selectProtocol") && !name.equals("select")) || String.class != returnType || objArr.length != 1 || !(objArr[0] instanceof List)) {
                if ((!name.equals("protocolSelected") && !name.equals("selected")) || objArr.length != 1) {
                    return method.invoke(this, objArr);
                }
                this.f4291c = (String) objArr[0];
                return null;
            }
            List list = (List) objArr[0];
            int size = list.size();
            int i9 = 0;
            while (true) {
                if (i9 >= size) {
                    obj2 = this.f4289a.get(0);
                    break;
                }
                if (this.f4289a.contains(list.get(i9))) {
                    obj2 = list.get(i9);
                    break;
                }
                i9++;
            }
            String str = (String) obj2;
            this.f4291c = str;
            return str;
        }
    }

    static {
        e eVar;
        Class<?> cls;
        e bVar;
        Method method;
        u uVar;
        u uVar2;
        Class<byte[]> cls2 = byte[].class;
        try {
            try {
                try {
                    cls = Class.forName("com.android.org.conscrypt.SSLParametersImpl");
                } catch (ClassNotFoundException unused) {
                    eVar = new e();
                }
            } catch (ClassNotFoundException unused2) {
                Class<?> cls3 = Class.forName("sun.security.ssl.SSLContextImpl");
                try {
                    Class<?> cls4 = Class.forName("org.eclipse.jetty.alpn.ALPN");
                    bVar = new c(cls3, cls4.getMethod("put", SSLSocket.class, Class.forName("org.eclipse.jetty.alpn.ALPN$Provider")), cls4.getMethod("get", SSLSocket.class), cls4.getMethod("remove", SSLSocket.class), Class.forName("org.eclipse.jetty.alpn.ALPN$ClientProvider"), Class.forName("org.eclipse.jetty.alpn.ALPN$ServerProvider"));
                } catch (ClassNotFoundException | NoSuchMethodException unused3) {
                    bVar = new b(cls3);
                    eVar = bVar;
                    f4277a = eVar;
                }
                eVar = bVar;
            }
        } catch (ClassNotFoundException unused4) {
            cls = Class.forName("org.apache.harmony.xnet.provider.jsse.SSLParametersImpl");
        }
        Class<?> cls5 = cls;
        int i9 = 6;
        Method method2 = null;
        u uVar3 = new u(method2, "setUseSessionTickets", new Class[]{Boolean.TYPE}, i9);
        u uVar4 = new u(method2, "setHostname", new Class[]{String.class}, i9);
        try {
            Class<?> cls6 = Class.forName("android.net.TrafficStats");
            Method method3 = cls6.getMethod("tagSocket", Socket.class);
            try {
                Method method4 = cls6.getMethod("untagSocket", Socket.class);
                try {
                    Class.forName("android.net.Network");
                    uVar = new u(cls2, "getAlpnSelectedProtocol", new Class[0], i9);
                    try {
                        uVar2 = new u(method2, "setAlpnProtocols", new Class[]{byte[].class}, i9);
                    } catch (ClassNotFoundException | NoSuchMethodException unused5) {
                        uVar2 = null;
                    }
                } catch (ClassNotFoundException | NoSuchMethodException unused6) {
                    uVar = null;
                    uVar2 = null;
                }
                method2 = method3;
                method = method4;
            } catch (ClassNotFoundException | NoSuchMethodException unused7) {
                uVar = null;
                uVar2 = null;
                method2 = method3;
                method = null;
            }
        } catch (ClassNotFoundException | NoSuchMethodException unused8) {
            method = null;
            uVar = null;
            uVar2 = null;
        }
        eVar = new a(cls5, uVar3, uVar4, method2, method, uVar, uVar2);
        f4277a = eVar;
    }

    public static <T> T e(Object obj, Class<T> cls, String str) {
        Object e9;
        for (Class<?> cls2 = obj.getClass(); cls2 != Object.class; cls2 = cls2.getSuperclass()) {
            try {
                Field declaredField = cls2.getDeclaredField(str);
                declaredField.setAccessible(true);
                Object obj2 = declaredField.get(obj);
                if (obj2 != null && cls.isInstance(obj2)) {
                    return cls.cast(obj2);
                }
                return null;
            } catch (IllegalAccessException unused) {
                throw new AssertionError();
            } catch (NoSuchFieldException unused2) {
            }
        }
        if (str.equals("delegate") || (e9 = e(obj, Object.class, "delegate")) == null) {
            return null;
        }
        return (T) e(e9, cls, str);
    }

    public void a(SSLSocket sSLSocket) {
    }

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

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

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

    public X509TrustManager f(SSLSocketFactory sSLSocketFactory) {
        return null;
    }

    public i7.c g(X509TrustManager x509TrustManager) {
        return new n6.c(x509TrustManager.getAcceptedIssuers());
    }
}