正在查看: Structured v2.5.8 应用的 j.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
正在查看: Structured v2.5.8 应用的 j.java JAVA 源代码文件
本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。
package I9;
import A.C0013l;
import A.C0026z;
import A0.Z;
import A9.M;
import E9.A;
import E9.C0317a;
import E9.p;
import E9.t;
import E9.u;
import E9.x;
import L9.n;
import L9.v;
import L9.w;
import L9.z;
import M9.o;
import S9.AbstractC0878b;
import S9.B;
import S9.C0884h;
import S9.I;
import S9.y;
import a.AbstractC1010a;
import a5.AbstractC1054A;
import java.io.IOException;
import java.io.InterruptedIOException;
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.CertificateException;
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashSet;
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 kotlin.jvm.internal.m;
import l7.AbstractC2205n;
public final class j extends L9.h {
public final A f5515b;
public Socket f5516c;
public Socket f5517d;
public E9.l f5518e;
public u f5519f;
public n f5520g;
public S9.A h;
public y f5521i;
public boolean f5522j;
public boolean f5523k;
public int f5524l;
public int f5525m;
public int f5526n;
public int f5527o;
public final ArrayList f5528p;
public long f5529q;
public j(k kVar, A a10) {
m.f("connectionPool", kVar);
m.f("route", a10);
this.f5515b = a10;
this.f5527o = 1;
this.f5528p = new ArrayList();
this.f5529q = Long.MAX_VALUE;
}
public static void d(t tVar, A a10, IOException iOException) {
m.f("client", tVar);
m.f("failedRoute", a10);
m.f("failure", iOException);
if (a10.f3323b.type() != Proxy.Type.DIRECT) {
C0317a c0317a = a10.f3322a;
c0317a.f3338g.connectFailed(c0317a.h.g(), a10.f3323b.address(), iOException);
}
C0026z c0026z = tVar.L;
synchronized (c0026z) {
try {
((LinkedHashSet) c0026z.f226m).add(a10);
} catch (Throwable th) {
throw th;
}
}
}
@Override
public final synchronized void a(n nVar, z zVar) {
try {
m.f("connection", nVar);
m.f("settings", zVar);
this.f5527o = (zVar.f7170a & 16) != 0 ? zVar.f7171b[4] : Integer.MAX_VALUE;
} catch (Throwable th) {
throw th;
}
}
@Override
public final void b(v vVar) {
vVar.c(8, null);
}
public final void c(int i6, int i10, int i11, boolean z10, h hVar, E9.k kVar) {
A a10;
m.f("call", hVar);
m.f("eventListener", kVar);
if (this.f5519f != null) {
throw new IllegalStateException("already connected");
}
List list = this.f5515b.f3322a.f3340j;
M m10 = new M(list);
C0317a c0317a = this.f5515b.f3322a;
if (c0317a.f3334c == null) {
if (!list.contains(E9.h.f3384f)) {
throw new l(new UnknownServiceException("CLEARTEXT communication not enabled for client"));
}
String str = this.f5515b.f3322a.h.f3420d;
o oVar = o.f7412a;
if (!o.f7412a.h(str)) {
throw new l(new UnknownServiceException(l2.v.j("CLEARTEXT communication to ", str, " not permitted by network security policy")));
}
} else if (c0317a.f3339i.contains(u.H2_PRIOR_KNOWLEDGE)) {
throw new l(new UnknownServiceException("H2_PRIOR_KNOWLEDGE cannot be used with HTTPS"));
}
l lVar = null;
do {
try {
A a11 = this.f5515b;
if (a11.f3322a.f3334c != null && a11.f3323b.type() == Proxy.Type.HTTP) {
f(i6, i10, i11, hVar, kVar);
if (this.f5516c == null) {
a10 = this.f5515b;
if (a10.f3322a.f3334c == null && a10.f3323b.type() == Proxy.Type.HTTP && this.f5516c == null) {
throw new l(new ProtocolException("Too many tunnel connections attempted: 21"));
}
this.f5529q = System.nanoTime();
return;
}
} else {
try {
e(i6, i10, hVar, kVar);
} catch (IOException e3) {
e = e3;
Socket socket = this.f5517d;
if (socket != null) {
F9.b.e(socket);
}
Socket socket2 = this.f5516c;
if (socket2 != null) {
F9.b.e(socket2);
}
this.f5517d = null;
this.f5516c = null;
this.h = null;
this.f5521i = null;
this.f5518e = null;
this.f5519f = null;
this.f5520g = null;
this.f5527o = 1;
A a12 = this.f5515b;
kVar.h(hVar, a12.f3324c, a12.f3323b, e);
if (lVar == null) {
lVar = new l(e);
} else {
AbstractC1054A.r(lVar.f5534m, e);
lVar.f5535n = e;
}
if (!z10) {
throw lVar;
}
m10.f693c = true;
if (!m10.f692b) {
throw lVar;
}
if (e instanceof ProtocolException) {
throw lVar;
}
if (e instanceof InterruptedIOException) {
throw lVar;
}
if ((e instanceof SSLHandshakeException) && (e.getCause() instanceof CertificateException)) {
throw lVar;
}
if (e instanceof SSLPeerUnverifiedException) {
throw lVar;
}
}
}
g(m10, hVar, kVar);
A a13 = this.f5515b;
kVar.g(hVar, a13.f3324c, a13.f3323b, this.f5519f);
a10 = this.f5515b;
if (a10.f3322a.f3334c == null) {
}
this.f5529q = System.nanoTime();
return;
} catch (IOException e9) {
e = e9;
}
} while (e instanceof SSLException);
throw lVar;
}
public final void e(int i6, int i10, h hVar, E9.k kVar) {
Socket createSocket;
A a10 = this.f5515b;
Proxy proxy = a10.f3323b;
C0317a c0317a = a10.f3322a;
Proxy.Type type = proxy.type();
int i11 = type == null ? -1 : i.f5514a[type.ordinal()];
if (i11 == 1 || i11 == 2) {
createSocket = c0317a.f3333b.createSocket();
m.c(createSocket);
} else {
createSocket = new Socket(proxy);
}
this.f5516c = createSocket;
kVar.i(hVar, this.f5515b.f3324c, proxy);
createSocket.setSoTimeout(i10);
try {
o oVar = o.f7412a;
o.f7412a.e(createSocket, this.f5515b.f3324c, i6);
try {
this.h = AbstractC0878b.c(AbstractC0878b.i(createSocket));
this.f5521i = AbstractC0878b.b(AbstractC0878b.g(createSocket));
} catch (NullPointerException e3) {
if (m.a(e3.getMessage(), "throw with null exception")) {
throw new IOException(e3);
}
}
} catch (ConnectException e9) {
ConnectException connectException = new ConnectException("Failed to connect to " + this.f5515b.f3324c);
connectException.initCause(e9);
throw connectException;
}
}
public final void f(int i6, int i10, int i11, h hVar, E9.k kVar) {
E9.v vVar = new E9.v(0);
A a10 = this.f5515b;
p pVar = a10.f3322a.h;
m.f("url", pVar);
vVar.f3487n = pVar;
vVar.H("CONNECT", null);
C0317a c0317a = a10.f3322a;
vVar.F("Host", F9.b.w(c0317a.h, true));
vVar.F("Proxy-Connection", "Keep-Alive");
vVar.F("User-Agent", "okhttp/4.12.0");
E4.f x7 = vVar.x();
E9.m mVar = new E9.m(0, false);
AbstractC1010a.q("Proxy-Authenticate");
AbstractC1010a.r("OkHttp-Preemptive", "Proxy-Authenticate");
mVar.s("Proxy-Authenticate");
mVar.c("Proxy-Authenticate", "OkHttp-Preemptive");
mVar.f();
c0317a.f3337f.getClass();
e(i6, i10, hVar, kVar);
String str = "CONNECT " + F9.b.w((p) x7.f3150b, true) + " HTTP/1.1";
S9.A a11 = this.h;
m.c(a11);
y yVar = this.f5521i;
m.c(yVar);
K9.h hVar2 = new K9.h(null, this, a11, yVar);
I k4 = a11.f12611m.k();
long j4 = i10;
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
k4.g(j4, timeUnit);
yVar.f12690m.k().g(i11, timeUnit);
hVar2.j((E9.n) x7.f3152d, str);
hVar2.a();
x f2 = hVar2.f(false);
m.c(f2);
f2.f3496a = x7;
E9.y a12 = f2.a();
long l10 = F9.b.l(a12);
if (l10 != -1) {
K9.e i12 = hVar2.i(l10);
F9.b.u(i12, Integer.MAX_VALUE, timeUnit);
i12.close();
}
int i13 = a12.f3511p;
if (i13 != 200) {
if (i13 != 407) {
throw new IOException(l2.v.h(i13, "Unexpected response code for CONNECT: "));
}
c0317a.f3337f.getClass();
throw new IOException("Failed to authenticate with proxy");
}
if (!a11.f12612n.F() || !yVar.f12691n.F()) {
throw new IOException("TLS tunnel buffered too many bytes!");
}
}
public final void g(M m10, h hVar, E9.k kVar) {
int i6 = 7;
C0317a c0317a = this.f5515b.f3322a;
SSLSocketFactory sSLSocketFactory = c0317a.f3334c;
u uVar = u.HTTP_1_1;
if (sSLSocketFactory == null) {
List list = c0317a.f3339i;
u uVar2 = u.H2_PRIOR_KNOWLEDGE;
if (!list.contains(uVar2)) {
this.f5517d = this.f5516c;
this.f5519f = uVar;
return;
} else {
this.f5517d = this.f5516c;
this.f5519f = uVar2;
l();
return;
}
}
kVar.B(hVar);
C0317a c0317a2 = this.f5515b.f3322a;
SSLSocketFactory sSLSocketFactory2 = c0317a2.f3334c;
SSLSocket sSLSocket = null;
String str = null;
try {
m.c(sSLSocketFactory2);
Socket socket = this.f5516c;
p pVar = c0317a2.h;
Socket createSocket = sSLSocketFactory2.createSocket(socket, pVar.f3420d, pVar.f3421e, true);
m.d("null cannot be cast to non-null type javax.net.ssl.SSLSocket", createSocket);
SSLSocket sSLSocket2 = (SSLSocket) createSocket;
try {
E9.h b10 = m10.b(sSLSocket2);
if (b10.f3386b) {
o oVar = o.f7412a;
o.f7412a.d(sSLSocket2, c0317a2.h.f3420d, c0317a2.f3339i);
}
sSLSocket2.startHandshake();
SSLSession session = sSLSocket2.getSession();
m.e("sslSocketSession", session);
E9.l x7 = M9.m.x(session);
HostnameVerifier hostnameVerifier = c0317a2.f3335d;
m.c(hostnameVerifier);
if (hostnameVerifier.verify(c0317a2.h.f3420d, session)) {
E9.d dVar = c0317a2.f3336e;
m.c(dVar);
this.f5518e = new E9.l(x7.f3402a, x7.f3403b, x7.f3404c, new C0013l(dVar, x7, c0317a2, i6));
dVar.a(c0317a2.h.f3420d, new Z(21, this));
if (b10.f3386b) {
o oVar2 = o.f7412a;
str = o.f7412a.f(sSLSocket2);
}
this.f5517d = sSLSocket2;
this.h = AbstractC0878b.c(AbstractC0878b.i(sSLSocket2));
this.f5521i = AbstractC0878b.b(AbstractC0878b.g(sSLSocket2));
if (str != null) {
uVar = io.sentry.config.a.s(str);
}
this.f5519f = uVar;
o oVar3 = o.f7412a;
o.f7412a.a(sSLSocket2);
kVar.A(hVar, this.f5518e);
if (this.f5519f == u.HTTP_2) {
l();
return;
}
return;
}
List a10 = x7.a();
if (a10.isEmpty()) {
throw new SSLPeerUnverifiedException("Hostname " + c0317a2.h.f3420d + " not verified (no certificates)");
}
Object obj = a10.get(0);
m.d("null cannot be cast to non-null type java.security.cert.X509Certificate", obj);
X509Certificate x509Certificate = (X509Certificate) obj;
StringBuilder sb = new StringBuilder("\n |Hostname ");
sb.append(c0317a2.h.f3420d);
sb.append(" not verified:\n | certificate: ");
E9.d dVar2 = E9.d.f3357c;
StringBuilder sb2 = new StringBuilder("sha256/");
S9.k kVar2 = S9.k.f12652p;
byte[] encoded = x509Certificate.getPublicKey().getEncoded();
m.e("publicKey.encoded", encoded);
sb2.append(O3.e.m(encoded, 0, -1234567890).c("SHA-256").a());
sb.append(sb2.toString());
sb.append("\n | DN: ");
sb.append(x509Certificate.getSubjectDN().getName());
sb.append("\n | subjectAltNames: ");
sb.append(AbstractC2205n.h1(Q9.c.a(x509Certificate, 7), Q9.c.a(x509Certificate, 2)));
sb.append("\n ");
throw new SSLPeerUnverifiedException(P8.o.j0(sb.toString()));
} catch (Throwable th) {
th = th;
sSLSocket = sSLSocket2;
if (sSLSocket != null) {
o oVar4 = o.f7412a;
o.f7412a.a(sSLSocket);
}
if (sSLSocket != null) {
F9.b.e(sSLSocket);
}
throw th;
}
} catch (Throwable th2) {
th = th2;
}
}
public final boolean h(C0317a c0317a, ArrayList arrayList) {
E9.l lVar;
byte[] bArr = F9.b.f4025a;
if (this.f5528p.size() < this.f5527o) {
if (!this.f5522j) {
A a10 = this.f5515b;
if (!a10.f3322a.a(c0317a)) {
return false;
}
p pVar = c0317a.h;
String str = pVar.f3420d;
C0317a c0317a2 = a10.f3322a;
if (m.a(str, c0317a2.h.f3420d)) {
return true;
}
if (this.f5520g == null) {
return false;
}
if (arrayList != null) {
if (!arrayList.isEmpty()) {
Iterator it = arrayList.iterator();
while (true) {
if (!it.hasNext()) {
break;
}
A a11 = (A) it.next();
Proxy.Type type = a11.f3323b.type();
Proxy.Type type2 = Proxy.Type.DIRECT;
if (type == type2 && a10.f3323b.type() == type2) {
if (m.a(a10.f3324c, a11.f3324c)) {
if (c0317a.f3335d != Q9.c.f11015a) {
return false;
}
byte[] bArr2 = F9.b.f4025a;
p pVar2 = c0317a2.h;
if (pVar.f3421e == pVar2.f3421e) {
String str2 = pVar2.f3420d;
String str3 = pVar.f3420d;
if (!m.a(str3, str2)) {
if (!this.f5523k && (lVar = this.f5518e) != null) {
List a12 = lVar.a();
if (!a12.isEmpty()) {
Object obj = a12.get(0);
m.d("null cannot be cast to non-null type java.security.cert.X509Certificate", obj);
if (Q9.c.c(str3, (X509Certificate) obj)) {
}
}
}
}
try {
E9.d dVar = c0317a.f3336e;
m.c(dVar);
E9.l lVar2 = this.f5518e;
m.c(lVar2);
List a13 = lVar2.a();
m.f("hostname", str3);
m.f("peerCertificates", a13);
dVar.a(str3, new C0013l(dVar, a13, str3, 6));
return true;
} catch (SSLPeerUnverifiedException unused) {
}
}
}
}
}
}
}
}
return false;
}
return false;
}
public final boolean i(boolean z10) {
long j4;
byte[] bArr = F9.b.f4025a;
long nanoTime = System.nanoTime();
Socket socket = this.f5516c;
m.c(socket);
Socket socket2 = this.f5517d;
m.c(socket2);
S9.A a10 = this.h;
m.c(a10);
if (!socket.isClosed() && !socket2.isClosed() && !socket2.isInputShutdown()) {
if (!socket2.isOutputShutdown()) {
n nVar = this.f5520g;
if (nVar != null) {
synchronized (nVar) {
try {
if (nVar.f7110r) {
return false;
}
if (nVar.f7118z < nVar.f7117y) {
if (nanoTime >= nVar.f7096A) {
return false;
}
}
return true;
} finally {
}
}
}
synchronized (this) {
try {
j4 = nanoTime - this.f5529q;
} catch (Throwable th) {
throw th;
}
}
if (j4 >= 10000000000L) {
if (z10) {
try {
int soTimeout = socket2.getSoTimeout();
try {
socket2.setSoTimeout(1);
boolean z11 = !a10.F();
socket2.setSoTimeout(soTimeout);
return z11;
} catch (Throwable th2) {
socket2.setSoTimeout(soTimeout);
throw th2;
}
} catch (SocketTimeoutException unused) {
return true;
} catch (IOException unused2) {
return false;
}
}
}
return true;
}
}
return false;
}
public final J9.d j(t tVar, J9.f fVar) {
m.f("client", tVar);
Socket socket = this.f5517d;
m.c(socket);
S9.A a10 = this.h;
m.c(a10);
y yVar = this.f5521i;
m.c(yVar);
n nVar = this.f5520g;
if (nVar != null) {
return new L9.o(tVar, this, fVar, nVar);
}
int i6 = fVar.f6088d;
socket.setSoTimeout(i6);
TimeUnit timeUnit = TimeUnit.MILLISECONDS;
a10.f12611m.k().g(i6, timeUnit);
yVar.f12690m.k().g(fVar.f6089e, timeUnit);
return new K9.h(tVar, this, a10, yVar);
}
public final synchronized void k() {
try {
this.f5522j = true;
} catch (Throwable th) {
throw th;
}
}
public final void l() {
Socket socket = this.f5517d;
m.c(socket);
S9.A a10 = this.h;
m.c(a10);
y yVar = this.f5521i;
m.c(yVar);
socket.setSoTimeout(0);
H9.d dVar = H9.d.h;
E4.f fVar = new E4.f(dVar);
String str = this.f5515b.f3322a.h.f3420d;
m.f("peerName", str);
fVar.f3151c = socket;
String str2 = F9.b.f4030f + ' ' + str;
m.f("<set-?>", str2);
fVar.f3152d = str2;
fVar.f3153e = a10;
fVar.f3154f = yVar;
fVar.f3155g = this;
n nVar = new n(fVar);
this.f5520g = nVar;
z zVar = n.L;
int i6 = 4;
this.f5527o = (zVar.f7170a & 16) != 0 ? zVar.f7171b[4] : Integer.MAX_VALUE;
w wVar = nVar.f7104I;
synchronized (wVar) {
try {
if (wVar.f7164p) {
throw new IOException("closed");
}
Logger logger = w.f7160r;
if (logger.isLoggable(Level.FINE)) {
logger.fine(F9.b.j(">> CONNECTION " + L9.f.f7076a.e(), new Object[0]));
}
y yVar2 = wVar.f7161m;
S9.k kVar = L9.f.f7076a;
yVar2.getClass();
m.f("byteString", kVar);
if (yVar2.f12692o) {
throw new IllegalStateException("closed");
}
yVar2.f12691n.g0(kVar);
yVar2.a();
wVar.f7161m.flush();
} finally {
}
}
w wVar2 = nVar.f7104I;
z zVar2 = nVar.f7097B;
synchronized (wVar2) {
try {
m.f("settings", zVar2);
if (wVar2.f7164p) {
throw new IOException("closed");
}
wVar2.h(0, Integer.bitCount(zVar2.f7170a) * 6, 4, 0);
int i10 = 0;
while (i10 < 10) {
boolean z10 = true;
if (((1 << i10) & zVar2.f7170a) == 0) {
z10 = false;
}
if (z10) {
int i11 = i10 != i6 ? i10 != 7 ? i10 : i6 : 3;
y yVar3 = wVar2.f7161m;
if (yVar3.f12692o) {
throw new IllegalStateException("closed");
}
C0884h c0884h = yVar3.f12691n;
B d02 = c0884h.d0(2);
int i12 = d02.f12616c;
byte[] bArr = d02.f12614a;
bArr[i12] = (byte) ((i11 >>> 8) & 255);
bArr[i12 + 1] = (byte) (i11 & 255);
d02.f12616c = i12 + 2;
c0884h.f12651n += 2;
yVar3.a();
wVar2.f7161m.h(zVar2.f7171b[i10]);
}
i10++;
i6 = 4;
}
wVar2.f7161m.flush();
} finally {
}
}
if (nVar.f7097B.a() != 65535) {
nVar.f7104I.t(r2 - 65535, 0);
}
dVar.e().c(new H9.b(0, nVar.J, nVar.f7107o), 0L);
}
public final String toString() {
Object obj;
StringBuilder sb = new StringBuilder("Connection{");
A a10 = this.f5515b;
sb.append(a10.f3322a.h.f3420d);
sb.append(':');
sb.append(a10.f3322a.h.f3421e);
sb.append(", proxy=");
sb.append(a10.f3323b);
sb.append(" hostAddress=");
sb.append(a10.f3324c);
sb.append(" cipherSuite=");
E9.l lVar = this.f5518e;
if (lVar != null) {
obj = lVar.f3403b;
if (obj == null) {
}
sb.append(obj);
sb.append(" protocol=");
sb.append(this.f5519f);
sb.append('}');
return sb.toString();
}
obj = "none";
sb.append(obj);
sb.append(" protocol=");
sb.append(this.f5519f);
sb.append('}');
return sb.toString();
}
}