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

应用版本信息
应用名称:Configuration update
版本号:4.6.22
包名称:com.samsung.android.sdm.config

MD5 校验值:d7cfc3eafe99c714976da7c533691439

反编译源代码说明

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


package j4;

import g4.a0;
import g4.b0;
import g4.d0;
import g4.f0;
import g4.h0;
import g4.l;
import g4.s;
import g4.u;
import g4.w;
import g4.x;
import java.io.IOException;
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.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 m4.f;
import m4.n;

public final class e extends f.j implements g4.j {

    public final g f4342b;

    public final h0 f4343c;

    public Socket f4344d;

    public Socket f4345e;

    public u f4346f;

    public b0 f4347g;

    public m4.f f4348h;

    public q4.e f4349i;

    public q4.d f4350j;

    public boolean f4351k;

    public int f4352l;

    public int f4353m;

    public int f4354n;

    public int f4355o = 1;

    public final List f4356p = new ArrayList();

    public long f4357q = Long.MAX_VALUE;

    public e(g gVar, h0 h0Var) {
        this.f4342b = gVar;
        this.f4343c = h0Var;
    }

    @Override
    public void a(m4.f fVar) {
        synchronized (this.f4342b) {
            this.f4355o = fVar.e0();
        }
    }

    @Override
    public void b(m4.i iVar) {
        iVar.d(m4.b.REFUSED_STREAM, null);
    }

    public void c() {
        h4.e.h(this.f4344d);
    }

    public void d(int i5, int i6, int i7, int i8, boolean z4, g4.e eVar, s sVar) {
        if (this.f4347g != null) {
            throw new IllegalStateException("already connected");
        }
        List b5 = this.f4343c.a().b();
        b bVar = new b(b5);
        if (this.f4343c.a().k() == null) {
            if (!b5.contains(l.f3755j)) {
                throw new i(new UnknownServiceException("CLEARTEXT communication not enabled for client"));
            }
            String m5 = this.f4343c.a().l().m();
            if (!n4.f.l().q(m5)) {
                throw new i(new UnknownServiceException("CLEARTEXT communication to " + m5 + " not permitted by network security policy"));
            }
        } else if (this.f4343c.a().f().contains(b0.H2_PRIOR_KNOWLEDGE)) {
            throw new i(new UnknownServiceException("H2_PRIOR_KNOWLEDGE cannot be used with HTTPS"));
        }
        i iVar = null;
        do {
            try {
            } catch (IOException e5) {
                e = e5;
            }
            try {
                if (this.f4343c.c()) {
                    g(i5, i6, i7, eVar, sVar);
                    if (this.f4344d == null) {
                        if (!this.f4343c.c() && this.f4344d == null) {
                            throw new i(new ProtocolException("Too many tunnel connections attempted: 21"));
                        }
                        if (this.f4348h == null) {
                            synchronized (this.f4342b) {
                                this.f4355o = this.f4348h.e0();
                            }
                            return;
                        }
                        return;
                    }
                } else {
                    try {
                        e(i5, i6, eVar, sVar);
                    } catch (IOException e6) {
                        e = e6;
                        h4.e.h(this.f4345e);
                        h4.e.h(this.f4344d);
                        this.f4345e = null;
                        this.f4344d = null;
                        this.f4349i = null;
                        this.f4350j = null;
                        this.f4346f = null;
                        this.f4347g = null;
                        this.f4348h = null;
                        sVar.f(eVar, this.f4343c.d(), this.f4343c.b(), null, e);
                        if (iVar != null) {
                            iVar = new i(e);
                        } else {
                            iVar.a(e);
                        }
                        if (z4) {
                            throw iVar;
                        }
                    }
                }
                j(bVar, i8, eVar, sVar);
                sVar.e(eVar, this.f4343c.d(), this.f4343c.b(), this.f4347g);
                if (!this.f4343c.c()) {
                }
                if (this.f4348h == null) {
                }
            } catch (IOException e7) {
                e = e7;
                h4.e.h(this.f4345e);
                h4.e.h(this.f4344d);
                this.f4345e = null;
                this.f4344d = null;
                this.f4349i = null;
                this.f4350j = null;
                this.f4346f = null;
                this.f4347g = null;
                this.f4348h = null;
                sVar.f(eVar, this.f4343c.d(), this.f4343c.b(), null, e);
                if (iVar != null) {
                }
                if (z4) {
                }
            }
        } while (bVar.b(e));
        throw iVar;
    }

    public final void e(int i5, int i6, g4.e eVar, s sVar) {
        Proxy b5 = this.f4343c.b();
        this.f4344d = (b5.type() == Proxy.Type.DIRECT || b5.type() == Proxy.Type.HTTP) ? this.f4343c.a().j().createSocket() : new Socket(b5);
        sVar.g(eVar, this.f4343c.d(), b5);
        this.f4344d.setSoTimeout(i6);
        try {
            n4.f.l().h(this.f4344d, this.f4343c.d(), i5);
            try {
                this.f4349i = q4.l.b(q4.l.i(this.f4344d));
                this.f4350j = q4.l.a(q4.l.e(this.f4344d));
            } catch (NullPointerException e5) {
                if ("throw with null exception".equals(e5.getMessage())) {
                    throw new IOException(e5);
                }
            }
        } catch (ConnectException e6) {
            ConnectException connectException = new ConnectException("Failed to connect to " + this.f4343c.d());
            connectException.initCause(e6);
            throw connectException;
        }
    }

    public final void f(b bVar) {
        SSLSocket sSLSocket;
        g4.a a5 = this.f4343c.a();
        SSLSocket sSLSocket2 = null;
        try {
            try {
                sSLSocket = (SSLSocket) a5.k().createSocket(this.f4344d, a5.l().m(), a5.l().y(), true);
            } catch (AssertionError e5) {
                e = e5;
            }
        } catch (Throwable th) {
            th = th;
        }
        try {
            l a6 = bVar.a(sSLSocket);
            if (a6.f()) {
                n4.f.l().g(sSLSocket, a5.l().m(), a5.f());
            }
            sSLSocket.startHandshake();
            SSLSession session = sSLSocket.getSession();
            u b5 = u.b(session);
            if (a5.e().verify(a5.l().m(), session)) {
                a5.a().a(a5.l().m(), b5.d());
                String n5 = a6.f() ? n4.f.l().n(sSLSocket) : null;
                this.f4345e = sSLSocket;
                this.f4349i = q4.l.b(q4.l.i(sSLSocket));
                this.f4350j = q4.l.a(q4.l.e(this.f4345e));
                this.f4346f = b5;
                this.f4347g = n5 != null ? b0.a(n5) : b0.HTTP_1_1;
                n4.f.l().a(sSLSocket);
                return;
            }
            List d5 = b5.d();
            if (d5.isEmpty()) {
                throw new SSLPeerUnverifiedException("Hostname " + a5.l().m() + " not verified (no certificates)");
            }
            X509Certificate x509Certificate = (X509Certificate) d5.get(0);
            throw new SSLPeerUnverifiedException("Hostname " + a5.l().m() + " not verified:\n    certificate: " + g4.g.c(x509Certificate) + "\n    DN: " + x509Certificate.getSubjectDN().getName() + "\n    subjectAltNames: " + p4.d.a(x509Certificate));
        } catch (AssertionError e6) {
            e = e6;
            if (!h4.e.A(e)) {
                throw e;
            }
            throw new IOException(e);
        } catch (Throwable th2) {
            th = th2;
            sSLSocket2 = sSLSocket;
            if (sSLSocket2 != null) {
                n4.f.l().a(sSLSocket2);
            }
            h4.e.h(sSLSocket2);
            throw th;
        }
    }

    public final void g(int i5, int i6, int i7, g4.e eVar, s sVar) {
        d0 i8 = i();
        w i9 = i8.i();
        for (int i10 = 0; i10 < 21; i10++) {
            e(i5, i6, eVar, sVar);
            i8 = h(i6, i7, i8, i9);
            if (i8 == null) {
                return;
            }
            h4.e.h(this.f4344d);
            this.f4344d = null;
            this.f4350j = null;
            this.f4349i = null;
            sVar.e(eVar, this.f4343c.d(), this.f4343c.b(), null);
        }
    }

    public final d0 h(int i5, int i6, d0 d0Var, w wVar) {
        String str = "CONNECT " + h4.e.s(wVar, true) + " HTTP/1.1";
        while (true) {
            l4.a aVar = new l4.a(null, null, this.f4349i, this.f4350j);
            TimeUnit timeUnit = TimeUnit.MILLISECONDS;
            this.f4349i.timeout().g(i5, timeUnit);
            this.f4350j.timeout().g(i6, timeUnit);
            aVar.B(d0Var.d(), str);
            aVar.d();
            f0 c5 = aVar.f(false).q(d0Var).c();
            aVar.A(c5);
            int h5 = c5.h();
            if (h5 == 200) {
                if (this.f4349i.h0().i0() && this.f4350j.a().i0()) {
                    return null;
                }
                throw new IOException("TLS tunnel buffered too many bytes!");
            }
            if (h5 != 407) {
                throw new IOException("Unexpected response code for CONNECT: " + c5.h());
            }
            d0 c6 = this.f4343c.a().h().c(this.f4343c, c5);
            if (c6 == null) {
                throw new IOException("Failed to authenticate with proxy");
            }
            if ("close".equalsIgnoreCase(c5.p("Connection"))) {
                return c6;
            }
            d0Var = c6;
        }
    }

    public final d0 i() {
        d0 b5 = new d0.a().h(this.f4343c.a().l()).e("CONNECT", null).c("Host", h4.e.s(this.f4343c.a().l(), true)).c("Proxy-Connection", "Keep-Alive").c("User-Agent", h4.f.a()).b();
        d0 c5 = this.f4343c.a().h().c(this.f4343c, new f0.a().q(b5).o(b0.HTTP_1_1).g(407).l("Preemptive Authenticate").b(h4.e.f4073d).r(-1L).p(-1L).i("Proxy-Authenticate", "OkHttp-Preemptive").c());
        return c5 != null ? c5 : b5;
    }

    public final void j(b bVar, int i5, g4.e eVar, s sVar) {
        if (this.f4343c.a().k() != null) {
            sVar.y(eVar);
            f(bVar);
            sVar.x(eVar, this.f4346f);
            if (this.f4347g == b0.HTTP_2) {
                t(i5);
                return;
            }
            return;
        }
        List f5 = this.f4343c.a().f();
        b0 b0Var = b0.H2_PRIOR_KNOWLEDGE;
        if (!f5.contains(b0Var)) {
            this.f4345e = this.f4344d;
            this.f4347g = b0.HTTP_1_1;
        } else {
            this.f4345e = this.f4344d;
            this.f4347g = b0Var;
            t(i5);
        }
    }

    public u k() {
        return this.f4346f;
    }

    public boolean l(g4.a aVar, List list) {
        if (this.f4356p.size() >= this.f4355o || this.f4351k || !h4.a.f4066a.e(this.f4343c.a(), aVar)) {
            return false;
        }
        if (aVar.l().m().equals(q().a().l().m())) {
            return true;
        }
        if (this.f4348h == null || list == null || !r(list) || aVar.e() != p4.d.f5639a || !u(aVar.l())) {
            return false;
        }
        try {
            aVar.a().a(aVar.l().m(), k().d());
            return true;
        } catch (SSLPeerUnverifiedException unused) {
            return false;
        }
    }

    public boolean m(boolean z4) {
        if (this.f4345e.isClosed() || this.f4345e.isInputShutdown() || this.f4345e.isOutputShutdown()) {
            return false;
        }
        m4.f fVar = this.f4348h;
        if (fVar != null) {
            return fVar.d0(System.nanoTime());
        }
        if (z4) {
            try {
                int soTimeout = this.f4345e.getSoTimeout();
                try {
                    this.f4345e.setSoTimeout(1);
                    return !this.f4349i.i0();
                } finally {
                    this.f4345e.setSoTimeout(soTimeout);
                }
            } catch (SocketTimeoutException unused) {
            } catch (IOException unused2) {
                return false;
            }
        }
        return true;
    }

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

    public k4.c o(a0 a0Var, x.a aVar) {
        if (this.f4348h != null) {
            return new m4.g(a0Var, this, aVar, this.f4348h);
        }
        this.f4345e.setSoTimeout(aVar.d());
        q4.u timeout = this.f4349i.timeout();
        long d5 = aVar.d();
        TimeUnit timeUnit = TimeUnit.MILLISECONDS;
        timeout.g(d5, timeUnit);
        this.f4350j.timeout().g(aVar.a(), timeUnit);
        return new l4.a(a0Var, this, this.f4349i, this.f4350j);
    }

    public void p() {
        synchronized (this.f4342b) {
            this.f4351k = true;
        }
    }

    public h0 q() {
        return this.f4343c;
    }

    public final boolean r(List list) {
        int size = list.size();
        for (int i5 = 0; i5 < size; i5++) {
            h0 h0Var = (h0) list.get(i5);
            if (h0Var.b().type() == Proxy.Type.DIRECT && this.f4343c.b().type() == Proxy.Type.DIRECT && this.f4343c.d().equals(h0Var.d())) {
                return true;
            }
        }
        return false;
    }

    public Socket s() {
        return this.f4345e;
    }

    public final void t(int i5) {
        this.f4345e.setSoTimeout(0);
        m4.f a5 = new f.h(true).d(this.f4345e, this.f4343c.a().l().m(), this.f4349i, this.f4350j).b(this).c(i5).a();
        this.f4348h = a5;
        a5.H0();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("Connection{");
        sb.append(this.f4343c.a().l().m());
        sb.append(":");
        sb.append(this.f4343c.a().l().y());
        sb.append(", proxy=");
        sb.append(this.f4343c.b());
        sb.append(" hostAddress=");
        sb.append(this.f4343c.d());
        sb.append(" cipherSuite=");
        u uVar = this.f4346f;
        sb.append(uVar != null ? uVar.a() : "none");
        sb.append(" protocol=");
        sb.append(this.f4347g);
        sb.append('}');
        return sb.toString();
    }

    public boolean u(w wVar) {
        if (wVar.y() != this.f4343c.a().l().y()) {
            return false;
        }
        if (wVar.m().equals(this.f4343c.a().l().m())) {
            return true;
        }
        return this.f4346f != null && p4.d.f5639a.c(wVar.m(), (X509Certificate) this.f4346f.d().get(0));
    }

    public void v(IOException iOException) {
        synchronized (this.f4342b) {
            if (iOException instanceof n) {
                m4.b bVar = ((n) iOException).f5291d;
                if (bVar == m4.b.REFUSED_STREAM) {
                    int i5 = this.f4354n + 1;
                    this.f4354n = i5;
                    if (i5 > 1) {
                        this.f4351k = true;
                        this.f4352l++;
                    }
                } else if (bVar != m4.b.CANCEL) {
                    this.f4351k = true;
                    this.f4352l++;
                }
            } else if (!n() || (iOException instanceof m4.a)) {
                this.f4351k = true;
                if (this.f4353m == 0) {
                    if (iOException != null) {
                        this.f4342b.c(this.f4343c, iOException);
                    }
                    this.f4352l++;
                }
            }
        }
    }
}