2021-11-02 06:38:17 +00:00
|
|
|
package i0;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
|
|
|
import f0.e;
|
|
|
|
import f0.f;
|
|
|
|
import f0.u;
|
|
|
|
import f0.w;
|
|
|
|
import f0.y;
|
|
|
|
import g0.g;
|
|
|
|
import g0.j;
|
|
|
|
import g0.r;
|
|
|
|
import g0.x;
|
|
|
|
import i0.v;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.io.IOException;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Objects;
|
|
|
|
import okhttp3.Headers;
|
|
|
|
import okhttp3.MediaType;
|
|
|
|
import okhttp3.MultipartBody;
|
2021-08-10 21:19:22 +00:00
|
|
|
import okhttp3.Request;
|
2021-08-03 07:33:18 +00:00
|
|
|
import okhttp3.RequestBody;
|
|
|
|
import okhttp3.Response;
|
|
|
|
import okhttp3.ResponseBody;
|
2022-03-07 09:34:54 +00:00
|
|
|
/* compiled from: OkHttpCall.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public final class p<T> implements d<T> {
|
2021-12-02 18:53:44 +00:00
|
|
|
public final w j;
|
|
|
|
public final Object[] k;
|
|
|
|
public final e.a l;
|
|
|
|
public final h<ResponseBody, T> m;
|
|
|
|
public volatile boolean n;
|
|
|
|
public e o;
|
|
|
|
public Throwable p;
|
|
|
|
public boolean q;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* compiled from: OkHttpCall.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public class a implements f {
|
|
|
|
public final /* synthetic */ f a;
|
|
|
|
|
|
|
|
public a(f fVar) {
|
|
|
|
this.a = fVar;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // f0.f
|
2021-08-03 07:33:18 +00:00
|
|
|
public void a(e eVar, Response response) {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.a.b(p.this, p.this.g(response));
|
|
|
|
} catch (Throwable th) {
|
|
|
|
c0.o(th);
|
|
|
|
th.printStackTrace();
|
|
|
|
}
|
|
|
|
} catch (Throwable th2) {
|
|
|
|
c0.o(th2);
|
2022-03-07 09:34:54 +00:00
|
|
|
try {
|
|
|
|
this.a.a(p.this, th2);
|
|
|
|
} catch (Throwable th3) {
|
|
|
|
c0.o(th3);
|
|
|
|
th3.printStackTrace();
|
|
|
|
}
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // f0.f
|
2021-08-03 07:33:18 +00:00
|
|
|
public void b(e eVar, IOException iOException) {
|
|
|
|
try {
|
|
|
|
this.a.a(p.this, iOException);
|
|
|
|
} catch (Throwable th) {
|
|
|
|
c0.o(th);
|
|
|
|
th.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* compiled from: OkHttpCall.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final class b extends ResponseBody {
|
2021-12-02 18:53:44 +00:00
|
|
|
public final ResponseBody l;
|
|
|
|
public final g m;
|
|
|
|
public IOException n;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* compiled from: OkHttpCall.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public class a extends j {
|
|
|
|
public a(x xVar) {
|
|
|
|
super(xVar);
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // g0.x
|
2021-11-05 06:48:17 +00:00
|
|
|
public long i0(g0.e eVar, long j) throws IOException {
|
2021-08-03 07:33:18 +00:00
|
|
|
try {
|
|
|
|
m.checkParameterIsNotNull(eVar, "sink");
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.j.i0(eVar, j);
|
2021-08-03 07:33:18 +00:00
|
|
|
} catch (IOException e) {
|
2021-12-02 18:53:44 +00:00
|
|
|
b.this.n = e;
|
2021-08-03 07:33:18 +00:00
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public b(ResponseBody responseBody) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.l = responseBody;
|
2021-08-03 07:33:18 +00:00
|
|
|
a aVar = new a(responseBody.c());
|
|
|
|
m.checkParameterIsNotNull(aVar, "$this$buffer");
|
2021-12-02 18:53:44 +00:00
|
|
|
this.m = new r(aVar);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody
|
|
|
|
public long a() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.l.a();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody
|
|
|
|
public MediaType b() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.l.b();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody
|
|
|
|
public g c() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody, java.io.Closeable, java.lang.AutoCloseable
|
|
|
|
public void close() {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.l.close();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* compiled from: OkHttpCall.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public static final class c extends ResponseBody {
|
2021-12-02 18:53:44 +00:00
|
|
|
public final MediaType l;
|
|
|
|
public final long m;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
public c(MediaType mediaType, long j) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.l = mediaType;
|
|
|
|
this.m = j;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody
|
|
|
|
public long a() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody
|
|
|
|
public MediaType b() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.l;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // okhttp3.ResponseBody
|
|
|
|
public g c() {
|
|
|
|
throw new IllegalStateException("Cannot read raw response body of a converted body.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public p(w wVar, Object[] objArr, e.a aVar, h<ResponseBody, T> hVar) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j = wVar;
|
|
|
|
this.k = objArr;
|
|
|
|
this.l = aVar;
|
|
|
|
this.m = hVar;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.d
|
2021-11-05 06:48:17 +00:00
|
|
|
public void C(f<T> fVar) {
|
2021-08-03 07:33:18 +00:00
|
|
|
e eVar;
|
|
|
|
Throwable th;
|
|
|
|
synchronized (this) {
|
2021-12-02 18:53:44 +00:00
|
|
|
if (!this.q) {
|
|
|
|
this.q = true;
|
|
|
|
eVar = this.o;
|
|
|
|
th = this.p;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (eVar == null && th == null) {
|
2022-03-07 09:34:54 +00:00
|
|
|
e b2 = b();
|
|
|
|
this.o = b2;
|
|
|
|
eVar = b2;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("Already executed.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (th != null) {
|
|
|
|
fVar.a(this, th);
|
|
|
|
return;
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.n) {
|
2021-08-03 07:33:18 +00:00
|
|
|
eVar.cancel();
|
|
|
|
}
|
|
|
|
eVar.e(new a(fVar));
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.d
|
2021-11-05 06:48:17 +00:00
|
|
|
public d L() {
|
2021-12-02 18:53:44 +00:00
|
|
|
return new p(this.j, this.k, this.l, this.m);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final e b() throws IOException {
|
|
|
|
w wVar;
|
2021-12-02 18:53:44 +00:00
|
|
|
e.a aVar = this.l;
|
|
|
|
w wVar2 = this.j;
|
|
|
|
Object[] objArr = this.k;
|
2021-08-03 07:33:18 +00:00
|
|
|
t<?>[] tVarArr = wVar2.j;
|
|
|
|
int length = objArr.length;
|
|
|
|
if (length == tVarArr.length) {
|
2022-03-14 07:58:47 +00:00
|
|
|
v vVar = new v(wVar2.c, wVar2.f3739b, wVar2.d, wVar2.e, wVar2.f, wVar2.g, wVar2.h, wVar2.i);
|
2021-08-03 07:33:18 +00:00
|
|
|
if (wVar2.k) {
|
|
|
|
length--;
|
|
|
|
}
|
|
|
|
ArrayList arrayList = new ArrayList(length);
|
|
|
|
for (int i = 0; i < length; i++) {
|
|
|
|
arrayList.add(objArr[i]);
|
|
|
|
tVarArr[i].a(vVar, objArr[i]);
|
|
|
|
}
|
|
|
|
w.a aVar2 = vVar.f;
|
|
|
|
if (aVar2 != null) {
|
|
|
|
wVar = aVar2.b();
|
|
|
|
} else {
|
|
|
|
w wVar3 = vVar.d;
|
|
|
|
String str = vVar.e;
|
|
|
|
Objects.requireNonNull(wVar3);
|
|
|
|
m.checkParameterIsNotNull(str, "link");
|
|
|
|
w.a g = wVar3.g(str);
|
|
|
|
wVar = g != null ? g.b() : null;
|
|
|
|
if (wVar == null) {
|
2022-03-14 07:58:47 +00:00
|
|
|
StringBuilder S = b.d.b.a.a.S("Malformed URL. Base: ");
|
|
|
|
S.append(vVar.d);
|
|
|
|
S.append(", Relative: ");
|
|
|
|
S.append(vVar.e);
|
|
|
|
throw new IllegalArgumentException(S.toString());
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
RequestBody requestBody = vVar.m;
|
|
|
|
if (requestBody == null) {
|
|
|
|
u.a aVar3 = vVar.l;
|
|
|
|
if (aVar3 != null) {
|
2022-03-14 07:58:47 +00:00
|
|
|
requestBody = new u(aVar3.a, aVar3.f3657b);
|
2021-08-03 07:33:18 +00:00
|
|
|
} else {
|
|
|
|
MultipartBody.a aVar4 = vVar.k;
|
|
|
|
if (aVar4 != null) {
|
|
|
|
requestBody = aVar4.b();
|
|
|
|
} else if (vVar.j) {
|
|
|
|
requestBody = RequestBody.create((MediaType) null, new byte[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
MediaType mediaType = vVar.i;
|
|
|
|
if (mediaType != null) {
|
|
|
|
if (requestBody != null) {
|
2022-03-07 09:34:54 +00:00
|
|
|
requestBody = new v.a(requestBody, mediaType);
|
2021-08-03 07:33:18 +00:00
|
|
|
} else {
|
|
|
|
vVar.h.a("Content-Type", mediaType.d);
|
|
|
|
}
|
|
|
|
}
|
2022-03-07 09:34:54 +00:00
|
|
|
Request.a aVar5 = vVar.g;
|
|
|
|
aVar5.g(wVar);
|
2021-08-03 07:33:18 +00:00
|
|
|
Headers c2 = vVar.h.c();
|
|
|
|
m.checkParameterIsNotNull(c2, "headers");
|
2022-03-07 09:34:54 +00:00
|
|
|
aVar5.c = c2.e();
|
|
|
|
aVar5.c(vVar.c, requestBody);
|
|
|
|
aVar5.e(k.class, new k(wVar2.a, arrayList));
|
|
|
|
e b2 = aVar.b(aVar5.a());
|
2021-08-03 07:33:18 +00:00
|
|
|
Objects.requireNonNull(b2, "Call.Factory returned null.");
|
|
|
|
return b2;
|
|
|
|
}
|
2022-03-14 07:58:47 +00:00
|
|
|
throw new IllegalArgumentException(b.d.b.a.a.A(b.d.b.a.a.U("Argument count (", length, ") doesn't match expected count ("), tVarArr.length, ")"));
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.d
|
2021-08-10 21:19:22 +00:00
|
|
|
public synchronized Request c() {
|
2021-08-03 07:33:18 +00:00
|
|
|
try {
|
|
|
|
} catch (IOException e) {
|
|
|
|
throw new RuntimeException("Unable to create request.", e);
|
|
|
|
}
|
|
|
|
return f().c();
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.d
|
2021-08-03 07:33:18 +00:00
|
|
|
public void cancel() {
|
|
|
|
e eVar;
|
2021-12-02 18:53:44 +00:00
|
|
|
this.n = true;
|
2021-08-03 07:33:18 +00:00
|
|
|
synchronized (this) {
|
2021-12-02 18:53:44 +00:00
|
|
|
eVar = this.o;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
if (eVar != null) {
|
|
|
|
eVar.cancel();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Object clone() throws CloneNotSupportedException {
|
2021-12-02 18:53:44 +00:00
|
|
|
return new p(this.j, this.k, this.l, this.m);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.d
|
2021-08-03 07:33:18 +00:00
|
|
|
public boolean d() {
|
|
|
|
boolean z2 = true;
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.n) {
|
2021-08-03 07:33:18 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
synchronized (this) {
|
2021-12-02 18:53:44 +00:00
|
|
|
e eVar = this.o;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (eVar == null || !eVar.d()) {
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return z2;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // i0.d
|
2021-08-03 07:33:18 +00:00
|
|
|
public retrofit2.Response<T> execute() throws IOException {
|
|
|
|
e f;
|
|
|
|
synchronized (this) {
|
2021-12-02 18:53:44 +00:00
|
|
|
if (!this.q) {
|
|
|
|
this.q = true;
|
2021-08-03 07:33:18 +00:00
|
|
|
f = f();
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("Already executed.");
|
|
|
|
}
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.n) {
|
2021-08-03 07:33:18 +00:00
|
|
|
f.cancel();
|
|
|
|
}
|
|
|
|
return g(f.execute());
|
|
|
|
}
|
|
|
|
|
|
|
|
public final e f() throws IOException {
|
2021-12-02 18:53:44 +00:00
|
|
|
e eVar = this.o;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (eVar != null) {
|
|
|
|
return eVar;
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
Throwable th = this.p;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (th == null) {
|
|
|
|
try {
|
|
|
|
e b2 = b();
|
2021-12-02 18:53:44 +00:00
|
|
|
this.o = b2;
|
2021-08-03 07:33:18 +00:00
|
|
|
return b2;
|
|
|
|
} catch (IOException | Error | RuntimeException e) {
|
|
|
|
c0.o(e);
|
2021-12-02 18:53:44 +00:00
|
|
|
this.p = e;
|
2021-08-03 07:33:18 +00:00
|
|
|
throw e;
|
|
|
|
}
|
|
|
|
} else if (th instanceof IOException) {
|
|
|
|
throw ((IOException) th);
|
|
|
|
} else if (th instanceof RuntimeException) {
|
|
|
|
throw ((RuntimeException) th);
|
|
|
|
} else {
|
|
|
|
throw ((Error) th);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
/* JADX WARN: Finally extract failed */
|
2021-08-03 07:33:18 +00:00
|
|
|
public retrofit2.Response<T> g(Response response) throws IOException {
|
2021-12-02 18:53:44 +00:00
|
|
|
ResponseBody responseBody = response.p;
|
2021-08-03 07:33:18 +00:00
|
|
|
m.checkParameterIsNotNull(response, "response");
|
2021-12-02 18:53:44 +00:00
|
|
|
Request request = response.j;
|
|
|
|
y yVar = response.k;
|
|
|
|
int i = response.m;
|
|
|
|
String str = response.l;
|
|
|
|
f0.v vVar = response.n;
|
|
|
|
Headers.a e = response.o.e();
|
|
|
|
Response response2 = response.q;
|
|
|
|
Response response3 = response.r;
|
2022-03-14 07:58:47 +00:00
|
|
|
Response response4 = response.f3793s;
|
2021-12-02 18:53:44 +00:00
|
|
|
long j = response.t;
|
|
|
|
long j2 = response.u;
|
|
|
|
f0.e0.g.c cVar = response.v;
|
2021-08-03 07:33:18 +00:00
|
|
|
c cVar2 = new c(responseBody.b(), responseBody.a());
|
|
|
|
if (!(i >= 0)) {
|
2021-12-17 21:59:34 +00:00
|
|
|
throw new IllegalStateException(b.d.b.a.a.p("code < 0: ", i).toString());
|
2021-08-10 21:19:22 +00:00
|
|
|
} else if (request == null) {
|
2021-08-03 07:33:18 +00:00
|
|
|
throw new IllegalStateException("request == null".toString());
|
|
|
|
} else if (yVar == null) {
|
|
|
|
throw new IllegalStateException("protocol == null".toString());
|
|
|
|
} else if (str != null) {
|
2021-08-10 21:19:22 +00:00
|
|
|
Response response5 = new Response(request, yVar, str, i, vVar, e.c(), cVar2, response2, response3, response4, j, j2, cVar);
|
2021-12-02 18:53:44 +00:00
|
|
|
int i2 = response5.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (i2 < 200 || i2 >= 300) {
|
|
|
|
try {
|
|
|
|
ResponseBody a2 = c0.a(responseBody);
|
|
|
|
if (!response5.b()) {
|
2022-03-07 09:34:54 +00:00
|
|
|
retrofit2.Response<T> response6 = new retrofit2.Response<>(response5, null, a2);
|
|
|
|
responseBody.close();
|
|
|
|
return response6;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
throw new IllegalArgumentException("rawResponse should not be successful response");
|
2022-03-07 09:34:54 +00:00
|
|
|
} catch (Throwable th) {
|
2021-08-03 07:33:18 +00:00
|
|
|
responseBody.close();
|
2022-03-07 09:34:54 +00:00
|
|
|
throw th;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
} else if (i2 == 204 || i2 == 205) {
|
|
|
|
responseBody.close();
|
|
|
|
return retrofit2.Response.b(null, response5);
|
|
|
|
} else {
|
|
|
|
b bVar = new b(responseBody);
|
|
|
|
try {
|
2021-12-02 18:53:44 +00:00
|
|
|
return retrofit2.Response.b(this.m.convert(bVar), response5);
|
2021-08-03 07:33:18 +00:00
|
|
|
} catch (RuntimeException e2) {
|
2021-12-02 18:53:44 +00:00
|
|
|
IOException iOException = bVar.n;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (iOException == null) {
|
|
|
|
throw e2;
|
|
|
|
}
|
|
|
|
throw iOException;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw new IllegalStateException("message == null".toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|