2021-11-08 18:25:28 +00:00
|
|
|
package i0;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-08-09 22:50:01 +00:00
|
|
|
import androidx.browser.trusted.sharing.ShareTarget;
|
2021-12-21 23:37:30 +00:00
|
|
|
import b.d.b.a.a;
|
2021-11-08 18:25:28 +00:00
|
|
|
import f0.e;
|
|
|
|
import i0.c0;
|
|
|
|
import i0.f0.b;
|
|
|
|
import i0.f0.c;
|
|
|
|
import i0.f0.d;
|
|
|
|
import i0.f0.e;
|
|
|
|
import i0.f0.f;
|
|
|
|
import i0.f0.g;
|
|
|
|
import i0.f0.h;
|
|
|
|
import i0.f0.i;
|
|
|
|
import i0.f0.j;
|
|
|
|
import i0.f0.k;
|
|
|
|
import i0.f0.l;
|
|
|
|
import i0.f0.m;
|
|
|
|
import i0.f0.n;
|
|
|
|
import i0.f0.o;
|
|
|
|
import i0.f0.p;
|
|
|
|
import i0.f0.q;
|
|
|
|
import i0.f0.r;
|
|
|
|
import i0.f0.s;
|
|
|
|
import i0.f0.u;
|
|
|
|
import i0.f0.v;
|
|
|
|
import i0.f0.x;
|
|
|
|
import i0.f0.y;
|
|
|
|
import i0.j;
|
|
|
|
import i0.t;
|
|
|
|
import i0.w;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.lang.annotation.Annotation;
|
|
|
|
import java.lang.reflect.Method;
|
2021-08-04 22:02:59 +00:00
|
|
|
import java.lang.reflect.ParameterizedType;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.lang.reflect.Type;
|
2021-08-04 22:02:59 +00:00
|
|
|
import java.lang.reflect.WildcardType;
|
|
|
|
import java.net.URI;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.Map;
|
2021-08-04 22:02:59 +00:00
|
|
|
import kotlin.coroutines.Continuation;
|
|
|
|
import okhttp3.Headers;
|
|
|
|
import okhttp3.MediaType;
|
|
|
|
import okhttp3.MultipartBody;
|
2021-06-27 20:44:35 +00:00
|
|
|
import okhttp3.RequestBody;
|
|
|
|
import okhttp3.ResponseBody;
|
2021-08-04 22:02:59 +00:00
|
|
|
import retrofit2.Response;
|
2022-03-02 20:59:20 +00:00
|
|
|
/* compiled from: ServiceMethod.java */
|
|
|
|
/* loaded from: classes3.dex */
|
2021-08-04 22:02:59 +00:00
|
|
|
public abstract class z<T> {
|
|
|
|
public static <T> z<T> b(y yVar, Method method) {
|
2022-03-02 20:59:20 +00:00
|
|
|
Annotation[] annotationArr;
|
2021-08-04 22:02:59 +00:00
|
|
|
Type type;
|
|
|
|
boolean z2;
|
2022-03-02 20:59:20 +00:00
|
|
|
Type[] genericParameterTypes;
|
2021-08-04 22:02:59 +00:00
|
|
|
t<?> tVar;
|
2022-03-02 20:59:20 +00:00
|
|
|
int i;
|
2021-08-04 22:02:59 +00:00
|
|
|
t<?> tVar2;
|
|
|
|
w.a aVar = new w.a(yVar, method);
|
2022-03-02 20:59:20 +00:00
|
|
|
for (Annotation annotation : aVar.e) {
|
2021-08-04 22:02:59 +00:00
|
|
|
if (annotation instanceof b) {
|
|
|
|
aVar.b("DELETE", ((b) annotation).value(), false);
|
|
|
|
} else if (annotation instanceof f) {
|
2021-08-09 22:50:01 +00:00
|
|
|
aVar.b(ShareTarget.METHOD_GET, ((f) annotation).value(), false);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (annotation instanceof g) {
|
|
|
|
aVar.b("HEAD", ((g) annotation).value(), false);
|
|
|
|
} else if (annotation instanceof n) {
|
|
|
|
aVar.b("PATCH", ((n) annotation).value(), true);
|
|
|
|
} else if (annotation instanceof o) {
|
2021-08-09 22:50:01 +00:00
|
|
|
aVar.b(ShareTarget.METHOD_POST, ((o) annotation).value(), true);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (annotation instanceof p) {
|
|
|
|
aVar.b("PUT", ((p) annotation).value(), true);
|
|
|
|
} else if (annotation instanceof m) {
|
|
|
|
aVar.b("OPTIONS", ((m) annotation).value(), false);
|
|
|
|
} else if (annotation instanceof h) {
|
|
|
|
h hVar = (h) annotation;
|
|
|
|
aVar.b(hVar.method(), hVar.path(), hVar.hasBody());
|
|
|
|
} else if (annotation instanceof k) {
|
|
|
|
String[] value = ((k) annotation).value();
|
|
|
|
if (value.length != 0) {
|
|
|
|
Headers.a aVar2 = new Headers.a();
|
|
|
|
for (String str : value) {
|
|
|
|
int indexOf = str.indexOf(58);
|
|
|
|
if (indexOf == -1 || indexOf == 0 || indexOf == str.length() - 1) {
|
|
|
|
throw c0.j(aVar.d, "@Headers value must be in the form \"Name: Value\". Found: \"%s\"", str);
|
|
|
|
}
|
|
|
|
String substring = str.substring(0, indexOf);
|
|
|
|
String trim = str.substring(indexOf + 1).trim();
|
|
|
|
if ("Content-Type".equalsIgnoreCase(substring)) {
|
|
|
|
try {
|
|
|
|
aVar.v = MediaType.b(trim);
|
|
|
|
} catch (IllegalArgumentException e) {
|
|
|
|
throw c0.k(aVar.d, e, "Malformed content type: %s", trim);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
aVar2.a(substring, trim);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
aVar.u = aVar2.c();
|
|
|
|
} else {
|
|
|
|
throw c0.j(aVar.d, "@Headers annotation is empty.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (annotation instanceof l) {
|
2021-11-08 18:25:28 +00:00
|
|
|
if (!aVar.r) {
|
2022-03-30 16:43:10 +00:00
|
|
|
aVar.f3745s = true;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
|
|
|
throw c0.j(aVar.d, "Only one encoding annotation is allowed.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (!(annotation instanceof e)) {
|
|
|
|
continue;
|
2022-03-30 16:43:10 +00:00
|
|
|
} else if (!aVar.f3745s) {
|
2021-11-08 18:25:28 +00:00
|
|
|
aVar.r = true;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
|
|
|
throw c0.j(aVar.d, "Only one encoding annotation is allowed.", new Object[0]);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
2021-08-04 22:02:59 +00:00
|
|
|
if (aVar.p != null) {
|
|
|
|
if (!aVar.q) {
|
2022-03-30 16:43:10 +00:00
|
|
|
if (aVar.f3745s) {
|
2021-08-04 22:02:59 +00:00
|
|
|
throw c0.j(aVar.d, "Multipart can only be specified on HTTP methods with request body (e.g., @POST).", new Object[0]);
|
2021-11-08 18:25:28 +00:00
|
|
|
} else if (aVar.r) {
|
2021-08-04 22:02:59 +00:00
|
|
|
throw c0.j(aVar.d, "FormUrlEncoded can only be specified on HTTP methods with request body (e.g., @POST).", new Object[0]);
|
|
|
|
}
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-08-04 22:02:59 +00:00
|
|
|
int length = aVar.f.length;
|
2022-03-30 16:43:10 +00:00
|
|
|
aVar.f3746x = new t[length];
|
2022-03-02 20:59:20 +00:00
|
|
|
int i2 = length - 1;
|
|
|
|
int i3 = 0;
|
|
|
|
while (i3 < length) {
|
2022-03-30 16:43:10 +00:00
|
|
|
t<?>[] tVarArr = aVar.f3746x;
|
2022-03-02 20:59:20 +00:00
|
|
|
Type type2 = aVar.g[i3];
|
|
|
|
Annotation[] annotationArr2 = aVar.f[i3];
|
|
|
|
boolean z3 = i3 == i2;
|
2021-08-04 22:02:59 +00:00
|
|
|
if (annotationArr2 != null) {
|
|
|
|
int length2 = annotationArr2.length;
|
|
|
|
tVar = null;
|
2022-03-02 20:59:20 +00:00
|
|
|
int i4 = 0;
|
|
|
|
while (i4 < length2) {
|
|
|
|
Annotation annotation2 = annotationArr2[i4];
|
2021-08-04 22:02:59 +00:00
|
|
|
if (annotation2 instanceof y) {
|
2022-03-02 20:59:20 +00:00
|
|
|
aVar.c(i3, type2);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (aVar.o) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Multiple @Url method annotations found.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.k) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Path parameters may not be used with @Url.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.l) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "A @Url parameter must not come after a @Query.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.m) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "A @Url parameter must not come after a @QueryName.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.n) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "A @Url parameter must not come after a @QueryMap.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.t == null) {
|
|
|
|
aVar.o = true;
|
2021-11-08 18:25:28 +00:00
|
|
|
if (type2 == f0.w.class || type2 == String.class || type2 == URI.class || ((type2 instanceof Class) && "android.net.Uri".equals(((Class) type2).getName()))) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new t.n(aVar.d, i3);
|
|
|
|
i2 = i2;
|
|
|
|
i = i4;
|
|
|
|
length2 = length2;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Url must be okhttp3.HttpUrl, String, java.net.URI, or android.net.Uri type.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Url cannot be used with @%s URL", aVar.p);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
i2 = i2;
|
2021-08-04 22:02:59 +00:00
|
|
|
if (annotation2 instanceof s) {
|
2022-03-02 20:59:20 +00:00
|
|
|
aVar.c(i3, type2);
|
2021-08-04 22:02:59 +00:00
|
|
|
if (aVar.l) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "A @Path parameter must not come after a @Query.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.m) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "A @Path parameter must not come after a @QueryName.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.n) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "A @Path parameter must not come after a @QueryMap.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.o) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Path parameters may not be used with @Url.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (aVar.t != null) {
|
|
|
|
aVar.k = true;
|
|
|
|
s sVar = (s) annotation2;
|
|
|
|
String value2 = sVar.value();
|
2022-03-30 16:43:10 +00:00
|
|
|
if (!w.a.f3744b.matcher(value2).matches()) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Path parameter name must match %s. Found: %s", w.a.a.pattern(), value2);
|
2021-11-08 18:25:28 +00:00
|
|
|
} else if (aVar.w.contains(value2)) {
|
2022-03-02 20:59:20 +00:00
|
|
|
i = i4;
|
|
|
|
length2 = length2;
|
|
|
|
tVar2 = new t.i<>(aVar.d, i3, value2, aVar.c.e(type2, annotationArr2), sVar.encoded());
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "URL \"%s\" does not contain \"{%s}\".", aVar.t, value2);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Path can only be used with relative url on @%s", aVar.p);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
i = i4;
|
|
|
|
length2 = length2;
|
2021-11-08 18:25:28 +00:00
|
|
|
if (annotation2 instanceof i0.f0.t) {
|
2022-03-02 20:59:20 +00:00
|
|
|
aVar.c(i3, type2);
|
|
|
|
i0.f0.t tVar3 = (i0.f0.t) annotation2;
|
|
|
|
String value3 = tVar3.value();
|
|
|
|
boolean encoded = tVar3.encoded();
|
2021-08-04 22:02:59 +00:00
|
|
|
Class<?> f = c0.f(type2);
|
|
|
|
aVar.l = true;
|
|
|
|
if (Iterable.class.isAssignableFrom(f)) {
|
|
|
|
if (type2 instanceof ParameterizedType) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new r(new t.j(value3, aVar.c.e(c0.e(0, (ParameterizedType) type2), annotationArr2), encoded));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.o(f, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else if (f.isArray()) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new s(new t.j(value3, aVar.c.e(w.a.a(f.getComponentType()), annotationArr2), encoded));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new t.j<>(value3, aVar.c.e(type2, annotationArr2), encoded);
|
|
|
|
length2 = length2;
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else if (annotation2 instanceof v) {
|
|
|
|
aVar.c(i3, type2);
|
|
|
|
boolean encoded2 = ((v) annotation2).encoded();
|
|
|
|
Class<?> f2 = c0.f(type2);
|
|
|
|
aVar.m = true;
|
|
|
|
if (Iterable.class.isAssignableFrom(f2)) {
|
|
|
|
if (type2 instanceof ParameterizedType) {
|
|
|
|
tVar2 = new r(new t.l(aVar.c.e(c0.e(0, (ParameterizedType) type2), annotationArr2), encoded2));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.o(f2, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else if (f2.isArray()) {
|
|
|
|
tVar2 = new s(new t.l(aVar.c.e(w.a.a(f2.getComponentType()), annotationArr2), encoded2));
|
|
|
|
} else {
|
|
|
|
tVar2 = new t.l<>(aVar.c.e(type2, annotationArr2), encoded2);
|
|
|
|
length2 = length2;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
if (annotation2 instanceof u) {
|
|
|
|
aVar.c(i3, type2);
|
2021-08-04 22:02:59 +00:00
|
|
|
Class<?> f3 = c0.f(type2);
|
|
|
|
aVar.n = true;
|
|
|
|
if (Map.class.isAssignableFrom(f3)) {
|
|
|
|
Type g = c0.g(type2, f3, Map.class);
|
|
|
|
if (g instanceof ParameterizedType) {
|
|
|
|
ParameterizedType parameterizedType = (ParameterizedType) g;
|
|
|
|
Type e2 = c0.e(0, parameterizedType);
|
|
|
|
if (String.class == e2) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new t.k<>(aVar.d, i3, aVar.c.e(c0.e(1, parameterizedType), annotationArr2), ((u) annotation2).encoded());
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.y("@QueryMap keys must be of type String: ", e2), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@QueryMap parameter type must be Map.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else if (annotation2 instanceof i) {
|
2022-03-02 20:59:20 +00:00
|
|
|
aVar.c(i3, type2);
|
2021-08-04 22:02:59 +00:00
|
|
|
String value4 = ((i) annotation2).value();
|
|
|
|
Class<?> f4 = c0.f(type2);
|
|
|
|
if (Iterable.class.isAssignableFrom(f4)) {
|
|
|
|
if (type2 instanceof ParameterizedType) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new r(new t.d(value4, aVar.c.e(c0.e(0, (ParameterizedType) type2), annotationArr2)));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.o(f4, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else if (f4.isArray()) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new s(new t.d(value4, aVar.c.e(w.a.a(f4.getComponentType()), annotationArr2)));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new t.d<>(value4, aVar.c.e(type2, annotationArr2));
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else if (annotation2 instanceof j) {
|
|
|
|
if (type2 == Headers.class) {
|
|
|
|
tVar2 = new t.f(aVar.d, i3);
|
|
|
|
} else {
|
|
|
|
aVar.c(i3, type2);
|
|
|
|
Class<?> f5 = c0.f(type2);
|
|
|
|
if (Map.class.isAssignableFrom(f5)) {
|
|
|
|
Type g2 = c0.g(type2, f5, Map.class);
|
|
|
|
if (g2 instanceof ParameterizedType) {
|
|
|
|
ParameterizedType parameterizedType2 = (ParameterizedType) g2;
|
|
|
|
Type e3 = c0.e(0, parameterizedType2);
|
|
|
|
if (String.class == e3) {
|
|
|
|
tVar2 = new t.e<>(aVar.d, i3, aVar.c.e(c0.e(1, parameterizedType2), annotationArr2));
|
|
|
|
length2 = length2;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.y("@HeaderMap keys must be of type String: ", e3), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@HeaderMap parameter type must be Map.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
}
|
|
|
|
} else if (annotation2 instanceof c) {
|
|
|
|
aVar.c(i3, type2);
|
|
|
|
if (aVar.r) {
|
|
|
|
c cVar = (c) annotation2;
|
|
|
|
String value5 = cVar.value();
|
|
|
|
boolean encoded3 = cVar.encoded();
|
|
|
|
aVar.h = true;
|
|
|
|
Class<?> f6 = c0.f(type2);
|
|
|
|
if (Iterable.class.isAssignableFrom(f6)) {
|
|
|
|
if (type2 instanceof ParameterizedType) {
|
|
|
|
tVar2 = new r(new t.b(value5, aVar.c.e(c0.e(0, (ParameterizedType) type2), annotationArr2), encoded3));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.o(f6, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else if (f6.isArray()) {
|
|
|
|
tVar2 = new s(new t.b(value5, aVar.c.e(w.a.a(f6.getComponentType()), annotationArr2), encoded3));
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new t.b<>(value5, aVar.c.e(type2, annotationArr2), encoded3);
|
|
|
|
length2 = length2;
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@Field parameters can only be used with form encoding.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (annotation2 instanceof d) {
|
|
|
|
aVar.c(i3, type2);
|
|
|
|
if (aVar.r) {
|
|
|
|
Class<?> f7 = c0.f(type2);
|
|
|
|
if (Map.class.isAssignableFrom(f7)) {
|
|
|
|
Type g3 = c0.g(type2, f7, Map.class);
|
|
|
|
if (g3 instanceof ParameterizedType) {
|
|
|
|
ParameterizedType parameterizedType3 = (ParameterizedType) g3;
|
|
|
|
Type e4 = c0.e(0, parameterizedType3);
|
|
|
|
if (String.class == e4) {
|
|
|
|
h<T, String> e5 = aVar.c.e(c0.e(1, parameterizedType3), annotationArr2);
|
|
|
|
aVar.h = true;
|
|
|
|
tVar2 = new t.c<>(aVar.d, i3, e5, ((d) annotation2).encoded());
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.y("@FieldMap keys must be of type String: ", e4), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@FieldMap parameter type must be Map.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@FieldMap parameters can only be used with form encoding.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (annotation2 instanceof q) {
|
|
|
|
aVar.c(i3, type2);
|
2022-03-30 16:43:10 +00:00
|
|
|
if (aVar.f3745s) {
|
2022-03-02 20:59:20 +00:00
|
|
|
q qVar = (q) annotation2;
|
|
|
|
aVar.i = true;
|
|
|
|
String value6 = qVar.value();
|
|
|
|
Class<?> f8 = c0.f(type2);
|
|
|
|
if (value6.isEmpty()) {
|
|
|
|
if (Iterable.class.isAssignableFrom(f8)) {
|
2021-08-04 22:02:59 +00:00
|
|
|
if (!(type2 instanceof ParameterizedType)) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.o(f8, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (MultipartBody.Part.class.isAssignableFrom(c0.f(c0.e(0, (ParameterizedType) type2)))) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new r(t.m.a);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else if (f8.isArray()) {
|
|
|
|
if (MultipartBody.Part.class.isAssignableFrom(f8.getComponentType())) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = new s(t.m.a);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else if (MultipartBody.Part.class.isAssignableFrom(f8)) {
|
2022-03-02 20:59:20 +00:00
|
|
|
tVar2 = t.m.a;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Part annotation must supply a name or use MultipartBody.Part parameter type.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
length2 = length2;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
length2 = length2;
|
|
|
|
Headers c = Headers.j.c("Content-Disposition", a.w("form-data; name=\"", value6, "\""), "Content-Transfer-Encoding", qVar.encoding());
|
|
|
|
if (Iterable.class.isAssignableFrom(f8)) {
|
|
|
|
if (type2 instanceof ParameterizedType) {
|
|
|
|
Type e6 = c0.e(0, (ParameterizedType) type2);
|
|
|
|
if (!MultipartBody.Part.class.isAssignableFrom(c0.f(e6))) {
|
|
|
|
tVar2 = new r(new t.g(aVar.d, i3, c, aVar.c.c(e6, annotationArr2, aVar.e)));
|
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, a.o(f8, new StringBuilder(), " must include generic type (e.g., ", "<String>)"), new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (f8.isArray()) {
|
|
|
|
Class<?> a = w.a.a(f8.getComponentType());
|
|
|
|
if (!MultipartBody.Part.class.isAssignableFrom(a)) {
|
|
|
|
tVar2 = new s(new t.g(aVar.d, i3, c, aVar.c.c(a, annotationArr2, aVar.e)));
|
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (!MultipartBody.Part.class.isAssignableFrom(f8)) {
|
|
|
|
tVar2 = new t.g<>(aVar.d, i3, c, aVar.c.c(type2, annotationArr2, aVar.e));
|
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@Part parameters using the MultipartBody.Part must not include a part name in the annotation.", new Object[0]);
|
|
|
|
}
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Part parameters can only be used with multipart encoding.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
length2 = length2;
|
|
|
|
if (annotation2 instanceof r) {
|
|
|
|
aVar.c(i3, type2);
|
2022-03-30 16:43:10 +00:00
|
|
|
if (aVar.f3745s) {
|
2022-03-02 20:59:20 +00:00
|
|
|
aVar.i = true;
|
|
|
|
Class<?> f9 = c0.f(type2);
|
|
|
|
if (Map.class.isAssignableFrom(f9)) {
|
|
|
|
Type g4 = c0.g(type2, f9, Map.class);
|
|
|
|
if (g4 instanceof ParameterizedType) {
|
|
|
|
ParameterizedType parameterizedType4 = (ParameterizedType) g4;
|
|
|
|
Type e7 = c0.e(0, parameterizedType4);
|
|
|
|
if (String.class == e7) {
|
|
|
|
Type e8 = c0.e(1, parameterizedType4);
|
|
|
|
if (!MultipartBody.Part.class.isAssignableFrom(c0.f(e8))) {
|
|
|
|
tVar2 = new t.h<>(aVar.d, i3, aVar.c.c(e8, annotationArr2, aVar.e), ((r) annotation2).encoding());
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@PartMap values cannot be MultipartBody.Part. Use @Part List<Part> or a different value type instead.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, a.y("@PartMap keys must be of type String: ", e7), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Map must include generic types (e.g., Map<String, String>)", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@PartMap parameter type must be Map.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else {
|
|
|
|
throw c0.l(aVar.d, i3, "@PartMap parameters can only be used with multipart encoding.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else if (annotation2 instanceof i0.f0.a) {
|
|
|
|
aVar.c(i3, type2);
|
2022-03-30 16:43:10 +00:00
|
|
|
if (aVar.r || aVar.f3745s) {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "@Body parameters cannot be used with form or multi-part encoding.", new Object[0]);
|
|
|
|
} else if (!aVar.j) {
|
|
|
|
try {
|
|
|
|
h<T, RequestBody> c2 = aVar.c.c(type2, annotationArr2, aVar.e);
|
|
|
|
aVar.j = true;
|
|
|
|
tVar2 = new t.a<>(aVar.d, i3, c2);
|
|
|
|
} catch (RuntimeException e9) {
|
|
|
|
throw c0.m(aVar.d, e9, i3, "Unable to create @Body converter for %s", type2);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Multiple @Body method annotations found.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
} else if (annotation2 instanceof x) {
|
|
|
|
aVar.c(i3, type2);
|
|
|
|
Class<?> f10 = c0.f(type2);
|
|
|
|
for (int i5 = i3 - 1; i5 >= 0; i5--) {
|
2022-03-30 16:43:10 +00:00
|
|
|
t<?> tVar4 = aVar.f3746x[i5];
|
2022-03-02 20:59:20 +00:00
|
|
|
if ((tVar4 instanceof t.o) && ((t.o) tVar4).a.equals(f10)) {
|
|
|
|
Method method2 = aVar.d;
|
2022-03-30 16:43:10 +00:00
|
|
|
StringBuilder R = a.R("@Tag type ");
|
|
|
|
R.append(f10.getName());
|
|
|
|
R.append(" is duplicate of parameter #");
|
|
|
|
R.append(i5 + 1);
|
|
|
|
R.append(" and would always overwrite its value.");
|
|
|
|
throw c0.l(method2, i3, R.toString(), new Object[0]);
|
2022-03-02 20:59:20 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
tVar2 = new t.o<>(f10);
|
|
|
|
} else {
|
|
|
|
tVar2 = null;
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
length2 = length2;
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (tVar2 != null) {
|
|
|
|
if (tVar == null) {
|
|
|
|
tVar = tVar2;
|
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "Multiple Retrofit annotations found, only one allowed.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
i4 = i + 1;
|
2021-08-04 22:02:59 +00:00
|
|
|
length = length;
|
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
length = length;
|
|
|
|
i2 = i2;
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
2022-03-02 20:59:20 +00:00
|
|
|
length = length;
|
|
|
|
i2 = i2;
|
2021-08-04 22:02:59 +00:00
|
|
|
tVar = null;
|
|
|
|
}
|
|
|
|
if (tVar == null) {
|
|
|
|
if (z3) {
|
|
|
|
try {
|
|
|
|
if (c0.f(type2) == Continuation.class) {
|
2022-03-30 16:43:10 +00:00
|
|
|
aVar.f3747y = true;
|
2021-08-04 22:02:59 +00:00
|
|
|
tVar = null;
|
|
|
|
}
|
|
|
|
} catch (NoClassDefFoundError unused) {
|
|
|
|
}
|
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
throw c0.l(aVar.d, i3, "No Retrofit annotation found.", new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
}
|
2022-03-02 20:59:20 +00:00
|
|
|
tVarArr[i3] = tVar;
|
|
|
|
i3++;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-08-04 22:02:59 +00:00
|
|
|
if (aVar.t != null || aVar.o) {
|
2021-11-08 18:25:28 +00:00
|
|
|
boolean z4 = aVar.r;
|
2022-03-30 16:43:10 +00:00
|
|
|
if (!z4 && !aVar.f3745s && !aVar.q && aVar.j) {
|
2021-08-04 22:02:59 +00:00
|
|
|
throw c0.j(aVar.d, "Non-body HTTP method cannot contain @Body.", new Object[0]);
|
|
|
|
} else if (z4 && !aVar.h) {
|
|
|
|
throw c0.j(aVar.d, "Form-encoded method must contain at least one @Field.", new Object[0]);
|
2022-03-30 16:43:10 +00:00
|
|
|
} else if (!aVar.f3745s || aVar.i) {
|
2021-08-04 22:02:59 +00:00
|
|
|
w wVar = new w(aVar);
|
|
|
|
Type genericReturnType = method.getGenericReturnType();
|
|
|
|
if (c0.h(genericReturnType)) {
|
|
|
|
throw c0.j(method, "Method return type must not include a type variable or wildcard: %s", genericReturnType);
|
|
|
|
} else if (genericReturnType != Void.TYPE) {
|
|
|
|
boolean z5 = wVar.k;
|
|
|
|
Annotation[] annotations = method.getAnnotations();
|
|
|
|
if (z5) {
|
2022-03-02 20:59:20 +00:00
|
|
|
Type type3 = ((ParameterizedType) method.getGenericParameterTypes()[genericParameterTypes.length - 1]).getActualTypeArguments()[0];
|
2021-08-04 22:02:59 +00:00
|
|
|
if (type3 instanceof WildcardType) {
|
|
|
|
type3 = ((WildcardType) type3).getLowerBounds()[0];
|
|
|
|
}
|
|
|
|
if (c0.f(type3) != Response.class || !(type3 instanceof ParameterizedType)) {
|
|
|
|
z2 = false;
|
|
|
|
} else {
|
|
|
|
type3 = c0.e(0, (ParameterizedType) type3);
|
|
|
|
z2 = true;
|
|
|
|
}
|
|
|
|
type = new c0.b(null, d.class, type3);
|
|
|
|
if (!c0.i(annotations, a0.class)) {
|
2022-03-02 20:59:20 +00:00
|
|
|
Annotation[] annotationArr3 = new Annotation[annotations.length + 1];
|
2021-08-04 22:02:59 +00:00
|
|
|
annotationArr3[0] = b0.a;
|
|
|
|
System.arraycopy(annotations, 0, annotationArr3, 1, annotations.length);
|
|
|
|
annotations = annotationArr3;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
type = method.getGenericReturnType();
|
|
|
|
z2 = false;
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
e<?, ?> a2 = yVar.a(type, annotations);
|
|
|
|
Type a3 = a2.a();
|
|
|
|
if (a3 == okhttp3.Response.class) {
|
2022-03-30 16:43:10 +00:00
|
|
|
StringBuilder R2 = a.R("'");
|
|
|
|
R2.append(c0.f(a3).getName());
|
|
|
|
R2.append("' is not a valid response body type. Did you mean ResponseBody?");
|
|
|
|
throw c0.j(method, R2.toString(), new Object[0]);
|
2021-08-04 22:02:59 +00:00
|
|
|
} else if (a3 == Response.class) {
|
|
|
|
throw c0.j(method, "Response must include generic type (e.g., Response<String>)", new Object[0]);
|
2021-12-21 23:37:30 +00:00
|
|
|
} else if (!wVar.c.equals("HEAD") || Void.class.equals(a3)) {
|
2021-08-04 22:02:59 +00:00
|
|
|
try {
|
|
|
|
h<ResponseBody, T> d = yVar.d(a3, method.getAnnotations());
|
2022-03-30 16:43:10 +00:00
|
|
|
e.a aVar3 = yVar.f3749b;
|
2021-08-04 22:02:59 +00:00
|
|
|
return !z5 ? new j.a(wVar, aVar3, d, a2) : z2 ? new j.c(wVar, aVar3, d, a2) : new j.b(wVar, aVar3, d, a2, false);
|
|
|
|
} catch (RuntimeException e10) {
|
|
|
|
throw c0.k(method, e10, "Unable to create converter for %s", a3);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw c0.j(method, "HEAD method must use Void as response type.", new Object[0]);
|
|
|
|
}
|
|
|
|
} catch (RuntimeException e11) {
|
|
|
|
throw c0.k(method, e11, "Unable to create call adapter for %s", type);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw c0.j(method, "Service methods cannot return void.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw c0.j(aVar.d, "Multipart method must contain at least one @Part.", new Object[0]);
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
throw c0.j(aVar.d, "Missing either @%s URL or @Url parameter.", aVar.p);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
2021-08-04 22:02:59 +00:00
|
|
|
} else {
|
|
|
|
throw c0.j(aVar.d, "HTTP method annotation is required (e.g., @GET, @POST, etc.).", new Object[0]);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-08-04 22:02:59 +00:00
|
|
|
public abstract T a(Object[] objArr);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|