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

应用版本信息
应用名称:Shopping List
版本号:2.74
包名称:com.icedblueberry.shoppinglisteasy

MD5 校验值:8005b9444b02324a81f85f1ef7e26f28

反编译源代码说明

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


package rc;

import java.io.IOException;
import java.io.InterruptedIOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.ProtocolException;
import java.net.Proxy;
import java.net.Socket;
import java.net.SocketException;
import java.net.UnknownServiceException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLProtocolException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import oc.c0;
import oc.h;
import oc.i;
import oc.n;
import oc.p;
import oc.u;
import oc.v;
import oc.x;
import oc.z;
import tc.a;
import ua.x;
import uc.g;
import uc.t;
import yc.q;
import yc.r;

public final class c extends g.c {

    public final h f20733b;

    public final c0 f20734c;

    public Socket f20735d;

    public Socket f20736e;

    public p f20737f;

    public v f20738g;

    public g f20739h;

    public r f20740i;
    public q j;

    public boolean f20741k;

    public int f20742l;

    public int f20743m = 1;

    public final ArrayList f20744n = new ArrayList();

    public long f20745o = Long.MAX_VALUE;

    public c(h hVar, c0 c0Var) {
        this.f20733b = hVar;
        this.f20734c = c0Var;
    }

    @Override
    public final void a(g gVar) {
        int i10;
        synchronized (this.f20733b) {
            try {
                synchronized (gVar) {
                    t tVar = gVar.G;
                    i10 = x.UNINITIALIZED_SERIALIZED_SIZE;
                    if ((tVar.f22483a & 16) != 0) {
                        i10 = tVar.f22484b[4];
                    }
                }
                this.f20743m = i10;
            } catch (Throwable th) {
                throw th;
            }
        }
    }

    @Override
    public final void b(uc.p pVar) throws IOException {
        pVar.c(5);
    }

    public final void c(int i10, int i11, int i12, boolean z10, n nVar) {
        boolean z11;
        boolean z12;
        boolean z13;
        c0 c0Var;
        int i13;
        if (this.f20738g == null) {
            oc.a aVar = this.f20734c.f20006a;
            List<i> list = aVar.f19982f;
            b bVar = new b(list);
            if (aVar.f19985i == null) {
                if (list.contains(i.f20047f)) {
                    String str = this.f20734c.f20006a.f19977a.f20087d;
                    if (!vc.f.f23165a.k(str)) {
                        throw new d(new UnknownServiceException(e5.b.c("CLEARTEXT communication to ", str, " not permitted by network security policy")));
                    }
                } else {
                    throw new d(new UnknownServiceException("CLEARTEXT communication not enabled for client"));
                }
            } else if (aVar.f19981e.contains(v.H2_PRIOR_KNOWLEDGE)) {
                throw new d(new UnknownServiceException("H2_PRIOR_KNOWLEDGE cannot be used with HTTPS"));
            }
            d dVar = null;
            do {
                boolean z14 = true;
                z11 = false;
                try {
                    c0 c0Var2 = this.f20734c;
                    if (c0Var2.f20006a.f19985i != null && c0Var2.f20007b.type() == Proxy.Type.HTTP) {
                        z13 = true;
                    } else {
                        z13 = false;
                    }
                    if (z13) {
                        e(i10, i11, i12, nVar);
                        if (this.f20735d == null) {
                            c0Var = this.f20734c;
                            if (c0Var.f20006a.f19985i != null || c0Var.f20007b.type() != Proxy.Type.HTTP) {
                                z14 = false;
                            }
                            if (!z14 && this.f20735d == null) {
                                throw new d(new ProtocolException("Too many tunnel connections attempted: 21"));
                            }
                            if (this.f20739h == null) {
                                synchronized (this.f20733b) {
                                    g gVar = this.f20739h;
                                    synchronized (gVar) {
                                        t tVar = gVar.G;
                                        i13 = x.UNINITIALIZED_SERIALIZED_SIZE;
                                        if ((tVar.f22483a & 16) != 0) {
                                            i13 = tVar.f22484b[4];
                                        }
                                    }
                                    this.f20743m = i13;
                                }
                                return;
                            }
                            return;
                        }
                    } else {
                        d(i10, i11, nVar);
                    }
                    f(bVar, nVar);
                    InetSocketAddress inetSocketAddress = this.f20734c.f20008c;
                    nVar.getClass();
                    c0Var = this.f20734c;
                    if (c0Var.f20006a.f19985i != null) {
                    }
                    z14 = false;
                    if (!z14) {
                    }
                    if (this.f20739h == null) {
                    }
                } catch (IOException e10) {
                    pc.b.d(this.f20736e);
                    pc.b.d(this.f20735d);
                    this.f20736e = null;
                    this.f20735d = null;
                    this.f20740i = null;
                    this.j = null;
                    this.f20737f = null;
                    this.f20738g = null;
                    this.f20739h = null;
                    InetSocketAddress inetSocketAddress2 = this.f20734c.f20008c;
                    nVar.getClass();
                    if (dVar == null) {
                        dVar = new d(e10);
                    } else {
                        IOException iOException = dVar.f20746s;
                        Method method = pc.b.f20510g;
                        if (method != null) {
                            try {
                                method.invoke(iOException, e10);
                            } catch (IllegalAccessException | InvocationTargetException unused) {
                            }
                        }
                        dVar.f20747t = e10;
                    }
                    if (z10) {
                        bVar.f20732d = true;
                        if (bVar.f20731c && !(e10 instanceof ProtocolException) && !(e10 instanceof InterruptedIOException) && ((!((z12 = e10 instanceof SSLHandshakeException)) || !(e10.getCause() instanceof CertificateException)) && !(e10 instanceof SSLPeerUnverifiedException))) {
                            if (!z12 && !(e10 instanceof SSLProtocolException) && !(e10 instanceof SSLException)) {
                                z14 = false;
                            }
                            z11 = z14;
                        }
                    } else {
                        throw dVar;
                    }
                }
            } while (z11);
            throw dVar;
        }
        throw new IllegalStateException("already connected");
    }

    public final void d(int i10, int i11, n nVar) throws IOException {
        Socket createSocket;
        c0 c0Var = this.f20734c;
        Proxy proxy = c0Var.f20007b;
        oc.a aVar = c0Var.f20006a;
        if (proxy.type() != Proxy.Type.DIRECT && proxy.type() != Proxy.Type.HTTP) {
            createSocket = new Socket(proxy);
        } else {
            createSocket = aVar.f19979c.createSocket();
        }
        this.f20735d = createSocket;
        InetSocketAddress inetSocketAddress = this.f20734c.f20008c;
        nVar.getClass();
        this.f20735d.setSoTimeout(i11);
        try {
            vc.f.f23165a.g(this.f20735d, this.f20734c.f20008c, i10);
            try {
                this.f20740i = new r(yc.p.b(this.f20735d));
                this.j = new q(yc.p.a(this.f20735d));
            } catch (NullPointerException e10) {
                if (!"throw with null exception".equals(e10.getMessage())) {
                } else {
                    throw new IOException(e10);
                }
            }
        } catch (ConnectException e11) {
            StringBuilder h10 = c.b.h("Failed to connect to ");
            h10.append(this.f20734c.f20008c);
            ConnectException connectException = new ConnectException(h10.toString());
            connectException.initCause(e11);
            throw connectException;
        }
    }

    public final void e(int i10, int i11, int i12, n nVar) throws IOException {
        x.a aVar = new x.a();
        oc.r rVar = this.f20734c.f20006a.f19977a;
        if (rVar != null) {
            aVar.f20131a = rVar;
            aVar.b("CONNECT", null);
            aVar.f20133c.c("Host", pc.b.k(this.f20734c.f20006a.f19977a, true));
            aVar.f20133c.c("Proxy-Connection", "Keep-Alive");
            aVar.f20133c.c("User-Agent", "okhttp/3.12.1");
            oc.x a10 = aVar.a();
            z.a aVar2 = new z.a();
            aVar2.f20142a = a10;
            aVar2.f20143b = v.HTTP_1_1;
            aVar2.f20144c = 407;
            aVar2.f20145d = "Preemptive Authenticate";
            aVar2.f20148g = pc.b.f20506c;
            aVar2.f20151k = -1L;
            aVar2.f20152l = -1L;
            aVar2.f20147f.c("Proxy-Authenticate", "OkHttp-Preemptive");
            aVar2.a();
            this.f20734c.f20006a.f19980d.getClass();
            oc.r rVar2 = a10.f20126a;
            d(i10, i11, nVar);
            String str = "CONNECT " + pc.b.k(rVar2, true) + " HTTP/1.1";
            r rVar3 = this.f20740i;
            tc.a aVar3 = new tc.a(null, null, rVar3, this.j);
            yc.x g10 = rVar3.g();
            long j = i11;
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            g10.g(j, timeUnit);
            this.j.g().g(i12, timeUnit);
            aVar3.i(a10.f20128c, str);
            aVar3.b();
            z.a d10 = aVar3.d(false);
            d10.f20142a = a10;
            z a11 = d10.a();
            long a12 = sc.e.a(a11);
            if (a12 == -1) {
                a12 = 0;
            }
            a.e g11 = aVar3.g(a12);
            pc.b.p(g11, ua.x.UNINITIALIZED_SERIALIZED_SIZE, timeUnit);
            g11.close();
            int i13 = a11.f20137u;
            if (i13 != 200) {
                if (i13 == 407) {
                    this.f20734c.f20006a.f19980d.getClass();
                    throw new IOException("Failed to authenticate with proxy");
                }
                StringBuilder h10 = c.b.h("Unexpected response code for CONNECT: ");
                h10.append(a11.f20137u);
                throw new IOException(h10.toString());
            }
            if (this.f20740i.f23909s.B() && this.j.f23906s.B()) {
                return;
            } else {
                throw new IOException("TLS tunnel buffered too many bytes!");
            }
        }
        throw new NullPointerException("url == null");
    }

    public final void f(b bVar, n nVar) throws IOException {
        SSLSocket sSLSocket;
        v vVar = v.HTTP_1_1;
        oc.a aVar = this.f20734c.f20006a;
        if (aVar.f19985i == null) {
            List<v> list = aVar.f19981e;
            v vVar2 = v.H2_PRIOR_KNOWLEDGE;
            if (list.contains(vVar2)) {
                this.f20736e = this.f20735d;
                this.f20738g = vVar2;
                i();
                return;
            } else {
                this.f20736e = this.f20735d;
                this.f20738g = vVar;
                return;
            }
        }
        nVar.getClass();
        oc.a aVar2 = this.f20734c.f20006a;
        SSLSocketFactory sSLSocketFactory = aVar2.f19985i;
        String str = null;
        try {
            try {
                Socket socket = this.f20735d;
                oc.r rVar = aVar2.f19977a;
                sSLSocket = (SSLSocket) sSLSocketFactory.createSocket(socket, rVar.f20087d, rVar.f20088e, true);
            } catch (Throwable th) {
                th = th;
                sSLSocket = null;
            }
        } catch (AssertionError e10) {
            e = e10;
        }
        try {
            i a10 = bVar.a(sSLSocket);
            if (a10.f20049b) {
                vc.f.f23165a.f(sSLSocket, aVar2.f19977a.f20087d, aVar2.f19981e);
            }
            sSLSocket.startHandshake();
            SSLSession session = sSLSocket.getSession();
            p a11 = p.a(session);
            if (aVar2.j.verify(aVar2.f19977a.f20087d, session)) {
                aVar2.f19986k.a(aVar2.f19977a.f20087d, a11.f20080c);
                if (a10.f20049b) {
                    str = vc.f.f23165a.i(sSLSocket);
                }
                this.f20736e = sSLSocket;
                this.f20740i = new r(yc.p.b(sSLSocket));
                this.j = new q(yc.p.a(this.f20736e));
                this.f20737f = a11;
                if (str != null) {
                    vVar = v.f(str);
                }
                this.f20738g = vVar;
                vc.f.f23165a.a(sSLSocket);
                if (this.f20738g == v.HTTP_2) {
                    i();
                    return;
                }
                return;
            }
            X509Certificate x509Certificate = (X509Certificate) a11.f20080c.get(0);
            throw new SSLPeerUnverifiedException("Hostname " + aVar2.f19977a.f20087d + " not verified:\n    certificate: " + oc.f.b(x509Certificate) + "\n    DN: " + x509Certificate.getSubjectDN().getName() + "\n    subjectAltNames: " + xc.d.a(x509Certificate));
        } catch (AssertionError e11) {
            e = e11;
            if (pc.b.n(e)) {
                throw new IOException(e);
            }
            throw e;
        } catch (Throwable th2) {
            th = th2;
            if (sSLSocket != null) {
                vc.f.f23165a.a(sSLSocket);
            }
            pc.b.d(sSLSocket);
            throw th;
        }
    }

    public final boolean g(oc.a aVar, c0 c0Var) {
        if (this.f20744n.size() < this.f20743m && !this.f20741k) {
            u.a aVar2 = pc.a.f20503a;
            oc.a aVar3 = this.f20734c.f20006a;
            aVar2.getClass();
            if (!aVar3.a(aVar)) {
                return false;
            }
            if (aVar.f19977a.f20087d.equals(this.f20734c.f20006a.f19977a.f20087d)) {
                return true;
            }
            if (this.f20739h == null || c0Var == null || c0Var.f20007b.type() != Proxy.Type.DIRECT || this.f20734c.f20007b.type() != Proxy.Type.DIRECT || !this.f20734c.f20008c.equals(c0Var.f20008c) || c0Var.f20006a.j != xc.d.f23676a || !j(aVar.f19977a)) {
                return false;
            }
            try {
                aVar.f19986k.a(aVar.f19977a.f20087d, this.f20737f.f20080c);
                return true;
            } catch (SSLPeerUnverifiedException unused) {
            }
        }
        return false;
    }

    public final sc.c h(u uVar, sc.f fVar, f fVar2) throws SocketException {
        if (this.f20739h != null) {
            return new uc.e(uVar, fVar, fVar2, this.f20739h);
        }
        this.f20736e.setSoTimeout(fVar.j);
        yc.x g10 = this.f20740i.g();
        long j = fVar.j;
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        g10.g(j, timeUnit);
        this.j.g().g(fVar.f20880k, timeUnit);
        return new tc.a(uVar, fVar2, this.f20740i, this.j);
    }

    public final void i() throws IOException {
        boolean z10;
        int i10;
        this.f20736e.setSoTimeout(0);
        g.b bVar = new g.b();
        Socket socket = this.f20736e;
        String str = this.f20734c.f20006a.f19977a.f20087d;
        r rVar = this.f20740i;
        q qVar = this.j;
        bVar.f22419a = socket;
        bVar.f22420b = str;
        bVar.f22421c = rVar;
        bVar.f22422d = qVar;
        bVar.f22423e = this;
        bVar.f22424f = 0;
        g gVar = new g(bVar);
        this.f20739h = gVar;
        uc.q qVar2 = gVar.J;
        synchronized (qVar2) {
            if (!qVar2.f22473w) {
                if (qVar2.f22471t) {
                    Logger logger = uc.q.f22469y;
                    if (logger.isLoggable(Level.FINE)) {
                        logger.fine(pc.b.j(">> CONNECTION %s", uc.d.f22395a.o()));
                    }
                    qVar2.f22470s.write(uc.d.f22395a.v());
                    qVar2.f22470s.flush();
                }
            } else {
                throw new IOException("closed");
            }
        }
        uc.q qVar3 = gVar.J;
        t tVar = gVar.F;
        synchronized (qVar3) {
            if (!qVar3.f22473w) {
                qVar3.b(0, Integer.bitCount(tVar.f22483a) * 6, (byte) 4, (byte) 0);
                for (int i11 = 0; i11 < 10; i11++) {
                    if (((1 << i11) & tVar.f22483a) != 0) {
                        z10 = true;
                    } else {
                        z10 = false;
                    }
                    if (z10) {
                        if (i11 == 4) {
                            i10 = 3;
                        } else if (i11 == 7) {
                            i10 = 4;
                        } else {
                            i10 = i11;
                        }
                        qVar3.f22470s.writeShort(i10);
                        qVar3.f22470s.writeInt(tVar.f22484b[i11]);
                    }
                }
                qVar3.f22470s.flush();
            } else {
                throw new IOException("closed");
            }
        }
        if (gVar.F.a() != 65535) {
            gVar.J.K(0, r0 - 65535);
        }
        new Thread(gVar.K).start();
    }

    public final boolean j(oc.r rVar) {
        int i10 = rVar.f20088e;
        oc.r rVar2 = this.f20734c.f20006a.f19977a;
        if (i10 != rVar2.f20088e) {
            return false;
        }
        if (rVar.f20087d.equals(rVar2.f20087d)) {
            return true;
        }
        p pVar = this.f20737f;
        if (pVar == null || !xc.d.c(rVar.f20087d, (X509Certificate) pVar.f20080c.get(0))) {
            return false;
        }
        return true;
    }

    public final String toString() {
        Object obj;
        StringBuilder h10 = c.b.h("Connection{");
        h10.append(this.f20734c.f20006a.f19977a.f20087d);
        h10.append(":");
        h10.append(this.f20734c.f20006a.f19977a.f20088e);
        h10.append(", proxy=");
        h10.append(this.f20734c.f20007b);
        h10.append(" hostAddress=");
        h10.append(this.f20734c.f20008c);
        h10.append(" cipherSuite=");
        p pVar = this.f20737f;
        if (pVar != null) {
            obj = pVar.f20079b;
        } else {
            obj = "none";
        }
        h10.append(obj);
        h10.append(" protocol=");
        h10.append(this.f20738g);
        h10.append('}');
        return h10.toString();
    }
}