package okhttp3.repackaged.internal.http; import android.os.Process; import android.text.TextUtils; import android.view.View; import android.view.ViewConfiguration; import com.google.android.gms.maps.model.BitmapDescriptorFactory; import com.google.common.base.Ascii; import com.google.common.net.HttpHeaders; import java.io.IOException; import java.net.ProtocolException; import java.net.Proxy; import java.util.List; import javax.net.ssl.HostnameVerifier; import javax.net.ssl.SSLSocketFactory; import o.C15143giT; import o.C15145giV; import o.InterfaceC15142giR; import o.giM; import o.giO; import o.giX; import okhttp3.repackaged.Address; import okhttp3.repackaged.CertificatePinner; import okhttp3.repackaged.Connection; import okhttp3.repackaged.Cookie; import okhttp3.repackaged.CookieJar; import okhttp3.repackaged.Headers; import okhttp3.repackaged.HttpUrl; import okhttp3.repackaged.Interceptor; import okhttp3.repackaged.MediaType; import okhttp3.repackaged.OkHttpClient; import okhttp3.repackaged.Protocol; import okhttp3.repackaged.Request; import okhttp3.repackaged.Response; import okhttp3.repackaged.ResponseBody; import okhttp3.repackaged.Route; import okhttp3.repackaged.internal.Internal; import okhttp3.repackaged.internal.InternalCache; import okhttp3.repackaged.internal.Util; import okhttp3.repackaged.internal.Version; import okhttp3.repackaged.internal.http.CacheStrategy; import okhttp3.repackaged.internal.io.RealConnection; /* loaded from: classes6.dex */ public final class HttpEngine { public static final int MAX_FOLLOW_UPS = 20; private static int a; private static final ResponseBody ame; private static int b; private static byte[] c; private static short[] d; private static int e; private static int g; private final Response aiH; long alw = -1; private HttpStream amf; private boolean amg; private final Request amh; private Response ami; private giX amj; private giO amk; private final boolean aml; private CacheRequest amm; private CacheStrategy amn; public final boolean bufferRequestBody; private Response cacheResponse; final OkHttpClient client; private final boolean forWebSocket; private Request networkRequest; public final StreamAllocation streamAllocation; private static final byte[] $$a = {67, 119, -105, 2}; private static final int $$b = 129; private static int $10 = 0; private static int $11 = 1; private static int f = 0; /* JADX WARN: Removed duplicated region for block: B:10:0x0027 */ /* JADX WARN: Removed duplicated region for block: B:7:0x001f */ /* JADX WARN: Unsupported multi-entry loop pattern (BACK_EDGE: B:10:0x0027 -> B:4:0x002d). Please report as a decompilation issue!!! */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void k(byte r6, byte r7, int r8, java.lang.Object[] r9) { /* int r7 = r7 * 3 int r0 = r7 + 1 int r8 = r8 * 2 int r8 = r8 + 108 byte[] r1 = okhttp3.repackaged.internal.http.HttpEngine.$$a int r6 = r6 * 4 int r6 = 4 - r6 byte[] r0 = new byte[r0] r2 = 0 if (r1 != 0) goto L17 r8 = r6 r3 = r7 r4 = r2 goto L2d L17: r3 = r2 L18: byte r4 = (byte) r8 r0[r3] = r4 int r4 = r3 + 1 if (r3 != r7) goto L27 java.lang.String r6 = new java.lang.String r6.(r0, r2) r9[r2] = r6 return L27: r3 = r1[r6] r5 = r8 r8 = r6 r6 = r3 r3 = r5 L2d: int r6 = -r6 int r6 = r6 + r3 int r8 = r8 + 1 r3 = r4 r5 = r8 r8 = r6 r6 = r5 goto L18 */ throw new UnsupportedOperationException("Method not decompiled: okhttp3.repackaged.internal.http.HttpEngine.k(byte, byte, int, java.lang.Object[]):void"); } static /* synthetic */ Request a(HttpEngine httpEngine, Request request) { int i = 2 % 2; int i2 = f + 71; g = i2 % 128; int i3 = i2 % 2; httpEngine.networkRequest = request; if (i3 == 0) { int i4 = 49 / 0; } return request; } static /* synthetic */ HttpStream a(HttpEngine httpEngine) { int i = 2 % 2; int i2 = f; int i3 = i2 + 93; g = i3 % 128; int i4 = i3 % 2; HttpStream httpStream = httpEngine.amf; int i5 = i2 + 109; g = i5 % 128; if (i5 % 2 != 0) { return httpStream; } throw null; } static /* synthetic */ Response b(HttpEngine httpEngine) throws IOException { int i = 2 % 2; int i2 = f + 33; g = i2 % 128; int i3 = i2 % 2; Response vb = httpEngine.vb(); int i4 = f + 23; g = i4 % 128; if (i4 % 2 != 0) { return vb; } Object obj = null; obj.hashCode(); throw null; } static { g = 1; a(); ame = new ResponseBody() { // from class: okhttp3.repackaged.internal.http.HttpEngine.1 @Override // okhttp3.repackaged.ResponseBody public final long contentLength() { return 0L; } @Override // okhttp3.repackaged.ResponseBody public final MediaType contentType() { return null; } @Override // okhttp3.repackaged.ResponseBody public final InterfaceC15142giR source() { return new giM(); } }; int i = f + 39; g = i % 128; if (i % 2 == 0) { throw null; } } public HttpEngine(OkHttpClient okHttpClient, Request request, boolean z, boolean z2, boolean z3, StreamAllocation streamAllocation, RetryableSink retryableSink, Response response) { this.client = okHttpClient; this.amh = request; this.bufferRequestBody = z; this.aml = z2; this.forWebSocket = z3; if (streamAllocation == null) { streamAllocation = new StreamAllocation(okHttpClient.connectionPool(), a(okHttpClient, request)); int i = f + 115; g = i % 128; if (i % 2 != 0) { int i2 = 2 % 2; } } this.streamAllocation = streamAllocation; this.amj = retryableSink; this.aiH = response; int i3 = g + 117; f = i3 % 128; if (i3 % 2 == 0) { return; } Object obj = null; obj.hashCode(); throw null; } public final void sendRequest() throws RequestException, RouteException, IOException { int i = 2 % 2; int i2 = g; int i3 = i2 + 73; f = i3 % 128; int i4 = i3 % 2; if (this.amn != null) { int i5 = i2 + 67; f = i5 % 128; int i6 = i5 % 2; return; } if (this.amf != null) { throw new IllegalStateException(); } Request i7 = i(this.amh); InternalCache internalCache = Internal.instance.internalCache(this.client); Response response = internalCache != null ? internalCache.get(i7) : null; CacheStrategy cacheStrategy = new CacheStrategy.Factory(System.currentTimeMillis(), i7, response).get(); this.amn = cacheStrategy; this.networkRequest = cacheStrategy.networkRequest; this.cacheResponse = this.amn.cacheResponse; if (internalCache != null) { internalCache.trackResponse(this.amn); } if (response != null && this.cacheResponse == null) { int i8 = f + 63; g = i8 % 128; int i9 = i8 % 2; Util.closeQuietly(response.body()); } Request request = this.networkRequest; if (request == null) { int i10 = f + 109; g = i10 % 128; if (i10 % 2 == 0) { throw null; } if (this.cacheResponse == null) { this.ami = new Response.Builder().request(this.amh).priorResponse(m(this.aiH)).protocol(Protocol.HTTP_1_1).code(504).message("Unsatisfiable Request (only-if-cached)").body(ame).build(); return; } } if (request == null) { Response build = this.cacheResponse.newBuilder().request(this.amh).priorResponse(m(this.aiH)).cacheResponse(m(this.cacheResponse)).build(); this.ami = build; this.ami = n(build); int i11 = f + 55; g = i11 % 128; int i12 = i11 % 2; return; } try { HttpStream uZ = uZ(); this.amf = uZ; uZ.setHttpEngine(this); if (uY()) { long contentLength = OkHeaders.contentLength(i7); if (!this.bufferRequestBody) { this.amf.writeRequestHeaders(this.networkRequest); this.amj = this.amf.createRequestBody(this.networkRequest, contentLength); return; } if (contentLength > 2147483647L) { throw new IllegalStateException("Use setFixedLengthStreamingMode() or setChunkedStreamingMode() for requests larger than 2 GiB."); } int i13 = g + 47; f = i13 % 128; int i14 = i13 % 2; if (contentLength != -1) { this.amf.writeRequestHeaders(this.networkRequest); this.amj = new RetryableSink((int) contentLength); return; } this.amj = new RetryableSink(); int i15 = f + 61; g = i15 % 128; if (i15 % 2 == 0) { int i16 = 45 / 0; } } } catch (Throwable th) { if (response != null) { Util.closeQuietly(response.body()); } throw th; } } /* JADX WARN: Code restructure failed: missing block: B:63:0x0279, code lost: if (r0 != false) goto L65; */ /* JADX WARN: Code restructure failed: missing block: B:64:0x02a2, code lost: r4 = okhttp3.repackaged.internal.http.HttpEngine.d; r1.c = r1.c - 1; r1.a = (char) (r1.e + (((short) (((short) (r4[r8] ^ (-7303220121662775787L))) + r18)) ^ r19)); */ /* JADX WARN: Code restructure failed: missing block: B:67:0x027e, code lost: r4 = okhttp3.repackaged.internal.http.HttpEngine.c; r1.c = r1.c - 1; r1.a = (char) (r1.e + (((byte) (((byte) (r4[r8] ^ (-7303220121662775787L))) + r18)) ^ r19)); */ /* JADX WARN: Code restructure failed: missing block: B:69:0x027c, code lost: if (r0 != false) goto L65; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static void j(short r18, byte r19, int r20, int r21, int r22, java.lang.Object[] r23) { /* Method dump skipped, instructions count: 735 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: okhttp3.repackaged.internal.http.HttpEngine.j(short, byte, int, int, int, java.lang.Object[]):void"); } private boolean uY() { int i = 2 % 2; if (!(!this.aml)) { int i2 = g + 29; f = i2 % 128; int i3 = i2 % 2; if (h(this.networkRequest)) { int i4 = f + 95; g = i4 % 128; int i5 = i4 % 2; if (this.amj == null) { return true; } } } return false; } private HttpStream uZ() throws RouteException, RequestException, IOException { int i = 2 % 2; int i2 = f + 51; g = i2 % 128; int i3 = i2 % 2; HttpStream newStream = this.streamAllocation.newStream(this.client.connectTimeoutMillis(), this.client.readTimeoutMillis(), this.client.writeTimeoutMillis(), this.client.retryOnConnectionFailure(), !this.networkRequest.method().equals("GET")); int i4 = f + 1; g = i4 % 128; int i5 = i4 % 2; return newStream; } private static Response m(Response response) { int i = 2 % 2; if (response != null && response.body() != null) { int i2 = g + 3; f = i2 % 128; int i3 = i2 % 2; Response.Builder body = response.newBuilder().body(null); if (i3 != 0) { body.build(); throw null; } response = body.build(); } int i4 = g + 97; f = i4 % 128; if (i4 % 2 != 0) { int i5 = 32 / 0; } return response; } /* JADX WARN: Code restructure failed: missing block: B:10:0x002a, code lost: r7.alw = java.lang.System.currentTimeMillis(); r0 = 4 / 0; */ /* JADX WARN: Code restructure failed: missing block: B:11:?, code lost: return; */ /* JADX WARN: Code restructure failed: missing block: B:12:0x0034, code lost: r7.alw = java.lang.System.currentTimeMillis(); */ /* JADX WARN: Code restructure failed: missing block: B:13:0x003a, code lost: return; */ /* JADX WARN: Code restructure failed: missing block: B:15:0x001f, code lost: if (r7.alw == (-1)) goto L9; */ /* JADX WARN: Code restructure failed: missing block: B:4:0x0018, code lost: if (r7.alw == (-1)) goto L9; */ /* JADX WARN: Code restructure failed: missing block: B:6:0x0040, code lost: throw new java.lang.IllegalStateException(); */ /* JADX WARN: Code restructure failed: missing block: B:8:0x0021, code lost: r1 = r1 + 99; okhttp3.repackaged.internal.http.HttpEngine.g = r1 % 128; */ /* JADX WARN: Code restructure failed: missing block: B:9:0x0028, code lost: if ((r1 % 2) != 0) goto L12; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void writingRequestHeaders() { /* r7 = this; r0 = 2 int r1 = r0 % r0 int r1 = okhttp3.repackaged.internal.http.HttpEngine.f int r2 = r1 + 73 int r3 = r2 % 128 okhttp3.repackaged.internal.http.HttpEngine.g = r3 int r2 = r2 % r0 r3 = -1 if (r2 != 0) goto L1b long r5 = r7.alw int r2 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1)) r3 = 75 int r3 = r3 / 0 if (r2 != 0) goto L3b goto L21 L1b: long r5 = r7.alw int r2 = (r5 > r3 ? 1 : (r5 == r3 ? 0 : -1)) if (r2 != 0) goto L3b L21: int r1 = r1 + 99 int r2 = r1 % 128 okhttp3.repackaged.internal.http.HttpEngine.g = r2 int r1 = r1 % r0 if (r1 != 0) goto L34 long r0 = java.lang.System.currentTimeMillis() r7.alw = r0 r0 = 4 int r0 = r0 / 0 goto L3a L34: long r0 = java.lang.System.currentTimeMillis() r7.alw = r0 L3a: return L3b: java.lang.IllegalStateException r0 = new java.lang.IllegalStateException r0.() throw r0 */ throw new UnsupportedOperationException("Method not decompiled: okhttp3.repackaged.internal.http.HttpEngine.writingRequestHeaders():void"); } /* JADX INFO: Access modifiers changed from: package-private */ public final boolean h(Request request) { int i = 2 % 2; int i2 = f + 47; g = i2 % 128; int i3 = i2 % 2; boolean permitsRequestBody = HttpMethod.permitsRequestBody(request.method()); int i4 = g + 93; f = i4 % 128; if (i4 % 2 == 0) { return permitsRequestBody; } Object obj = null; obj.hashCode(); throw null; } public final giX getRequestBody() { int i = 2 % 2; if (this.amn == null) { throw new IllegalStateException(); } int i2 = f + 31; int i3 = i2 % 128; g = i3; int i4 = i2 % 2; giX gix = this.amj; int i5 = i3 + 39; f = i5 % 128; if (i5 % 2 == 0) { return gix; } Object obj = null; obj.hashCode(); throw null; } public final giO getBufferedRequestBody() { int i = 2 % 2; int i2 = g + 101; int i3 = i2 % 128; f = i3; int i4 = i2 % 2; giO gio = this.amk; if (gio == null) { giX requestBody = getRequestBody(); if (requestBody == null) { return null; } int i5 = f + 41; g = i5 % 128; int i6 = i5 % 2; giO e2 = C15145giV.e(requestBody); this.amk = e2; if (i6 != 0) { return e2; } int i7 = 32 / 0; return e2; } int i8 = i3 + 3; g = i8 % 128; int i9 = i8 % 2; return gio; } public final Response getResponse() { int i = 2 % 2; Response response = this.ami; if (response == null) { throw new IllegalStateException(); } int i2 = g + 39; int i3 = i2 % 128; f = i3; int i4 = i2 % 2; int i5 = i3 + 21; g = i5 % 128; int i6 = i5 % 2; return response; } public final Connection getConnection() { int i = 2 % 2; int i2 = g + 45; f = i2 % 128; int i3 = i2 % 2; RealConnection connection = this.streamAllocation.connection(); int i4 = f + 9; g = i4 % 128; int i5 = i4 % 2; return connection; } public final HttpEngine recover(IOException iOException, giX gix) { int i = 2 % 2; if (!this.streamAllocation.recover(iOException, gix)) { return null; } if (this.client.retryOnConnectionFailure()) { return new HttpEngine(this.client, this.amh, this.bufferRequestBody, this.aml, this.forWebSocket, close(), (RetryableSink) gix, this.aiH); } int i2 = f; int i3 = i2 + 51; g = i3 % 128; int i4 = i3 % 2; int i5 = i2 + 33; g = i5 % 128; int i6 = i5 % 2; return null; } public final HttpEngine recover(IOException iOException) { int i = 2 % 2; int i2 = g + 25; f = i2 % 128; int i3 = i2 % 2; HttpEngine recover = recover(iOException, this.amj); int i4 = g + 13; f = i4 % 128; if (i4 % 2 == 0) { return recover; } throw null; } private void va() throws IOException { int i = 2 % 2; int i2 = g + 3; f = i2 % 128; int i3 = i2 % 2; InternalCache internalCache = Internal.instance.internalCache(this.client); if (internalCache == null) { return; } if (!(!CacheStrategy.isCacheable(this.ami, this.networkRequest))) { this.amm = internalCache.put(m(this.ami)); return; } int i4 = g + 51; f = i4 % 128; int i5 = i4 % 2; if (HttpMethod.invalidatesCache(this.networkRequest.method())) { int i6 = f + 7; g = i6 % 128; int i7 = i6 % 2; try { internalCache.remove(this.networkRequest); int i8 = f + 25; g = i8 % 128; int i9 = i8 % 2; } catch (IOException unused) { return; } } int i10 = f + 117; g = i10 % 128; int i11 = i10 % 2; } public final void releaseStreamAllocation() throws IOException { int i = 2 % 2; int i2 = f + 27; g = i2 % 128; if (i2 % 2 == 0) { this.streamAllocation.release(); int i3 = 35 / 0; } else { this.streamAllocation.release(); } int i4 = f + 29; g = i4 % 128; int i5 = i4 % 2; } public final void cancel() { int i = 2 % 2; int i2 = f + 99; g = i2 % 128; int i3 = i2 % 2; this.streamAllocation.cancel(); int i4 = f + 23; g = i4 % 128; int i5 = i4 % 2; } public final StreamAllocation close() { int i = 2 % 2; int i2 = f + 87; g = i2 % 128; Object obj = null; if (i2 % 2 == 0) { obj.hashCode(); throw null; } giO gio = this.amk; if (gio != null) { Util.closeQuietly(gio); } else { giX gix = this.amj; if (gix != null) { Util.closeQuietly(gix); } } Response response = this.ami; if (response != null) { int i3 = g + 93; f = i3 % 128; if (i3 % 2 != 0) { Util.closeQuietly(response.body()); throw null; } Util.closeQuietly(response.body()); int i4 = g + 47; f = i4 % 128; if (i4 % 2 != 0) { int i5 = 5 / 5; } } else { this.streamAllocation.connectionFailed(null); } StreamAllocation streamAllocation = this.streamAllocation; int i6 = g + 77; f = i6 % 128; if (i6 % 2 != 0) { int i7 = 4 / 0; } return streamAllocation; } private Response n(Response response) throws IOException { int i = 2 % 2; if (this.amg && !(!"gzip".equalsIgnoreCase(this.ami.header(HttpHeaders.CONTENT_ENCODING)))) { if (response.body() != null) { C15143giT c15143giT = new C15143giT(response.body().source()); Headers build = response.headers().newBuilder().removeAll(HttpHeaders.CONTENT_ENCODING).removeAll(HttpHeaders.CONTENT_LENGTH).build(); response = response.newBuilder().headers(build).body(new RealResponseBody(build, C15145giV.a(c15143giT))).build(); } else { int i2 = f + 73; g = i2 % 128; int i3 = i2 % 2; return response; } } int i4 = g + 61; f = i4 % 128; int i5 = i4 % 2; return response; } public static boolean hasBody(Response response) { int i = 2 % 2; if (response.request().method().equals("HEAD")) { int i2 = g + 119; f = i2 % 128; int i3 = i2 % 2; return false; } int code = response.code(); if ((code < 100 || code >= 200) && code != 204 && code != 304) { int i4 = g + 79; f = i4 % 128; int i5 = i4 % 2; return true; } if (OkHeaders.contentLength(response) == -1 && (!"chunked".equalsIgnoreCase(response.header(HttpHeaders.TRANSFER_ENCODING)))) { int i6 = f + 81; g = i6 % 128; int i7 = i6 % 2; return false; } int i8 = f + 5; g = i8 % 128; if (i8 % 2 == 0) { int i9 = 41 / 0; } return true; } private Request i(Request request) throws IOException { int i = 2 % 2; int i2 = f + 3; g = i2 % 128; int i3 = i2 % 2; Request.Builder newBuilder = request.newBuilder(); if (request.header(HttpHeaders.HOST) == null) { int i4 = g + 119; f = i4 % 128; int i5 = i4 % 2; newBuilder.header(HttpHeaders.HOST, Util.hostHeader(request.url(), false)); } if (request.header(HttpHeaders.CONNECTION) == null) { newBuilder.header(HttpHeaders.CONNECTION, "Keep-Alive"); } if (request.header(HttpHeaders.ACCEPT_ENCODING) == null) { int i6 = f + 91; g = i6 % 128; if (i6 % 2 == 0) { this.amg = true; } else { this.amg = true; } newBuilder.header(HttpHeaders.ACCEPT_ENCODING, "gzip"); } List loadForRequest = this.client.cookieJar().loadForRequest(request.url()); if (!loadForRequest.isEmpty()) { newBuilder.header(HttpHeaders.COOKIE, y(loadForRequest)); int i7 = g + 61; f = i7 % 128; int i8 = i7 % 2; } if (request.header("User-Agent") == null) { newBuilder.header("User-Agent", Version.userAgent()); } return newBuilder.build(); } private String y(List list) { int i = 2 % 2; StringBuilder sb = new StringBuilder(); int size = list.size(); int i2 = g + 95; f = i2 % 128; int i3 = i2 % 2; int i4 = 0; while (true) { Object obj = null; if (i4 < size) { int i5 = f; int i6 = i5 + 45; g = i6 % 128; int i7 = i6 % 2; if (i4 > 0) { int i8 = i5 + 15; g = i8 % 128; if (i8 % 2 != 0) { sb.append("; "); } else { sb.append("; "); obj.hashCode(); throw null; } } Cookie cookie = list.get(i4); sb.append(cookie.name()); sb.append('='); sb.append(cookie.value()); i4++; } else { String obj2 = sb.toString(); int i9 = f + 13; g = i9 % 128; if (i9 % 2 != 0) { return obj2; } obj.hashCode(); throw null; } } } /* JADX WARN: Code restructure failed: missing block: B:54:0x00d0, code lost: if (r0 != null) goto L47; */ /* JADX WARN: Code restructure failed: missing block: B:55:0x00db, code lost: r1.close(); */ /* JADX WARN: Code restructure failed: missing block: B:59:0x00d7, code lost: r0.close(); */ /* JADX WARN: Code restructure failed: missing block: B:61:0x00d5, code lost: if (r0 != null) goto L47; */ /* JADX WARN: Removed duplicated region for block: B:19:0x00fa */ /* JADX WARN: Removed duplicated region for block: B:26:0x01a4 */ /* JADX WARN: Removed duplicated region for block: B:28:? A[RETURN, SYNTHETIC] */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ public final void readResponse() throws java.io.IOException { /* Method dump skipped, instructions count: 438 To view this dump add '--comments-level debug' option */ throw new UnsupportedOperationException("Method not decompiled: okhttp3.repackaged.internal.http.HttpEngine.readResponse():void"); } /* loaded from: classes6.dex */ class a implements Interceptor.Chain { private final Request aix; final HttpEngine amr; private int ams; private final int index; a(HttpEngine httpEngine, int i, Request request) { this.amr = httpEngine; this.index = i; this.aix = request; } @Override // okhttp3.repackaged.Interceptor.Chain public Connection connection() { return this.amr.streamAllocation.connection(); } @Override // okhttp3.repackaged.Interceptor.Chain public Response proceed(Request request) throws IOException { this.ams++; if (this.index > 0) { Interceptor interceptor = this.amr.client.networkInterceptors().get(this.index - 1); Address address = connection().route().address(); if (!request.url().host().equals(address.url().host()) || request.url().port() != address.url().port()) { StringBuilder sb = new StringBuilder("network interceptor "); sb.append(interceptor); sb.append(" must retain the same host and port"); throw new IllegalStateException(sb.toString()); } if (this.ams > 1) { StringBuilder sb2 = new StringBuilder("network interceptor "); sb2.append(interceptor); sb2.append(" must call proceed() exactly once"); throw new IllegalStateException(sb2.toString()); } } if (this.index < this.amr.client.networkInterceptors().size()) { a aVar = new a(this.amr, this.index + 1, request); Interceptor interceptor2 = this.amr.client.networkInterceptors().get(this.index); Response intercept = interceptor2.intercept(aVar); if (aVar.ams != 1) { StringBuilder sb3 = new StringBuilder("network interceptor "); sb3.append(interceptor2); sb3.append(" must call proceed() exactly once"); throw new IllegalStateException(sb3.toString()); } if (intercept != null) { return intercept; } StringBuilder sb4 = new StringBuilder("network interceptor "); sb4.append(interceptor2); sb4.append(" returned null"); throw new NullPointerException(sb4.toString()); } HttpEngine.a(this.amr).writeRequestHeaders(request); HttpEngine.a(this.amr, request); if (this.amr.h(request) && request.body() != null) { giO e = C15145giV.e(HttpEngine.a(this.amr).createRequestBody(request, request.body().contentLength())); request.body().writeTo(e); e.close(); } Response b = HttpEngine.b(this.amr); int code = b.code(); if ((code != 204 && code != 205) || b.body().contentLength() <= 0) { return b; } StringBuilder sb5 = new StringBuilder("HTTP "); sb5.append(code); sb5.append(" had non-zero Content-Length: "); sb5.append(b.body().contentLength()); throw new ProtocolException(sb5.toString()); } @Override // okhttp3.repackaged.Interceptor.Chain public Request request() { return this.aix; } } private Response vb() throws IOException { int i = 2 % 2; this.amf.finishRequest(); Response build = this.amf.readResponseHeaders().request(this.networkRequest).handshake(this.streamAllocation.connection().handshake()).header(OkHeaders.SENT_MILLIS, Long.toString(this.alw)).header(OkHeaders.RECEIVED_MILLIS, Long.toString(System.currentTimeMillis())).build(); if (!this.forWebSocket) { build = build.newBuilder().body(this.amf.openResponseBody(build)).build(); } if ("close".equalsIgnoreCase(build.request().header(HttpHeaders.CONNECTION)) || "close".equalsIgnoreCase(build.header(HttpHeaders.CONNECTION))) { this.streamAllocation.noNewStreams(); int i2 = g + 105; f = i2 % 128; int i3 = i2 % 2; } int i4 = f + 35; g = i4 % 128; if (i4 % 2 != 0) { return build; } Object obj = null; obj.hashCode(); throw null; } /* JADX WARN: Code restructure failed: missing block: B:11:0x0052, code lost: return r5.newBuilder().body(new okhttp3.repackaged.internal.http.RealResponseBody(r5.headers(), o.C15145giV.a(new okhttp3.repackaged.internal.http.HttpEngine.AnonymousClass2(r3, r5.body().source(), r4, o.C15145giV.e(r1))))).build(); */ /* JADX WARN: Code restructure failed: missing block: B:12:0x0017, code lost: return r5; */ /* JADX WARN: Code restructure failed: missing block: B:13:0x0015, code lost: if (r4 == null) goto L8; */ /* JADX WARN: Code restructure failed: missing block: B:4:0x0012, code lost: if (r4 == null) goto L8; */ /* JADX WARN: Code restructure failed: missing block: B:5:0x0018, code lost: r1 = r4.body(); */ /* JADX WARN: Code restructure failed: missing block: B:6:0x001c, code lost: if (r1 != null) goto L13; */ /* JADX WARN: Code restructure failed: missing block: B:7:0x001e, code lost: r4 = okhttp3.repackaged.internal.http.HttpEngine.g + 113; okhttp3.repackaged.internal.http.HttpEngine.f = r4 % 128; r4 = r4 % 2; */ /* JADX WARN: Code restructure failed: missing block: B:8:0x0027, code lost: return r5; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private okhttp3.repackaged.Response a(okhttp3.repackaged.internal.http.CacheRequest r4, okhttp3.repackaged.Response r5) throws java.io.IOException { /* r3 = this; r0 = 2 int r1 = r0 % r0 int r1 = okhttp3.repackaged.internal.http.HttpEngine.g int r1 = r1 + 17 int r2 = r1 % 128 okhttp3.repackaged.internal.http.HttpEngine.f = r2 int r1 = r1 % r0 if (r1 == 0) goto L15 r1 = 21 int r1 = r1 / 0 if (r4 != 0) goto L18 goto L17 L15: if (r4 != 0) goto L18 L17: return r5 L18: o.giX r1 = r4.body() if (r1 != 0) goto L28 int r4 = okhttp3.repackaged.internal.http.HttpEngine.g int r4 = r4 + 113 int r1 = r4 % 128 okhttp3.repackaged.internal.http.HttpEngine.f = r1 int r4 = r4 % r0 return r5 L28: okhttp3.repackaged.ResponseBody r0 = r5.body() o.giR r0 = r0.source() o.giO r1 = o.C15145giV.e(r1) okhttp3.repackaged.internal.http.HttpEngine$2 r2 = new okhttp3.repackaged.internal.http.HttpEngine$2 r2.(r3, r0, r4, r1) okhttp3.repackaged.Response$Builder r4 = r5.newBuilder() okhttp3.repackaged.internal.http.RealResponseBody r0 = new okhttp3.repackaged.internal.http.RealResponseBody okhttp3.repackaged.Headers r5 = r5.headers() o.giR r1 = o.C15145giV.a(r2) r0.(r5, r1) okhttp3.repackaged.Response$Builder r4 = r4.body(r0) okhttp3.repackaged.Response r4 = r4.build() return r4 */ throw new UnsupportedOperationException("Method not decompiled: okhttp3.repackaged.internal.http.HttpEngine.a(okhttp3.repackaged.internal.http.CacheRequest, okhttp3.repackaged.Response):okhttp3.repackaged.Response"); } /* JADX WARN: Code restructure failed: missing block: B:14:0x003c, code lost: if (r7 != null) goto L17; */ /* JADX WARN: Code restructure failed: missing block: B:16:0x0053, code lost: if (r7.getTime() >= r6.getTime()) goto L21; */ /* JADX WARN: Code restructure failed: missing block: B:17:0x0055, code lost: r6 = okhttp3.repackaged.internal.http.HttpEngine.g + 85; okhttp3.repackaged.internal.http.HttpEngine.f = r6 % 128; r6 = r6 % 2; */ /* JADX WARN: Code restructure failed: missing block: B:18:0x005e, code lost: return true; */ /* JADX WARN: Code restructure failed: missing block: B:20:0x0047, code lost: if (r7 != null) goto L17; */ /* Code decompiled incorrectly, please refer to instructions dump. To view partially-correct add '--show-bad-code' argument */ private static boolean a(okhttp3.repackaged.Response r6, okhttp3.repackaged.Response r7) { /* r0 = 2 int r1 = r0 % r0 int r1 = r7.code() r2 = 304(0x130, float:4.26E-43) r3 = 1 r4 = 0 if (r1 != r2) goto L1a int r6 = okhttp3.repackaged.internal.http.HttpEngine.g int r6 = r6 + 113 int r7 = r6 % 128 okhttp3.repackaged.internal.http.HttpEngine.f = r7 int r6 = r6 % r0 if (r6 == 0) goto L19 r3 = r4 L19: return r3 L1a: okhttp3.repackaged.Headers r6 = r6.headers() java.lang.String r1 = "Last-Modified" java.util.Date r6 = r6.getDate(r1) if (r6 == 0) goto L5f int r2 = okhttp3.repackaged.internal.http.HttpEngine.g int r2 = r2 + 73 int r5 = r2 % 128 okhttp3.repackaged.internal.http.HttpEngine.f = r5 int r2 = r2 % r0 if (r2 == 0) goto L3f okhttp3.repackaged.Headers r7 = r7.headers() java.util.Date r7 = r7.getDate(r1) r1 = 74 int r1 = r1 / r4 if (r7 == 0) goto L5f goto L49 L3f: okhttp3.repackaged.Headers r7 = r7.headers() java.util.Date r7 = r7.getDate(r1) if (r7 == 0) goto L5f L49: long r1 = r7.getTime() long r6 = r6.getTime() int r6 = (r1 > r6 ? 1 : (r1 == r6 ? 0 : -1)) if (r6 >= 0) goto L5f int r6 = okhttp3.repackaged.internal.http.HttpEngine.g int r6 = r6 + 85 int r7 = r6 % 128 okhttp3.repackaged.internal.http.HttpEngine.f = r7 int r6 = r6 % r0 return r3 L5f: int r6 = okhttp3.repackaged.internal.http.HttpEngine.g int r6 = r6 + 59 int r7 = r6 % 128 okhttp3.repackaged.internal.http.HttpEngine.f = r7 int r6 = r6 % r0 if (r6 == 0) goto L6d r6 = 61 int r6 = r6 / r4 L6d: return r4 */ throw new UnsupportedOperationException("Method not decompiled: okhttp3.repackaged.internal.http.HttpEngine.a(okhttp3.repackaged.Response, okhttp3.repackaged.Response):boolean"); } private static Headers a(Headers headers, Headers headers2) throws IOException { int i; int i2 = 2 % 2; Headers.Builder builder = new Headers.Builder(); int size = headers.size(); int i3 = f + 31; g = i3 % 128; if (i3 % 2 == 0) { int i4 = 3 / 2; } while (true) { Object obj = null; if (i >= size) { int size2 = headers2.size(); for (int i5 = 0; i5 < size2; i5++) { int i6 = g + 83; f = i6 % 128; if (i6 % 2 != 0) { HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(headers2.name(i5)); throw null; } String name = headers2.name(i5); if (!HttpHeaders.CONTENT_LENGTH.equalsIgnoreCase(name) && OkHeaders.isEndToEnd(name)) { int i7 = f + 119; g = i7 % 128; int i8 = i7 % 2; builder.add(name, headers2.value(i5)); } } return builder.build(); } int i9 = f + 41; g = i9 % 128; if (i9 % 2 == 0) { String name2 = headers.name(i); headers.value(i); HttpHeaders.WARNING.equalsIgnoreCase(name2); obj.hashCode(); throw null; } String name3 = headers.name(i); String value = headers.value(i); if (HttpHeaders.WARNING.equalsIgnoreCase(name3)) { Object[] objArr = new Object[1]; j((short) ((ViewConfiguration.getScrollFriction() > BitmapDescriptorFactory.HUE_RED ? 1 : (ViewConfiguration.getScrollFriction() == BitmapDescriptorFactory.HUE_RED ? 0 : -1)) + 25), (byte) ((-32) - TextUtils.lastIndexOf("", '0', 0, 0)), (ViewConfiguration.getMaximumFlingVelocity() >> 16) - 92, 1473786958 - View.resolveSize(0, 0), (-1090075791) + (Process.myTid() >> 22), objArr); i = true ^ value.startsWith(((String) objArr[0]).intern()) ? 0 : i + 1; } if (!OkHeaders.isEndToEnd(name3) || headers2.get(name3) == null) { builder.add(name3, value); } } } public final void receiveHeaders(Headers headers) throws IOException { int i = 2 % 2; int i2 = f + 79; g = i2 % 128; if (i2 % 2 != 0) { if (this.client.cookieJar() == CookieJar.NO_COOKIES) { return; } List parseAll = Cookie.parseAll(this.amh.url(), headers); if (parseAll.isEmpty()) { return; } this.client.cookieJar().saveFromResponse(this.amh.url(), parseAll); int i3 = f + 1; g = i3 % 128; if (i3 % 2 == 0) { throw null; } return; } this.client.cookieJar(); CookieJar cookieJar = CookieJar.NO_COOKIES; throw null; } public final Request followUpRequest() throws IOException { Proxy proxy; int i = 2 % 2; int i2 = g + 99; f = i2 % 128; Object obj = null; if (i2 % 2 != 0) { obj.hashCode(); throw null; } if (this.ami == null) { throw new IllegalStateException(); } RealConnection connection = this.streamAllocation.connection(); Route route = connection != null ? connection.route() : null; int code = this.ami.code(); String method = this.amh.method(); if (code != 307 && code != 308) { if (code != 401) { if (code != 407) { int i3 = f + 19; int i4 = i3 % 128; g = i4; int i5 = i3 % 2; if (code == 408) { giX gix = this.amj; boolean z = gix == null || (gix instanceof RetryableSink); if (this.aml && !z) { int i6 = i4 + 105; f = i6 % 128; int i7 = i6 % 2; return null; } Request request = this.amh; int i8 = i4 + 13; f = i8 % 128; if (i8 % 2 == 0) { return request; } throw null; } switch (code) { case 300: case 301: case 302: case 303: break; default: int i9 = i4 + 103; f = i9 % 128; int i10 = i9 % 2; return null; } } else { if (route != null) { proxy = route.proxy(); int i11 = g + 13; f = i11 % 128; int i12 = i11 % 2; } else { proxy = this.client.proxy(); } if (proxy.type() != Proxy.Type.HTTP) { throw new ProtocolException("Received HTTP_PROXY_AUTH (407) code while not using proxy"); } } } return this.client.authenticator().authenticate(route, this.ami); } if (!method.equals("GET") && (!method.equals("HEAD"))) { return null; } if (!this.client.followRedirects()) { int i13 = g + 93; f = i13 % 128; int i14 = i13 % 2; return null; } String header = this.ami.header(HttpHeaders.LOCATION); if (header == null) { int i15 = f + 17; g = i15 % 128; int i16 = i15 % 2; return null; } HttpUrl resolve = this.amh.url().resolve(header); if (resolve == null) { return null; } if (!resolve.scheme().equals(this.amh.url().scheme()) && (!this.client.followSslRedirects())) { int i17 = f + 31; g = i17 % 128; if (i17 % 2 == 0) { int i18 = 35 / 0; } return null; } Request.Builder newBuilder = this.amh.newBuilder(); if (HttpMethod.permitsRequestBody(method)) { if (HttpMethod.redirectsToGet(method)) { newBuilder.method("GET", null); } else { newBuilder.method(method, null); } newBuilder.removeHeader(HttpHeaders.TRANSFER_ENCODING); newBuilder.removeHeader(HttpHeaders.CONTENT_LENGTH); newBuilder.removeHeader(HttpHeaders.CONTENT_TYPE); } if (!sameConnection(resolve)) { int i19 = f + 37; g = i19 % 128; int i20 = i19 % 2; newBuilder.removeHeader(HttpHeaders.AUTHORIZATION); } return newBuilder.url(resolve).build(); } public final boolean sameConnection(HttpUrl httpUrl) { int i = 2 % 2; HttpUrl url = this.amh.url(); if (url.host().equals(httpUrl.host())) { int i2 = g + 53; f = i2 % 128; if (i2 % 2 != 0) { url.port(); httpUrl.port(); throw null; } if (url.port() == httpUrl.port() && !(!url.scheme().equals(httpUrl.scheme()))) { return true; } } int i3 = g + 45; f = i3 % 128; int i4 = i3 % 2; return false; } private static Address a(OkHttpClient okHttpClient, Request request) { SSLSocketFactory sSLSocketFactory; HostnameVerifier hostnameVerifier; CertificatePinner certificatePinner; int i = 2 % 2; int i2 = f + 29; g = i2 % 128; int i3 = i2 % 2; if (request.isHttps()) { SSLSocketFactory sslSocketFactory = okHttpClient.sslSocketFactory(); HostnameVerifier hostnameVerifier2 = okHttpClient.hostnameVerifier(); CertificatePinner certificatePinner2 = okHttpClient.certificatePinner(); int i4 = f + 11; g = i4 % 128; int i5 = i4 % 2; sSLSocketFactory = sslSocketFactory; hostnameVerifier = hostnameVerifier2; certificatePinner = certificatePinner2; } else { int i6 = f + 97; g = i6 % 128; int i7 = i6 % 2; sSLSocketFactory = null; hostnameVerifier = null; certificatePinner = null; } return new Address(request.url().host(), request.url().port(), okHttpClient.dns(), okHttpClient.socketFactory(), sSLSocketFactory, hostnameVerifier, certificatePinner, okHttpClient.proxyAuthenticator(), okHttpClient.proxy(), okHttpClient.protocols(), okHttpClient.connectionSpecs(), okHttpClient.proxySelector()); } static void a() { e = -68561497; a = 1406017096; b = 322380501; c = new byte[]{Ascii.NAK}; } public final boolean hasResponse() { boolean z; int i = 2 % 2; if (this.ami != null) { z = true; } else { int i2 = f + 13; g = i2 % 128; int i3 = i2 % 2; z = false; } int i4 = g + 55; f = i4 % 128; int i5 = i4 % 2; return z; } public final Request getRequest() { Request request; int i = 2 % 2; int i2 = f + 81; int i3 = i2 % 128; g = i3; if (i2 % 2 == 0) { request = this.amh; int i4 = 54 / 0; } else { request = this.amh; } int i5 = i3 + 107; f = i5 % 128; int i6 = i5 % 2; return request; } }