赚大钱 v1.0.3.1999版本的 MD5 值为:a9453436fc005889c312ae3afcaa5cfb

以下内容为反编译后的 k.java 源代码,内容仅作参考


package g.h.a;

import android.os.Build;
import g.h.a.g0.d;
import java.nio.ByteBuffer;
import java.security.cert.X509Certificate;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLEngine;
import javax.net.ssl.SSLEngineResult;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
import org.apache.http.conn.ssl.StrictHostnameVerifier;
public class k implements g.h.a.m0.a, j {
    static SSLContext f7602;
    static SSLContext f7603;
    static TrustManager[] f7604;
    o f7605;
    p f7606;
    boolean f7607;
    SSLEngine f7608;
    boolean f7609;
    private String f7610;
    private boolean f7611;
    HostnameVerifier f7612;
    h f7613;
    X509Certificate[] f7614;
    g.h.a.g0.g f7615;
    g.h.a.g0.d f7616;
    boolean f7617;
    boolean f7618;
    Exception f7619;
    final q f7620 = new q();
    final g.h.a.g0.d f7621 = new f();
    q f7622 = new q();
    g.h.a.g0.a f7623;

    static class a implements X509TrustManager {
        a() {
        }

        @Override
        public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) {
        }

        @Override
        public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) {
            for (X509Certificate x509Certificate : x509CertificateArr) {
                if (x509Certificate != null && x509Certificate.getCriticalExtensionOIDs() != null) {
                    x509Certificate.getCriticalExtensionOIDs().remove("2.5.29.15");
                }
            }
        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
            return new X509Certificate[0];
        }
    }

    static class b implements X509TrustManager {
        b() {
        }

        @Override
        public void checkClientTrusted(X509Certificate[] x509CertificateArr, String str) {
        }

        @Override
        public void checkServerTrusted(X509Certificate[] x509CertificateArr, String str) {
        }

        @Override
        public X509Certificate[] getAcceptedIssuers() {
            return new X509Certificate[0];
        }
    }

    public static class c implements g.h.a.g0.a {
        final h f7624;

        c(h hVar) {
            this.f7624 = hVar;
        }

        @Override
        public void mo8842(Exception exc) {
            if (exc != null) {
                this.f7624.mo9126(exc, null);
            } else {
                this.f7624.mo9126(new SSLException("socket closed during handshake"), null);
            }
        }
    }

    class d implements g.h.a.g0.g {
        d() {
        }

        @Override
        public void mo8833() {
            g.h.a.g0.g gVar = k.this.f7615;
            if (gVar != null) {
                gVar.mo8833();
            }
        }
    }

    class e implements g.h.a.g0.a {
        e() {
        }

        @Override
        public void mo8842(Exception exc) {
            g.h.a.g0.a aVar;
            k kVar = k.this;
            if (kVar.f7618) {
                return;
            }
            kVar.f7618 = true;
            kVar.f7619 = exc;
            if (kVar.f7620.m9320() || (aVar = k.this.f7623) == null) {
                return;
            }
            aVar.mo8842(exc);
        }
    }

    class f implements g.h.a.g0.d {
        final g.h.a.l0.a f7627;
        final q f7628;

        f() {
            g.h.a.l0.a aVar = new g.h.a.l0.a();
            aVar.m9200(8192);
            this.f7627 = aVar;
            this.f7628 = new q();
        }

        @Override
        public void mo8808(s sVar, q qVar) {
            k kVar = k.this;
            if (kVar.f7607) {
                return;
            }
            try {
                try {
                    kVar.f7607 = true;
                    qVar.m9308(this.f7628);
                    if (this.f7628.m9320()) {
                        this.f7628.m9304(this.f7628.m9313());
                    }
                    ByteBuffer byteBuffer = q.f7743;
                    while (true) {
                        if (byteBuffer.remaining() == 0 && this.f7628.m9326() > 0) {
                            byteBuffer = this.f7628.m9325();
                        }
                        int remaining = byteBuffer.remaining();
                        int m9324 = k.this.f7620.m9324();
                        ByteBuffer m9195 = this.f7627.m9195();
                        SSLEngineResult unwrap = k.this.f7608.unwrap(byteBuffer, m9195);
                        k.this.m9182(k.this.f7620, m9195);
                        this.f7627.m9197(k.this.f7620.m9324() - m9324);
                        if (unwrap.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW) {
                            this.f7627.m9200(this.f7627.m9198() * 2);
                        } else {
                            if (unwrap.getStatus() == SSLEngineResult.Status.BUFFER_UNDERFLOW) {
                                this.f7628.m9314(byteBuffer);
                                if (this.f7628.m9326() <= 1) {
                                    break;
                                }
                                this.f7628.m9314(this.f7628.m9313());
                                byteBuffer = q.f7743;
                            }
                            k.this.m9178(unwrap.getHandshakeStatus());
                            if (byteBuffer.remaining() != remaining && m9324 == k.this.f7620.m9324()) {
                                this.f7628.m9314(byteBuffer);
                                break;
                            }
                        }
                        remaining = -1;
                        k.this.m9178(unwrap.getHandshakeStatus());
                        if (byteBuffer.remaining() != remaining) {
                        }
                    }
                    k.this.m9184();
                } catch (SSLException e2) {
                    k.this.m9177(e2);
                }
            } finally {
                k.this.f7607 = false;
            }
        }
    }

    public class g implements Runnable {
        g() {
        }

        @Override
        public void run() {
            g.h.a.g0.g gVar = k.this.f7615;
            if (gVar != null) {
                gVar.mo8833();
            }
        }
    }

    public interface h {
        void mo9126(Exception exc, j jVar);
    }

    static {
        try {
        } catch (Exception e2) {
            try {
                f7602 = SSLContext.getInstance("TLS");
                f7602.init(null, new TrustManager[]{new a()}, null);
            } catch (Exception e3) {
                e2.printStackTrace();
                e3.printStackTrace();
            }
        }
        if (Build.VERSION.SDK_INT > 15) {
            f7602 = SSLContext.getInstance("Default");
            try {
                f7603 = SSLContext.getInstance("TLS");
                TrustManager[] trustManagerArr = {new b()};
                f7604 = trustManagerArr;
                f7603.init(null, trustManagerArr, null);
                g.h.a.a aVar = new HostnameVerifier() {
                    @Override
                    public final boolean verify(String str, SSLSession sSLSession) {
                        return k.m9179(str, sSLSession);
                    }
                };
                return;
            } catch (Exception e4) {
                e4.printStackTrace();
                return;
            }
        }
        throw new Exception();
    }

    private k(o oVar, String str, int i2, SSLEngine sSLEngine, TrustManager[] trustManagerArr, HostnameVerifier hostnameVerifier, boolean z) {
        this.f7605 = oVar;
        this.f7612 = hostnameVerifier;
        this.f7617 = z;
        this.f7608 = sSLEngine;
        this.f7610 = str;
        sSLEngine.setUseClientMode(z);
        p pVar = new p(oVar);
        this.f7606 = pVar;
        pVar.mo8854(new d());
        this.f7605.mo8859(new e());
        this.f7605.mo8853(this.f7621);
    }

    public static boolean m9179(String str, SSLSession sSLSession) {
        return true;
    }

    public static SSLContext m9180() {
        return f7602;
    }

    @Override
    public void close() {
        this.f7605.close();
    }

    @Override
    public boolean isOpen() {
        return this.f7605.isOpen();
    }

    @Override
    public void mo8859(g.h.a.g0.a aVar) {
        this.f7623 = aVar;
    }

    @Override
    public void mo8862() {
        this.f7605.mo8862();
    }

    public g.h.a.g0.a m9183() {
        return this.f7623;
    }

    public void m9184() {
        g.h.a.g0.a aVar;
        f0.m8836(this, this.f7620);
        if (!this.f7618 || this.f7620.m9320() || (aVar = this.f7623) == null) {
            return;
        }
        aVar.mo8842(this.f7619);
    }

    @Override
    public g.h.a.g0.d mo8865() {
        return this.f7616;
    }

    @Override
    public void mo8866() {
        this.f7605.mo8866();
        m9184();
    }

    @Override
    public o mo9185() {
        return this.f7605;
    }

    @Override
    public void mo8867() {
        this.f7605.mo8867();
    }

    @Override
    public boolean mo8868() {
        return this.f7605.mo8868();
    }

    @Override
    public String mo8869() {
        return null;
    }

    public static void m9176(o oVar, String str, int i2, SSLEngine sSLEngine, TrustManager[] trustManagerArr, HostnameVerifier hostnameVerifier, boolean z, h hVar) {
        k kVar = new k(oVar, str, i2, sSLEngine, trustManagerArr, hostnameVerifier, z);
        kVar.f7613 = hVar;
        oVar.mo8852(new c(hVar));
        try {
            kVar.f7608.beginHandshake();
            kVar.m9178(kVar.f7608.getHandshakeStatus());
        } catch (SSLException e2) {
            kVar.m9177(e2);
        }
    }

    void m9182(q qVar, ByteBuffer byteBuffer) {
        byteBuffer.flip();
        if (byteBuffer.hasRemaining()) {
            qVar.m9304(byteBuffer);
        } else {
            q.m9301(byteBuffer);
        }
    }

    public void m9178(SSLEngineResult.HandshakeStatus handshakeStatus) {
        if (handshakeStatus == SSLEngineResult.HandshakeStatus.NEED_TASK) {
            this.f7608.getDelegatedTask().run();
        }
        if (handshakeStatus == SSLEngineResult.HandshakeStatus.NEED_WRAP) {
            mo8856(this.f7622);
        }
        if (handshakeStatus == SSLEngineResult.HandshakeStatus.NEED_UNWRAP) {
            this.f7621.mo8808(this, new q());
        }
        try {
            if (this.f7609) {
                return;
            }
            if (this.f7608.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.NOT_HANDSHAKING || this.f7608.getHandshakeStatus() == SSLEngineResult.HandshakeStatus.FINISHED) {
                if (this.f7617) {
                    boolean z = false;
                    try {
                        this.f7614 = (X509Certificate[]) this.f7608.getSession().getPeerCertificates();
                        if (this.f7610 != null) {
                            if (this.f7612 == null) {
                                new StrictHostnameVerifier().verify(this.f7610, StrictHostnameVerifier.getCNs(this.f7614[0]), StrictHostnameVerifier.getDNSSubjectAlts(this.f7614[0]));
                            } else if (!this.f7612.verify(this.f7610, this.f7608.getSession())) {
                                throw new SSLException("hostname <" + this.f7610 + "> has been denied");
                            }
                        }
                        e = null;
                        z = true;
                    } catch (SSLException e2) {
                        e = e2;
                    }
                    this.f7609 = true;
                    if (!z) {
                        i iVar = new i(e);
                        m9177(iVar);
                        if (!iVar.m8925()) {
                            throw iVar;
                        }
                    }
                } else {
                    this.f7609 = true;
                }
                this.f7613.mo9126(null, this);
                this.f7613 = null;
                this.f7605.mo8852((g.h.a.g0.a) null);
                mo8851().m9272(new g());
                m9184();
            }
        } catch (Exception e3) {
            m9177(e3);
        }
    }

    int m9181(int i2) {
        int i3 = (i2 * 3) / 2;
        if (i3 == 0) {
            return 8192;
        }
        return i3;
    }

    @Override
    public void mo8856(q qVar) {
        if (!this.f7611 && this.f7606.m9296() <= 0) {
            this.f7611 = true;
            ByteBuffer m9299 = q.m9299(m9181(qVar.m9324()));
            SSLEngineResult sSLEngineResult = null;
            do {
                if (!this.f7609 || qVar.m9324() != 0) {
                    int m9324 = qVar.m9324();
                    try {
                        ByteBuffer[] m9315 = qVar.m9315();
                        sSLEngineResult = this.f7608.wrap(m9315, m9299);
                        qVar.m9306(m9315);
                        m9299.flip();
                        this.f7622.m9304(m9299);
                        if (this.f7622.m9324() > 0) {
                            this.f7606.mo8856(this.f7622);
                        }
                        int capacity = m9299.capacity();
                        try {
                            if (sSLEngineResult.getStatus() == SSLEngineResult.Status.BUFFER_OVERFLOW) {
                                m9299 = q.m9299(capacity * 2);
                                m9324 = -1;
                            } else {
                                m9299 = q.m9299(m9181(qVar.m9324()));
                                m9178(sSLEngineResult.getHandshakeStatus());
                            }
                        } catch (SSLException e2) {
                            e = e2;
                            m9299 = null;
                            m9177(e);
                            if (m9324 != qVar.m9324()) {
                            }
                            if (this.f7606.m9296() != 0) {
                                this.f7611 = false;
                                q.m9301(m9299);
                            }
                        }
                    } catch (SSLException e3) {
                        e = e3;
                    }
                    if (m9324 != qVar.m9324() && (sSLEngineResult == null || sSLEngineResult.getHandshakeStatus() != SSLEngineResult.HandshakeStatus.NEED_WRAP)) {
                        break;
                    }
                } else {
                    break;
                }
            } while (this.f7606.m9296() != 0);
            this.f7611 = false;
            q.m9301(m9299);
        }
    }

    @Override
    public void mo8854(g.h.a.g0.g gVar) {
        this.f7615 = gVar;
    }

    public void m9177(Exception exc) {
        h hVar = this.f7613;
        if (hVar != null) {
            this.f7613 = null;
            this.f7605.mo8853(new d.a());
            this.f7605.mo8867();
            this.f7605.mo8852((g.h.a.g0.a) null);
            this.f7605.close();
            hVar.mo9126(exc, null);
            return;
        }
        g.h.a.g0.a m9183 = m9183();
        if (m9183 != null) {
            m9183.mo8842(exc);
        }
    }

    @Override
    public void mo8853(g.h.a.g0.d dVar) {
        this.f7616 = dVar;
    }

    @Override
    public void mo8852(g.h.a.g0.a aVar) {
        this.f7605.mo8852(aVar);
    }

    @Override
    public n mo8851() {
        return this.f7605.mo8851();
    }
}