140 lines
4.4 KiB
Java
140 lines
4.4 KiB
Java
package okhttp3;
|
|
|
|
import java.nio.charset.Charset;
|
|
import java.nio.charset.StandardCharsets;
|
|
import java.util.Collections;
|
|
import java.util.LinkedHashMap;
|
|
import java.util.Locale;
|
|
import java.util.Map;
|
|
import o.C14957gcv;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class Challenge {
|
|
private final Map<String, String> authParams;
|
|
private final String scheme;
|
|
|
|
public Challenge(String str, Map<String, String> map) {
|
|
String lowerCase;
|
|
C14957gcv.e(str, "");
|
|
C14957gcv.e(map, "");
|
|
this.scheme = str;
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap();
|
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
|
String key = entry.getKey();
|
|
String value = entry.getValue();
|
|
if (key == null) {
|
|
lowerCase = null;
|
|
} else {
|
|
Locale locale = Locale.US;
|
|
C14957gcv.c(locale, "");
|
|
lowerCase = key.toLowerCase(locale);
|
|
C14957gcv.c((Object) lowerCase, "");
|
|
}
|
|
linkedHashMap.put(lowerCase, value);
|
|
}
|
|
Map<String, String> unmodifiableMap = Collections.unmodifiableMap(linkedHashMap);
|
|
C14957gcv.c(unmodifiableMap, "");
|
|
this.authParams = unmodifiableMap;
|
|
}
|
|
|
|
public final String realm() {
|
|
return this.authParams.get("realm");
|
|
}
|
|
|
|
public final Charset charset() {
|
|
String str = this.authParams.get("charset");
|
|
if (str != null) {
|
|
try {
|
|
Charset forName = Charset.forName(str);
|
|
C14957gcv.c(forName, "");
|
|
return forName;
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
Charset charset = StandardCharsets.ISO_8859_1;
|
|
C14957gcv.c(charset, "");
|
|
return charset;
|
|
}
|
|
|
|
/* JADX WARN: Illegal instructions before constructor call */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public Challenge(java.lang.String r3, java.lang.String r4) {
|
|
/*
|
|
r2 = this;
|
|
java.lang.String r0 = ""
|
|
o.C14957gcv.e(r3, r0)
|
|
o.C14957gcv.e(r4, r0)
|
|
java.lang.String r1 = "realm"
|
|
java.util.Map r4 = java.util.Collections.singletonMap(r1, r4)
|
|
o.C14957gcv.c(r4, r0)
|
|
r2.<init>(r3, r4)
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: okhttp3.Challenge.<init>(java.lang.String, java.lang.String):void");
|
|
}
|
|
|
|
public final Challenge withCharset(Charset charset) {
|
|
C14957gcv.e(charset, "");
|
|
Map<String, String> map = this.authParams;
|
|
C14957gcv.e(map, "");
|
|
LinkedHashMap linkedHashMap = new LinkedHashMap(map);
|
|
String name = charset.name();
|
|
C14957gcv.c((Object) name, "");
|
|
linkedHashMap.put("charset", name);
|
|
return new Challenge(this.scheme, linkedHashMap);
|
|
}
|
|
|
|
/* renamed from: -deprecated_realm, reason: not valid java name */
|
|
public final String m381deprecated_realm() {
|
|
return realm();
|
|
}
|
|
|
|
/* renamed from: -deprecated_charset, reason: not valid java name */
|
|
public final Charset m380deprecated_charset() {
|
|
return charset();
|
|
}
|
|
|
|
public final boolean equals(Object obj) {
|
|
if (obj instanceof Challenge) {
|
|
Challenge challenge = (Challenge) obj;
|
|
if (C14957gcv.b((Object) challenge.scheme, (Object) this.scheme) && C14957gcv.b(challenge.authParams, this.authParams)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public final int hashCode() {
|
|
return ((this.scheme.hashCode() + 899) * 31) + this.authParams.hashCode();
|
|
}
|
|
|
|
public final String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.scheme);
|
|
sb.append(" authParams=");
|
|
sb.append(this.authParams);
|
|
return sb.toString();
|
|
}
|
|
|
|
public final String scheme() {
|
|
return this.scheme;
|
|
}
|
|
|
|
public final Map<String, String> authParams() {
|
|
return this.authParams;
|
|
}
|
|
|
|
/* renamed from: -deprecated_scheme, reason: not valid java name */
|
|
public final String m382deprecated_scheme() {
|
|
return this.scheme;
|
|
}
|
|
|
|
/* renamed from: -deprecated_authParams, reason: not valid java name */
|
|
public final Map<String, String> m379deprecated_authParams() {
|
|
return this.authParams;
|
|
}
|
|
}
|