523 lines
19 KiB
Java
523 lines
19 KiB
Java
package i0;
|
|
|
|
import java.io.IOException;
|
|
import java.lang.reflect.Method;
|
|
import java.util.Map;
|
|
import java.util.Objects;
|
|
import okhttp3.Headers;
|
|
import okhttp3.MultipartBody;
|
|
import okhttp3.RequestBody;
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public abstract class t<T> {
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class a<T> extends t<T> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3738b;
|
|
public final h<T, RequestBody> c;
|
|
|
|
public a(Method method, int i, h<T, RequestBody> hVar) {
|
|
this.a = method;
|
|
this.f3738b = i;
|
|
this.c = hVar;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) {
|
|
if (t != null) {
|
|
try {
|
|
vVar.m = this.c.convert(t);
|
|
} catch (IOException e) {
|
|
Method method = this.a;
|
|
int i = this.f3738b;
|
|
throw c0.m(method, e, i, "Unable to convert " + t + " to RequestBody", new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3738b, "Body parameter value must not be null.", new Object[0]);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class b<T> extends t<T> {
|
|
public final String a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final h<T, String> f3739b;
|
|
public final boolean c;
|
|
|
|
public b(String str, h<T, String> hVar, boolean z2) {
|
|
Objects.requireNonNull(str, "name == null");
|
|
this.a = str;
|
|
this.f3739b = hVar;
|
|
this.c = z2;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) throws IOException {
|
|
String convert;
|
|
if (t != null && (convert = this.f3739b.convert(t)) != null) {
|
|
vVar.a(this.a, convert, this.c);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class c<T> extends t<Map<String, T>> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3740b;
|
|
public final h<T, String> c;
|
|
public final boolean d;
|
|
|
|
public c(Method method, int i, h<T, String> hVar, boolean z2) {
|
|
this.a = method;
|
|
this.f3740b = i;
|
|
this.c = hVar;
|
|
this.d = z2;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // i0.t
|
|
public void a(v vVar, Object obj) throws IOException {
|
|
Map map = (Map) obj;
|
|
if (map != null) {
|
|
for (Map.Entry entry : map.entrySet()) {
|
|
String str = (String) entry.getKey();
|
|
if (str != null) {
|
|
Object value = entry.getValue();
|
|
if (value != null) {
|
|
String str2 = (String) this.c.convert(value);
|
|
if (str2 != null) {
|
|
vVar.a(str, str2, this.d);
|
|
} else {
|
|
Method method = this.a;
|
|
int i = this.f3740b;
|
|
throw c0.l(method, i, "Field map value '" + value + "' converted to null by " + this.c.getClass().getName() + " for key '" + str + "'.", new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3740b, b.d.b.a.a.w("Field map contained null value for key '", str, "'."), new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3740b, "Field map contained null key.", new Object[0]);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
throw c0.l(this.a, this.f3740b, "Field map was null.", new Object[0]);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class d<T> extends t<T> {
|
|
public final String a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final h<T, String> f3741b;
|
|
|
|
public d(String str, h<T, String> hVar) {
|
|
Objects.requireNonNull(str, "name == null");
|
|
this.a = str;
|
|
this.f3741b = hVar;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) throws IOException {
|
|
String convert;
|
|
if (t != null && (convert = this.f3741b.convert(t)) != null) {
|
|
vVar.b(this.a, convert);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class e<T> extends t<Map<String, T>> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3742b;
|
|
public final h<T, String> c;
|
|
|
|
public e(Method method, int i, h<T, String> hVar) {
|
|
this.a = method;
|
|
this.f3742b = i;
|
|
this.c = hVar;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // i0.t
|
|
public void a(v vVar, Object obj) throws IOException {
|
|
Map map = (Map) obj;
|
|
if (map != null) {
|
|
for (Map.Entry entry : map.entrySet()) {
|
|
String str = (String) entry.getKey();
|
|
if (str != null) {
|
|
Object value = entry.getValue();
|
|
if (value != null) {
|
|
vVar.b(str, (String) this.c.convert(value));
|
|
} else {
|
|
throw c0.l(this.a, this.f3742b, b.d.b.a.a.w("Header map contained null value for key '", str, "'."), new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3742b, "Header map contained null key.", new Object[0]);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
throw c0.l(this.a, this.f3742b, "Header map was null.", new Object[0]);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class f extends t<Headers> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3743b;
|
|
|
|
public f(Method method, int i) {
|
|
this.a = method;
|
|
this.f3743b = i;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, Headers headers) throws IOException {
|
|
Headers headers2 = headers;
|
|
if (headers2 != null) {
|
|
Headers.a aVar = vVar.h;
|
|
Objects.requireNonNull(aVar);
|
|
d0.z.d.m.checkParameterIsNotNull(headers2, "headers");
|
|
int size = headers2.size();
|
|
for (int i = 0; i < size; i++) {
|
|
aVar.b(headers2.d(i), headers2.g(i));
|
|
}
|
|
return;
|
|
}
|
|
throw c0.l(this.a, this.f3743b, "Headers parameter must not be null.", new Object[0]);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class g<T> extends t<T> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3744b;
|
|
public final Headers c;
|
|
public final h<T, RequestBody> d;
|
|
|
|
public g(Method method, int i, Headers headers, h<T, RequestBody> hVar) {
|
|
this.a = method;
|
|
this.f3744b = i;
|
|
this.c = headers;
|
|
this.d = hVar;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) {
|
|
if (t != null) {
|
|
try {
|
|
vVar.c(this.c, this.d.convert(t));
|
|
} catch (IOException e) {
|
|
Method method = this.a;
|
|
int i = this.f3744b;
|
|
throw c0.l(method, i, "Unable to convert " + t + " to RequestBody", e);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class h<T> extends t<Map<String, T>> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3745b;
|
|
public final h<T, RequestBody> c;
|
|
public final String d;
|
|
|
|
public h(Method method, int i, h<T, RequestBody> hVar, String str) {
|
|
this.a = method;
|
|
this.f3745b = i;
|
|
this.c = hVar;
|
|
this.d = str;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // i0.t
|
|
public void a(v vVar, Object obj) throws IOException {
|
|
Map map = (Map) obj;
|
|
if (map != null) {
|
|
for (Map.Entry entry : map.entrySet()) {
|
|
String str = (String) entry.getKey();
|
|
if (str != null) {
|
|
Object value = entry.getValue();
|
|
if (value != null) {
|
|
vVar.c(Headers.j.c("Content-Disposition", b.d.b.a.a.w("form-data; name=\"", str, "\""), "Content-Transfer-Encoding", this.d), (RequestBody) this.c.convert(value));
|
|
} else {
|
|
throw c0.l(this.a, this.f3745b, b.d.b.a.a.w("Part map contained null value for key '", str, "'."), new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3745b, "Part map contained null key.", new Object[0]);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
throw c0.l(this.a, this.f3745b, "Part map was null.", new Object[0]);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class i<T> extends t<T> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3746b;
|
|
public final String c;
|
|
public final h<T, String> d;
|
|
public final boolean e;
|
|
|
|
public i(Method method, int i, String str, h<T, String> hVar, boolean z2) {
|
|
this.a = method;
|
|
this.f3746b = i;
|
|
Objects.requireNonNull(str, "name == null");
|
|
this.c = str;
|
|
this.d = hVar;
|
|
this.e = z2;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:49:0x00e5 */
|
|
/* JADX WARN: Removed duplicated region for block: B:51:0x00e8 */
|
|
@Override // i0.t
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void a(v vVar, T t) throws IOException {
|
|
String str;
|
|
String replace;
|
|
if (t != null) {
|
|
String str2 = this.c;
|
|
String convert = this.d.convert(t);
|
|
boolean z2 = this.e;
|
|
if (vVar.e != null) {
|
|
int length = convert.length();
|
|
int i = 0;
|
|
while (i < length) {
|
|
int codePointAt = convert.codePointAt(i);
|
|
int i2 = 47;
|
|
int i3 = -1;
|
|
if (codePointAt < 32 || codePointAt >= 127 || " \"<>^`{}|\\?#".indexOf(codePointAt) != -1 || (!z2 && (codePointAt == 47 || codePointAt == 37))) {
|
|
g0.e eVar = new g0.e();
|
|
eVar.c0(convert, 0, i);
|
|
g0.e eVar2 = null;
|
|
while (i < length) {
|
|
int codePointAt2 = convert.codePointAt(i);
|
|
if (!z2 || !(codePointAt2 == 9 || codePointAt2 == 10 || codePointAt2 == 12 || codePointAt2 == 13)) {
|
|
if (codePointAt2 < 32 || codePointAt2 >= 127 || " \"<>^`{}|\\?#".indexOf(codePointAt2) != i3 || (!z2 && (codePointAt2 == i2 || codePointAt2 == 37))) {
|
|
if (eVar2 == null) {
|
|
eVar2 = new g0.e();
|
|
}
|
|
eVar2.d0(codePointAt2);
|
|
while (!eVar2.w()) {
|
|
int readByte = eVar2.readByte() & 255;
|
|
eVar.T(37);
|
|
char[] cArr = v.a;
|
|
eVar.T(cArr[(readByte >> 4) & 15]);
|
|
eVar.T(cArr[readByte & 15]);
|
|
}
|
|
} else {
|
|
eVar.d0(codePointAt2);
|
|
}
|
|
}
|
|
i += Character.charCount(codePointAt2);
|
|
i2 = 47;
|
|
i3 = -1;
|
|
}
|
|
str = eVar.D();
|
|
String str3 = vVar.e;
|
|
replace = str3.replace("{" + str2 + "}", str);
|
|
if (v.f3752b.matcher(replace).matches()) {
|
|
vVar.e = replace;
|
|
return;
|
|
}
|
|
throw new IllegalArgumentException(b.d.b.a.a.v("@Path parameters shouldn't perform path traversal ('.' or '..'): ", convert));
|
|
}
|
|
i += Character.charCount(codePointAt);
|
|
}
|
|
str = convert;
|
|
String str32 = vVar.e;
|
|
replace = str32.replace("{" + str2 + "}", str);
|
|
if (v.f3752b.matcher(replace).matches()) {
|
|
}
|
|
} else {
|
|
throw new AssertionError();
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3746b, b.d.b.a.a.H(b.d.b.a.a.R("Path parameter \""), this.c, "\" value must not be null."), new Object[0]);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class j<T> extends t<T> {
|
|
public final String a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final h<T, String> f3747b;
|
|
public final boolean c;
|
|
|
|
public j(String str, h<T, String> hVar, boolean z2) {
|
|
Objects.requireNonNull(str, "name == null");
|
|
this.a = str;
|
|
this.f3747b = hVar;
|
|
this.c = z2;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) throws IOException {
|
|
String convert;
|
|
if (t != null && (convert = this.f3747b.convert(t)) != null) {
|
|
vVar.d(this.a, convert, this.c);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class k<T> extends t<Map<String, T>> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3748b;
|
|
public final h<T, String> c;
|
|
public final boolean d;
|
|
|
|
public k(Method method, int i, h<T, String> hVar, boolean z2) {
|
|
this.a = method;
|
|
this.f3748b = i;
|
|
this.c = hVar;
|
|
this.d = z2;
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@Override // i0.t
|
|
public void a(v vVar, Object obj) throws IOException {
|
|
Map map = (Map) obj;
|
|
if (map != null) {
|
|
for (Map.Entry entry : map.entrySet()) {
|
|
String str = (String) entry.getKey();
|
|
if (str != null) {
|
|
Object value = entry.getValue();
|
|
if (value != null) {
|
|
String str2 = (String) this.c.convert(value);
|
|
if (str2 != null) {
|
|
vVar.d(str, str2, this.d);
|
|
} else {
|
|
Method method = this.a;
|
|
int i = this.f3748b;
|
|
throw c0.l(method, i, "Query map value '" + value + "' converted to null by " + this.c.getClass().getName() + " for key '" + str + "'.", new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3748b, b.d.b.a.a.w("Query map contained null value for key '", str, "'."), new Object[0]);
|
|
}
|
|
} else {
|
|
throw c0.l(this.a, this.f3748b, "Query map contained null key.", new Object[0]);
|
|
}
|
|
}
|
|
return;
|
|
}
|
|
throw c0.l(this.a, this.f3748b, "Query map was null", new Object[0]);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class l<T> extends t<T> {
|
|
public final h<T, String> a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final boolean f3749b;
|
|
|
|
public l(h<T, String> hVar, boolean z2) {
|
|
this.a = hVar;
|
|
this.f3749b = z2;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) throws IOException {
|
|
if (t != null) {
|
|
vVar.d(this.a.convert(t), null, this.f3749b);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class m extends t<MultipartBody.Part> {
|
|
public static final m a = new m();
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, MultipartBody.Part part) throws IOException {
|
|
MultipartBody.Part part2 = part;
|
|
if (part2 != null) {
|
|
vVar.k.a(part2);
|
|
}
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class n extends t<Object> {
|
|
public final Method a;
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
|
public final int f3750b;
|
|
|
|
public n(Method method, int i) {
|
|
this.a = method;
|
|
this.f3750b = i;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, Object obj) {
|
|
if (obj != null) {
|
|
Objects.requireNonNull(vVar);
|
|
vVar.e = obj.toString();
|
|
return;
|
|
}
|
|
throw c0.l(this.a, this.f3750b, "@Url parameter is null.", new Object[0]);
|
|
}
|
|
}
|
|
|
|
/* compiled from: ParameterHandler.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class o<T> extends t<T> {
|
|
public final Class<T> a;
|
|
|
|
public o(Class<T> cls) {
|
|
this.a = cls;
|
|
}
|
|
|
|
@Override // i0.t
|
|
public void a(v vVar, T t) {
|
|
vVar.g.e(this.a, t);
|
|
}
|
|
}
|
|
|
|
public abstract void a(v vVar, T t) throws IOException;
|
|
}
|