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

应用版本信息
应用名称:eSamudaay Seller
版本号:0.6.80
包名称:in.foore.mobile

MD5 校验值:63f8e52e07318fa084f03ba71262387f

反编译源代码说明

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


package ha;

import ea.b0;
import ea.h;
import ea.i;
import ea.j;
import ea.o;
import ea.p;
import ea.r;
import ea.s;
import ea.u;
import ea.v;
import ea.x;
import ea.z;
import java.io.IOException;
import java.lang.ref.Reference;
import java.net.ConnectException;
import java.net.ProtocolException;
import java.net.Proxy;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.UnknownServiceException;
import java.security.cert.Certificate;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import ka.g;
import oa.l;
import oa.s;
import oa.t;

public final class c extends g.j implements h {

    private final i f9833b;

    private final b0 f9834c;

    private Socket f9835d;

    private Socket f9836e;

    private p f9837f;

    private v f9838g;

    private ka.g f9839h;

    private oa.e f9840i;

    private oa.d f9841j;

    public boolean f9842k;

    public int f9843l;

    public int f9844m = 1;

    public final List<Reference<g>> f9845n = new ArrayList();

    public long f9846o = Long.MAX_VALUE;

    public c(i iVar, b0 b0Var) {
        this.f9833b = iVar;
        this.f9834c = b0Var;
    }

    private void e(int i10, int i11, ea.d dVar, o oVar) {
        Proxy b10 = this.f9834c.b();
        this.f9835d = (b10.type() == Proxy.Type.DIRECT || b10.type() == Proxy.Type.HTTP) ? this.f9834c.a().j().createSocket() : new Socket(b10);
        oVar.f(dVar, this.f9834c.d(), b10);
        this.f9835d.setSoTimeout(i11);
        try {
            la.g.l().h(this.f9835d, this.f9834c.d(), i10);
            try {
                this.f9840i = l.b(l.i(this.f9835d));
                this.f9841j = l.a(l.f(this.f9835d));
            } catch (NullPointerException e10) {
                if ("throw with null exception".equals(e10.getMessage())) {
                    throw new IOException(e10);
                }
            }
        } catch (ConnectException e11) {
            ConnectException connectException = new ConnectException("Failed to connect to " + this.f9834c.d());
            connectException.initCause(e11);
            throw connectException;
        }
    }

    private void f(b bVar) {
        SSLSocket sSLSocket;
        ea.a a10 = this.f9834c.a();
        SSLSocket sSLSocket2 = null;
        try {
            try {
                sSLSocket = (SSLSocket) a10.k().createSocket(this.f9835d, a10.l().l(), a10.l().w(), true);
            } catch (AssertionError e10) {
                e = e10;
            }
        } catch (Throwable th) {
            th = th;
        }
        try {
            j a11 = bVar.a(sSLSocket);
            if (a11.f()) {
                la.g.l().g(sSLSocket, a10.l().l(), a10.f());
            }
            sSLSocket.startHandshake();
            SSLSession session = sSLSocket.getSession();
            p b10 = p.b(session);
            if (a10.e().verify(a10.l().l(), session)) {
                a10.a().a(a10.l().l(), b10.c());
                String n10 = a11.f() ? la.g.l().n(sSLSocket) : null;
                this.f9836e = sSLSocket;
                this.f9840i = l.b(l.i(sSLSocket));
                this.f9841j = l.a(l.f(this.f9836e));
                this.f9837f = b10;
                this.f9838g = n10 != null ? v.c(n10) : v.HTTP_1_1;
                la.g.l().a(sSLSocket);
                return;
            }
            List<Certificate> c10 = b10.c();
            if (c10.isEmpty()) {
                throw new SSLPeerUnverifiedException("Hostname " + a10.l().l() + " not verified (no certificates)");
            }
            X509Certificate x509Certificate = (X509Certificate) c10.get(0);
            throw new SSLPeerUnverifiedException("Hostname " + a10.l().l() + " not verified:\n    certificate: " + ea.f.c(x509Certificate) + "\n    DN: " + x509Certificate.getSubjectDN().getName() + "\n    subjectAltNames: " + na.d.a(x509Certificate));
        } catch (AssertionError e11) {
            e = e11;
            if (!fa.c.y(e)) {
                throw e;
            }
            throw new IOException(e);
        } catch (Throwable th2) {
            th = th2;
            sSLSocket2 = sSLSocket;
            if (sSLSocket2 != null) {
                la.g.l().a(sSLSocket2);
            }
            fa.c.f(sSLSocket2);
            throw th;
        }
    }

    private void g(int i10, int i11, int i12, ea.d dVar, o oVar) {
        x i13 = i();
        r h10 = i13.h();
        for (int i14 = 0; i14 < 21; i14++) {
            e(i10, i11, dVar, oVar);
            i13 = h(i11, i12, i13, h10);
            if (i13 == null) {
                return;
            }
            fa.c.f(this.f9835d);
            this.f9835d = null;
            this.f9841j = null;
            this.f9840i = null;
            oVar.d(dVar, this.f9834c.d(), this.f9834c.b(), null);
        }
    }

    private x h(int i10, int i11, x xVar, r rVar) {
        String str = "CONNECT " + fa.c.q(rVar, true) + " HTTP/1.1";
        while (true) {
            ja.a aVar = new ja.a(null, null, this.f9840i, this.f9841j);
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            this.f9840i.c().g(i10, timeUnit);
            this.f9841j.c().g(i11, timeUnit);
            aVar.o(xVar.d(), str);
            aVar.b();
            z c10 = aVar.d(false).p(xVar).c();
            long b10 = ia.e.b(c10);
            if (b10 == -1) {
                b10 = 0;
            }
            s k10 = aVar.k(b10);
            fa.c.B(k10, Integer.MAX_VALUE, timeUnit);
            k10.close();
            int f10 = c10.f();
            if (f10 == 200) {
                if (this.f9840i.b().o() && this.f9841j.b().o()) {
                    return null;
                }
                throw new IOException("TLS tunnel buffered too many bytes!");
            }
            if (f10 != 407) {
                throw new IOException("Unexpected response code for CONNECT: " + c10.f());
            }
            x a10 = this.f9834c.a().h().a(this.f9834c, c10);
            if (a10 == null) {
                throw new IOException("Failed to authenticate with proxy");
            }
            if ("close".equalsIgnoreCase(c10.k("Connection"))) {
                return a10;
            }
            xVar = a10;
        }
    }

    private x i() {
        x a10 = new x.a().f(this.f9834c.a().l()).d("CONNECT", null).b("Host", fa.c.q(this.f9834c.a().l(), true)).b("Proxy-Connection", "Keep-Alive").b("User-Agent", fa.d.a()).a();
        x a11 = this.f9834c.a().h().a(this.f9834c, new z.a().p(a10).n(v.HTTP_1_1).g(407).k("Preemptive Authenticate").b(fa.c.f9223c).q(-1L).o(-1L).i("Proxy-Authenticate", "OkHttp-Preemptive").c());
        return a11 != null ? a11 : a10;
    }

    private void j(b bVar, int i10, ea.d dVar, o oVar) {
        if (this.f9834c.a().k() != null) {
            oVar.u(dVar);
            f(bVar);
            oVar.t(dVar, this.f9837f);
            if (this.f9838g == v.HTTP_2) {
                r(i10);
                return;
            }
            return;
        }
        List<v> f10 = this.f9834c.a().f();
        v vVar = v.H2_PRIOR_KNOWLEDGE;
        if (!f10.contains(vVar)) {
            this.f9836e = this.f9835d;
            this.f9838g = v.HTTP_1_1;
        } else {
            this.f9836e = this.f9835d;
            this.f9838g = vVar;
            r(i10);
        }
    }

    private void r(int i10) {
        this.f9836e.setSoTimeout(0);
        ka.g a10 = new g.h(true).d(this.f9836e, this.f9834c.a().l().l(), this.f9840i, this.f9841j).b(this).c(i10).a();
        this.f9839h = a10;
        a10.i0();
    }

    @Override
    public void a(ka.g gVar) {
        synchronized (this.f9833b) {
            this.f9844m = gVar.L();
        }
    }

    @Override
    public void b(ka.i iVar) {
        iVar.f(ka.b.REFUSED_STREAM);
    }

    public void c() {
        fa.c.f(this.f9835d);
    }

    public void d(int i10, int i11, int i12, int i13, boolean z10, ea.d dVar, o oVar) {
        if (this.f9838g != null) {
            throw new IllegalStateException("already connected");
        }
        List<j> b10 = this.f9834c.a().b();
        b bVar = new b(b10);
        if (this.f9834c.a().k() == null) {
            if (!b10.contains(j.f8922j)) {
                throw new e(new UnknownServiceException("CLEARTEXT communication not enabled for client"));
            }
            String l10 = this.f9834c.a().l().l();
            if (!la.g.l().q(l10)) {
                throw new e(new UnknownServiceException("CLEARTEXT communication to " + l10 + " not permitted by network security policy"));
            }
        } else if (this.f9834c.a().f().contains(v.H2_PRIOR_KNOWLEDGE)) {
            throw new e(new UnknownServiceException("H2_PRIOR_KNOWLEDGE cannot be used with HTTPS"));
        }
        e eVar = null;
        do {
            try {
            } catch (IOException e10) {
                e = e10;
            }
            try {
                if (this.f9834c.c()) {
                    g(i10, i11, i12, dVar, oVar);
                    if (this.f9835d == null) {
                        if (!this.f9834c.c() && this.f9835d == null) {
                            throw new e(new ProtocolException("Too many tunnel connections attempted: 21"));
                        }
                        if (this.f9839h == null) {
                            synchronized (this.f9833b) {
                                this.f9844m = this.f9839h.L();
                            }
                            return;
                        }
                        return;
                    }
                } else {
                    try {
                        e(i10, i11, dVar, oVar);
                    } catch (IOException e11) {
                        e = e11;
                        fa.c.f(this.f9836e);
                        fa.c.f(this.f9835d);
                        this.f9836e = null;
                        this.f9835d = null;
                        this.f9840i = null;
                        this.f9841j = null;
                        this.f9837f = null;
                        this.f9838g = null;
                        this.f9839h = null;
                        oVar.e(dVar, this.f9834c.d(), this.f9834c.b(), null, e);
                        if (eVar != null) {
                            eVar = new e(e);
                        } else {
                            eVar.a(e);
                        }
                        if (z10) {
                            throw eVar;
                        }
                    }
                }
                j(bVar, i13, dVar, oVar);
                oVar.d(dVar, this.f9834c.d(), this.f9834c.b(), this.f9838g);
                if (!this.f9834c.c()) {
                }
                if (this.f9839h == null) {
                }
            } catch (IOException e12) {
                e = e12;
                fa.c.f(this.f9836e);
                fa.c.f(this.f9835d);
                this.f9836e = null;
                this.f9835d = null;
                this.f9840i = null;
                this.f9841j = null;
                this.f9837f = null;
                this.f9838g = null;
                this.f9839h = null;
                oVar.e(dVar, this.f9834c.d(), this.f9834c.b(), null, e);
                if (eVar != null) {
                }
                if (z10) {
                }
            }
        } while (bVar.b(e));
        throw eVar;
    }

    public p k() {
        return this.f9837f;
    }

    public boolean l(ea.a aVar, b0 b0Var) {
        if (this.f9845n.size() >= this.f9844m || this.f9842k || !fa.a.f9219a.g(this.f9834c.a(), aVar)) {
            return false;
        }
        if (aVar.l().l().equals(p().a().l().l())) {
            return true;
        }
        if (this.f9839h == null || b0Var == null || b0Var.b().type() != Proxy.Type.DIRECT || this.f9834c.b().type() != Proxy.Type.DIRECT || !this.f9834c.d().equals(b0Var.d()) || b0Var.a().e() != na.d.f12772a || !s(aVar.l())) {
            return false;
        }
        try {
            aVar.a().a(aVar.l().l(), k().c());
            return true;
        } catch (SSLPeerUnverifiedException unused) {
            return false;
        }
    }

    public boolean m(boolean z10) {
        if (this.f9836e.isClosed() || this.f9836e.isInputShutdown() || this.f9836e.isOutputShutdown()) {
            return false;
        }
        ka.g gVar = this.f9839h;
        if (gVar != null) {
            return gVar.J(System.nanoTime());
        }
        if (z10) {
            try {
                int soTimeout = this.f9836e.getSoTimeout();
                try {
                    this.f9836e.setSoTimeout(1);
                    return !this.f9840i.o();
                } finally {
                    this.f9836e.setSoTimeout(soTimeout);
                }
            } catch (SocketTimeoutException unused) {
            } catch (IOException unused2) {
                return false;
            }
        }
        return true;
    }

    public boolean n() {
        return this.f9839h != null;
    }

    public ia.c o(u uVar, s.a aVar, g gVar) {
        if (this.f9839h != null) {
            return new ka.f(uVar, aVar, gVar, this.f9839h);
        }
        this.f9836e.setSoTimeout(aVar.a());
        t c10 = this.f9840i.c();
        long a10 = aVar.a();
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        c10.g(a10, timeUnit);
        this.f9841j.c().g(aVar.b(), timeUnit);
        return new ja.a(uVar, gVar, this.f9840i, this.f9841j);
    }

    public b0 p() {
        return this.f9834c;
    }

    public Socket q() {
        return this.f9836e;
    }

    public boolean s(r rVar) {
        if (rVar.w() != this.f9834c.a().l().w()) {
            return false;
        }
        if (rVar.l().equals(this.f9834c.a().l().l())) {
            return true;
        }
        return this.f9837f != null && na.d.f12772a.c(rVar.l(), (X509Certificate) this.f9837f.c().get(0));
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Connection{");
        sb.append(this.f9834c.a().l().l());
        sb.append(":");
        sb.append(this.f9834c.a().l().w());
        sb.append(", proxy=");
        sb.append(this.f9834c.b());
        sb.append(" hostAddress=");
        sb.append(this.f9834c.d());
        sb.append(" cipherSuite=");
        p pVar = this.f9837f;
        sb.append(pVar != null ? pVar.a() : "none");
        sb.append(" protocol=");
        sb.append(this.f9838g);
        sb.append('}');
        return sb.toString();
    }
}