正在查看: Releam v2.13.2 应用的 k.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Releam v2.13.2 应用的 k.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package va;
import a0.w;
import c4.r2;
import com.fasterxml.aalto.util.XmlConsts;
import com.google.api.client.http.HttpMethods;
import fb.q;
import fb.r;
import java.io.IOException;
import java.io.InterruptedIOException;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.ProtocolException;
import java.net.Proxy;
import java.net.Socket;
import java.net.SocketTimeoutException;
import java.net.UnknownServiceException;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLException;
import javax.net.ssl.SSLHandshakeException;
import javax.net.ssl.SSLPeerUnverifiedException;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import org.apache.commons.codec.digest.MessageDigestAlgorithms;
import org.apache.poi.hpsf.Variant;
import ra.b0;
import ra.i0;
import ra.j0;
import ra.k0;
import ra.o;
import ra.o0;
import ra.p;
import ra.p0;
import ra.s0;
import ra.x;
import ra.y;
import ya.a0;
import ya.d0;
import ya.t;
import ya.u;
import ya.z;
public final class k extends ya.j {
public final s0 f10137b;
public Socket f10138c;
public Socket f10139d;
public x f10140e;
public j0 f10141f;
public t f10142g;
public r f10143h;
public q f10144i;
public boolean f10145j;
public boolean f10146k;
public int f10147l;
public int f10148m;
public int f10149n;
public int f10150o;
public final ArrayList f10151p;
public long f10152q;
public k(l lVar, s0 s0Var) {
s9.a.n(lVar, "connectionPool");
s9.a.n(s0Var, "route");
this.f10137b = s0Var;
this.f10150o = 1;
this.f10151p = new ArrayList();
this.f10152q = Long.MAX_VALUE;
}
public static void d(i0 i0Var, s0 s0Var, IOException iOException) {
s9.a.n(i0Var, "client");
s9.a.n(s0Var, "failedRoute");
s9.a.n(iOException, "failure");
if (s0Var.f8930b.type() != Proxy.Type.DIRECT) {
ra.a aVar = s0Var.f8929a;
aVar.f8720h.connectFailed(aVar.f8721i.g(), s0Var.f8930b.address(), iOException);
}
z6.c cVar = i0Var.f8841t0;
synchronized (cVar) {
cVar.f11163a.add(s0Var);
}
}
@Override
public final synchronized void a(t tVar, d0 d0Var) {
s9.a.n(tVar, "connection");
s9.a.n(d0Var, "settings");
this.f10150o = (d0Var.f10991a & 16) != 0 ? d0Var.f10992b[4] : Integer.MAX_VALUE;
}
@Override
public final void b(z zVar) {
s9.a.n(zVar, "stream");
zVar.c(ya.b.REFUSED_STREAM, null);
}
public final void c(int i10, int i11, int i12, boolean z10, i iVar, t6.e eVar) {
s0 s0Var;
s9.a.n(iVar, "call");
s9.a.n(eVar, "eventListener");
if (!(this.f10141f == null)) {
throw new IllegalStateException("already connected".toString());
}
List list = this.f10137b.f8929a.f8723k;
r2 r2Var = new r2(list);
ra.a aVar = this.f10137b.f8929a;
if (aVar.f8715c == null) {
if (!list.contains(o.f8885f)) {
throw new m(new UnknownServiceException("CLEARTEXT communication not enabled for client"));
}
String str = this.f10137b.f8929a.f8721i.f8736d;
ab.l lVar = ab.l.f320a;
if (!ab.l.f320a.h(str)) {
throw new m(new UnknownServiceException(w.l("CLEARTEXT communication to ", str, " not permitted by network security policy")));
}
} else if (aVar.f8722j.contains(j0.H2_PRIOR_KNOWLEDGE)) {
throw new m(new UnknownServiceException("H2_PRIOR_KNOWLEDGE cannot be used with HTTPS"));
}
m mVar = null;
do {
try {
s0 s0Var2 = this.f10137b;
if (s0Var2.f8929a.f8715c != null && s0Var2.f8930b.type() == Proxy.Type.HTTP) {
f(i10, i11, i12, iVar, eVar);
if (this.f10138c == null) {
s0Var = this.f10137b;
if (!(s0Var.f8929a.f8715c == null && s0Var.f8930b.type() == Proxy.Type.HTTP) && this.f10138c == null) {
throw new m(new ProtocolException("Too many tunnel connections attempted: 21"));
}
this.f10152q = System.nanoTime();
return;
}
} else {
try {
e(i10, i11, iVar, eVar);
} catch (IOException e10) {
e = e10;
Socket socket = this.f10139d;
if (socket != null) {
sa.b.d(socket);
}
Socket socket2 = this.f10138c;
if (socket2 != null) {
sa.b.d(socket2);
}
this.f10139d = null;
this.f10138c = null;
this.f10143h = null;
this.f10144i = null;
this.f10140e = null;
this.f10141f = null;
this.f10142g = null;
this.f10150o = 1;
s0 s0Var3 = this.f10137b;
InetSocketAddress inetSocketAddress = s0Var3.f8931c;
Proxy proxy = s0Var3.f8930b;
s9.a.n(inetSocketAddress, "inetSocketAddress");
s9.a.n(proxy, "proxy");
if (mVar == null) {
mVar = new m(e);
} else {
s9.a.a(mVar.f10158i, e);
mVar.f10159q = e;
}
if (!z10) {
throw mVar;
}
r2Var.f2770c = true;
}
}
g(r2Var, iVar, eVar);
s0 s0Var4 = this.f10137b;
InetSocketAddress inetSocketAddress2 = s0Var4.f8931c;
Proxy proxy2 = s0Var4.f8930b;
s9.a.n(inetSocketAddress2, "inetSocketAddress");
s9.a.n(proxy2, "proxy");
s0Var = this.f10137b;
if (!(s0Var.f8929a.f8715c == null && s0Var.f8930b.type() == Proxy.Type.HTTP)) {
}
this.f10152q = System.nanoTime();
return;
} catch (IOException e11) {
e = e11;
}
} while ((!r2Var.f2769b || (e instanceof ProtocolException) || (e instanceof InterruptedIOException) || ((e instanceof SSLHandshakeException) && (e.getCause() instanceof CertificateException)) || (e instanceof SSLPeerUnverifiedException) || !(e instanceof SSLException)) ? false : true);
throw mVar;
}
public final void e(int i10, int i11, i iVar, t6.e eVar) {
Socket createSocket;
s0 s0Var = this.f10137b;
Proxy proxy = s0Var.f8930b;
ra.a aVar = s0Var.f8929a;
Proxy.Type type = proxy.type();
int i12 = type == null ? -1 : j.f10136a[type.ordinal()];
if (i12 == 1 || i12 == 2) {
createSocket = aVar.f8714b.createSocket();
s9.a.k(createSocket);
} else {
createSocket = new Socket(proxy);
}
this.f10138c = createSocket;
InetSocketAddress inetSocketAddress = this.f10137b.f8931c;
eVar.getClass();
s9.a.n(iVar, "call");
s9.a.n(inetSocketAddress, "inetSocketAddress");
createSocket.setSoTimeout(i11);
try {
ab.l lVar = ab.l.f320a;
ab.l.f320a.e(createSocket, this.f10137b.f8931c, i10);
try {
this.f10143h = s9.a.g(s9.a.p0(createSocket));
this.f10144i = s9.a.f(s9.a.m0(createSocket));
} catch (NullPointerException e10) {
if (s9.a.c(e10.getMessage(), "throw with null exception")) {
throw new IOException(e10);
}
}
} catch (ConnectException e11) {
ConnectException connectException = new ConnectException(s9.a.r0(this.f10137b.f8931c, "Failed to connect to "));
connectException.initCause(e11);
throw connectException;
}
}
public final void f(int i10, int i11, int i12, i iVar, t6.e eVar) {
k0 k0Var = new k0();
s0 s0Var = this.f10137b;
b0 b0Var = s0Var.f8929a.f8721i;
s9.a.n(b0Var, "url");
k0Var.f8846a = b0Var;
k0Var.d(HttpMethods.CONNECT, null);
ra.a aVar = s0Var.f8929a;
k0Var.c("Host", sa.b.u(aVar.f8721i, true));
k0Var.c("Proxy-Connection", "Keep-Alive");
k0Var.c("User-Agent", "okhttp/4.11.0");
j6.b a10 = k0Var.a();
o0 o0Var = new o0();
o0Var.f8890a = a10;
o0Var.f8891b = j0.HTTP_1_1;
o0Var.f8892c = 407;
o0Var.f8893d = "Preemptive Authenticate";
o0Var.f8896g = sa.b.f9163c;
o0Var.f8900k = -1L;
o0Var.f8901l = -1L;
y yVar = o0Var.f8895f;
yVar.getClass();
p.e("Proxy-Authenticate");
p.f("OkHttp-Preemptive", "Proxy-Authenticate");
yVar.f("Proxy-Authenticate");
yVar.c("Proxy-Authenticate", "OkHttp-Preemptive");
o0Var.a();
((t6.e) aVar.f8718f).getClass();
b0 b0Var2 = (b0) a10.f6188b;
e(i10, i11, iVar, eVar);
String str = "CONNECT " + sa.b.u(b0Var2, true) + " HTTP/1.1";
r rVar = this.f10143h;
s9.a.k(rVar);
q qVar = this.f10144i;
s9.a.k(qVar);
xa.h hVar = new xa.h(null, this, rVar, qVar);
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
rVar.a().g(i11, timeUnit);
qVar.a().g(i12, timeUnit);
hVar.j((ra.z) a10.f6190d, str);
hVar.f();
o0 h5 = hVar.h(false);
s9.a.k(h5);
h5.f8890a = a10;
p0 a11 = h5.a();
long j10 = sa.b.j(a11);
if (j10 != -1) {
xa.e i13 = hVar.i(j10);
sa.b.s(i13, Integer.MAX_VALUE, timeUnit);
i13.close();
}
int i14 = a11.W;
if (i14 != 200) {
if (i14 != 407) {
throw new IOException(s9.a.r0(Integer.valueOf(i14), "Unexpected response code for CONNECT: "));
}
((t6.e) aVar.f8718f).getClass();
throw new IOException("Failed to authenticate with proxy");
}
if (!rVar.f4932q.S() || !qVar.f4930q.S()) {
throw new IOException("TLS tunnel buffered too many bytes!");
}
}
public final void g(r2 r2Var, i iVar, t6.e eVar) {
ra.a aVar = this.f10137b.f8929a;
SSLSocketFactory sSLSocketFactory = aVar.f8715c;
j0 j0Var = j0.HTTP_1_1;
if (sSLSocketFactory == null) {
List list = aVar.f8722j;
j0 j0Var2 = j0.H2_PRIOR_KNOWLEDGE;
if (!list.contains(j0Var2)) {
this.f10139d = this.f10138c;
this.f10141f = j0Var;
return;
} else {
this.f10139d = this.f10138c;
this.f10141f = j0Var2;
m();
return;
}
}
eVar.getClass();
s9.a.n(iVar, "call");
ra.a aVar2 = this.f10137b.f8929a;
SSLSocketFactory sSLSocketFactory2 = aVar2.f8715c;
SSLSocket sSLSocket = null;
String str = null;
try {
s9.a.k(sSLSocketFactory2);
Socket socket = this.f10138c;
b0 b0Var = aVar2.f8721i;
Socket createSocket = sSLSocketFactory2.createSocket(socket, b0Var.f8736d, b0Var.f8737e, true);
if (createSocket == null) {
throw new NullPointerException("null cannot be cast to non-null type javax.net.ssl.SSLSocket");
}
SSLSocket sSLSocket2 = (SSLSocket) createSocket;
try {
o a10 = r2Var.a(sSLSocket2);
if (a10.f8887b) {
ab.l lVar = ab.l.f320a;
ab.l.f320a.d(sSLSocket2, aVar2.f8721i.f8736d, aVar2.f8722j);
}
sSLSocket2.startHandshake();
SSLSession session = sSLSocket2.getSession();
s9.a.m(session, "sslSocketSession");
x h5 = ra.t.h(session);
HostnameVerifier hostnameVerifier = aVar2.f8716d;
s9.a.k(hostnameVerifier);
boolean verify = hostnameVerifier.verify(aVar2.f8721i.f8736d, session);
int i10 = 2;
if (verify) {
ra.l lVar2 = aVar2.f8717e;
s9.a.k(lVar2);
this.f10140e = new x(h5.f8942a, h5.f8943b, h5.f8944c, new u8.j(lVar2, h5, aVar2, i10));
s9.a.n(aVar2.f8721i.f8736d, "hostname");
Iterator it = lVar2.f8852a.iterator();
if (it.hasNext()) {
w.y(it.next());
throw null;
}
if (a10.f8887b) {
ab.l lVar3 = ab.l.f320a;
str = ab.l.f320a.f(sSLSocket2);
}
this.f10139d = sSLSocket2;
this.f10143h = s9.a.g(s9.a.p0(sSLSocket2));
this.f10144i = s9.a.f(s9.a.m0(sSLSocket2));
if (str != null) {
j0Var = ra.t.j(str);
}
this.f10141f = j0Var;
ab.l lVar4 = ab.l.f320a;
ab.l.f320a.a(sSLSocket2);
if (this.f10141f == j0.HTTP_2) {
m();
return;
}
return;
}
List a11 = h5.a();
if (!(!a11.isEmpty())) {
throw new SSLPeerUnverifiedException("Hostname " + aVar2.f8721i.f8736d + " not verified (no certificates)");
}
X509Certificate x509Certificate = (X509Certificate) a11.get(0);
StringBuilder sb = new StringBuilder("\n |Hostname ");
sb.append(aVar2.f8721i.f8736d);
sb.append(" not verified:\n | certificate: ");
ra.l lVar5 = ra.l.f8851c;
s9.a.n(x509Certificate, "certificate");
fb.i iVar2 = fb.i.W;
byte[] encoded = x509Certificate.getPublicKey().getEncoded();
s9.a.m(encoded, "publicKey.encoded");
sb.append(s9.a.r0(ra.t.p(encoded).b(MessageDigestAlgorithms.SHA_256).a(), "sha256/"));
sb.append("\n | DN: ");
sb.append((Object) x509Certificate.getSubjectDN().getName());
sb.append("\n | subjectAltNames: ");
sb.append(q9.m.O(db.c.a(x509Certificate, 7), db.c.a(x509Certificate, 2)));
sb.append("\n ");
throw new SSLPeerUnverifiedException(v5.a.p(sb.toString()));
} catch (Throwable th) {
th = th;
sSLSocket = sSLSocket2;
if (sSLSocket != null) {
ab.l lVar6 = ab.l.f320a;
ab.l.f320a.a(sSLSocket);
}
if (sSLSocket != null) {
sa.b.d(sSLSocket);
}
throw th;
}
} catch (Throwable th2) {
th = th2;
}
}
public final synchronized void h() {
this.f10148m++;
}
public final boolean i(ra.a r10, java.util.List r11) {
throw new UnsupportedOperationException("Method not decompiled: va.k.i(ra.a, java.util.List):boolean");
}
public final boolean j(boolean z10) {
long j10;
byte[] bArr = sa.b.f9161a;
long nanoTime = System.nanoTime();
Socket socket = this.f10138c;
s9.a.k(socket);
Socket socket2 = this.f10139d;
s9.a.k(socket2);
r rVar = this.f10143h;
s9.a.k(rVar);
if (socket.isClosed() || socket2.isClosed() || socket2.isInputShutdown() || socket2.isOutputShutdown()) {
return false;
}
t tVar = this.f10142g;
if (tVar != null) {
return tVar.f(nanoTime);
}
synchronized (this) {
j10 = nanoTime - this.f10152q;
}
if (j10 < 10000000000L || !z10) {
return true;
}
try {
int soTimeout = socket2.getSoTimeout();
try {
socket2.setSoTimeout(1);
boolean z11 = !rVar.S();
socket2.setSoTimeout(soTimeout);
return z11;
} catch (Throwable th) {
socket2.setSoTimeout(soTimeout);
throw th;
}
} catch (SocketTimeoutException unused) {
return true;
} catch (IOException unused2) {
return false;
}
}
public final wa.d k(i0 i0Var, wa.f fVar) {
Socket socket = this.f10139d;
s9.a.k(socket);
r rVar = this.f10143h;
s9.a.k(rVar);
q qVar = this.f10144i;
s9.a.k(qVar);
t tVar = this.f10142g;
if (tVar != null) {
return new u(i0Var, this, fVar, tVar);
}
int i10 = fVar.f10626g;
socket.setSoTimeout(i10);
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
rVar.a().g(i10, timeUnit);
qVar.a().g(fVar.f10627h, timeUnit);
return new xa.h(i0Var, this, rVar, qVar);
}
public final synchronized void l() {
this.f10145j = true;
}
public final void m() {
String r02;
Socket socket = this.f10139d;
s9.a.k(socket);
r rVar = this.f10143h;
s9.a.k(rVar);
q qVar = this.f10144i;
s9.a.k(qVar);
socket.setSoTimeout(0);
ua.f fVar = ua.f.f9875h;
ya.h hVar = new ya.h(fVar);
String str = this.f10137b.f8929a.f8721i.f8736d;
s9.a.n(str, "peerName");
hVar.f11011c = socket;
if (hVar.f11009a) {
r02 = sa.b.f9166f + XmlConsts.CHAR_SPACE + str;
} else {
r02 = s9.a.r0(str, "MockWebServer ");
}
s9.a.n(r02, "<set-?>");
hVar.f11012d = r02;
hVar.f11013e = rVar;
hVar.f11014f = qVar;
hVar.f11015g = this;
hVar.f11017i = 0;
t tVar = new t(hVar);
this.f10142g = tVar;
d0 d0Var = t.f11046v0;
this.f10150o = (d0Var.f10991a & 16) != 0 ? d0Var.f10992b[4] : Integer.MAX_VALUE;
a0 a0Var = tVar.f11067s0;
synchronized (a0Var) {
if (a0Var.Y) {
throw new IOException("closed");
}
if (a0Var.f10966q) {
Logger logger = a0.f10964a0;
if (logger.isLoggable(Level.FINE)) {
logger.fine(sa.b.h(s9.a.r0(ya.g.f11005a.d(), ">> CONNECTION "), new Object[0]));
}
a0Var.f10965i.q(ya.g.f11005a);
a0Var.f10965i.flush();
}
}
tVar.f11067s0.z(tVar.f11059l0);
if (tVar.f11059l0.a() != 65535) {
tVar.f11067s0.A(0, r1 - Variant.VT_ILLEGAL);
}
fVar.f().c(new ua.b(tVar.f11068t0, 0, tVar.W), 0L);
}
public final String toString() {
ra.m mVar;
StringBuilder sb = new StringBuilder("Connection{");
s0 s0Var = this.f10137b;
sb.append(s0Var.f8929a.f8721i.f8736d);
sb.append(':');
sb.append(s0Var.f8929a.f8721i.f8737e);
sb.append(", proxy=");
sb.append(s0Var.f8930b);
sb.append(" hostAddress=");
sb.append(s0Var.f8931c);
sb.append(" cipherSuite=");
x xVar = this.f10140e;
Object obj = "none";
if (xVar != null && (mVar = xVar.f8943b) != null) {
obj = mVar;
}
sb.append(obj);
sb.append(" protocol=");
sb.append(this.f10141f);
sb.append('}');
return sb.toString();
}
}