Rabbit-R1/switch port/smali/smali_classes3/okhttp3/internal/http/HttpHeaders.smali
2024-05-21 17:08:36 -04:00

881 lines
20 KiB
Smali

.class public final Lokhttp3/internal/http/HttpHeaders;
.super Ljava/lang/Object;
.source "HttpHeaders.kt"
# annotations
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u0000R\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010 \n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0002\u0008\u0002\n\u0002\u0010\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010!\n\u0002\u0008\u0003\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0004\n\u0002\u0010\u0005\n\u0000\u001a\u0010\u0010\u0003\u001a\u00020\u00042\u0006\u0010\u0005\u001a\u00020\u0006H\u0007\u001a\u0018\u0010\u0007\u001a\u0008\u0012\u0004\u0012\u00020\t0\u0008*\u00020\n2\u0006\u0010\u000b\u001a\u00020\u000c\u001a\n\u0010\r\u001a\u00020\u0004*\u00020\u0006\u001a\u001a\u0010\u000e\u001a\u00020\u000f*\u00020\u00102\u000c\u0010\u0011\u001a\u0008\u0012\u0004\u0012\u00020\t0\u0012H\u0002\u001a\u000e\u0010\u0013\u001a\u0004\u0018\u00010\u000c*\u00020\u0010H\u0002\u001a\u000e\u0010\u0014\u001a\u0004\u0018\u00010\u000c*\u00020\u0010H\u0002\u001a\u001a\u0010\u0015\u001a\u00020\u000f*\u00020\u00162\u0006\u0010\u0017\u001a\u00020\u00182\u0006\u0010\u0019\u001a\u00020\n\u001a\u000c\u0010\u001a\u001a\u00020\u0004*\u00020\u0010H\u0002\u001a\u0014\u0010\u001b\u001a\u00020\u0004*\u00020\u00102\u0006\u0010\u001c\u001a\u00020\u001dH\u0002\"\u000e\u0010\u0000\u001a\u00020\u0001X\u0082\u0004\u00a2\u0006\u0002\n\u0000\"\u000e\u0010\u0002\u001a\u00020\u0001X\u0082\u0004\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u001e"
}
d2 = {
"QUOTED_STRING_DELIMITERS",
"Lokio/ByteString;",
"TOKEN_DELIMITERS",
"hasBody",
"",
"response",
"Lokhttp3/Response;",
"parseChallenges",
"",
"Lokhttp3/Challenge;",
"Lokhttp3/Headers;",
"headerName",
"",
"promisesBody",
"readChallengeHeader",
"",
"Lokio/Buffer;",
"result",
"",
"readQuotedString",
"readToken",
"receiveHeaders",
"Lokhttp3/CookieJar;",
"url",
"Lokhttp3/HttpUrl;",
"headers",
"skipCommasAndWhitespace",
"startsWith",
"prefix",
"",
"okhttp"
}
k = 0x2
mv = {
0x1,
0x4,
0x0
}
.end annotation
# static fields
.field private static final QUOTED_STRING_DELIMITERS:Lokio/ByteString;
.field private static final TOKEN_DELIMITERS:Lokio/ByteString;
# direct methods
.method static constructor <clinit>()V
.locals 2
.line 37
sget-object v0, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
const-string v1, "\"\\"
invoke-virtual {v0, v1}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http/HttpHeaders;->QUOTED_STRING_DELIMITERS:Lokio/ByteString;
.line 38
sget-object v0, Lokio/ByteString;->Companion:Lokio/ByteString$Companion;
const-string v1, "\t ,="
invoke-virtual {v0, v1}, Lokio/ByteString$Companion;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/http/HttpHeaders;->TOKEN_DELIMITERS:Lokio/ByteString;
return-void
.end method
.method public static final hasBody(Lokhttp3/Response;)Z
.locals 1
.annotation runtime Lkotlin/Deprecated;
level = .enum Lkotlin/DeprecationLevel;->ERROR:Lkotlin/DeprecationLevel;
message = "No longer supported"
replaceWith = .subannotation Lkotlin/ReplaceWith;
expression = "response.promisesBody()"
imports = {}
.end subannotation
.end annotation
const-string v0, "response"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 242
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->promisesBody(Lokhttp3/Response;)Z
move-result p0
return p0
.end method
.method public static final parseChallenges(Lokhttp3/Headers;Ljava/lang/String;)Ljava/util/List;
.locals 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lokhttp3/Headers;",
"Ljava/lang/String;",
")",
"Ljava/util/List<",
"Lokhttp3/Challenge;",
">;"
}
.end annotation
const-string v0, "$this$parseChallenges"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "headerName"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 60
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
check-cast v0, Ljava/util/List;
.line 61
invoke-virtual {p0}, Lokhttp3/Headers;->size()I
move-result v1
const/4 v2, 0x0
:goto_0
if-ge v2, v1, :cond_1
.line 62
invoke-virtual {p0, v2}, Lokhttp3/Headers;->name(I)Ljava/lang/String;
move-result-object v3
const/4 v4, 0x1
invoke-static {p1, v3, v4}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
move-result v3
if-eqz v3, :cond_0
.line 63
new-instance v3, Lokio/Buffer;
invoke-direct {v3}, Lokio/Buffer;-><init>()V
invoke-virtual {p0, v2}, Lokhttp3/Headers;->value(I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Lokio/Buffer;->writeUtf8(Ljava/lang/String;)Lokio/Buffer;
move-result-object v3
.line 65
:try_start_0
invoke-static {v3, v0}, Lokhttp3/internal/http/HttpHeaders;->readChallengeHeader(Lokio/Buffer;Ljava/util/List;)V
:try_end_0
.catch Ljava/io/EOFException; {:try_start_0 .. :try_end_0} :catch_0
goto :goto_1
:catch_0
move-exception v3
.line 67
sget-object v4, Lokhttp3/internal/platform/Platform;->Companion:Lokhttp3/internal/platform/Platform$Companion;
invoke-virtual {v4}, Lokhttp3/internal/platform/Platform$Companion;->get()Lokhttp3/internal/platform/Platform;
move-result-object v4
const/4 v5, 0x5
check-cast v3, Ljava/lang/Throwable;
const-string v6, "Unable to parse challenge"
invoke-virtual {v4, v6, v5, v3}, Lokhttp3/internal/platform/Platform;->log(Ljava/lang/String;ILjava/lang/Throwable;)V
:cond_0
:goto_1
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_1
return-object v0
.end method
.method public static final promisesBody(Lokhttp3/Response;)Z
.locals 8
const-string v0, "$this$promisesBody"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 216
invoke-virtual {p0}, Lokhttp3/Response;->request()Lokhttp3/Request;
move-result-object v0
invoke-virtual {v0}, Lokhttp3/Request;->method()Ljava/lang/String;
move-result-object v0
const-string v1, "HEAD"
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_0
return v1
.line 220
:cond_0
invoke-virtual {p0}, Lokhttp3/Response;->code()I
move-result v0
const/16 v2, 0x64
const/4 v3, 0x1
if-lt v0, v2, :cond_1
const/16 v2, 0xc8
if-lt v0, v2, :cond_2
:cond_1
const/16 v2, 0xcc
if-eq v0, v2, :cond_2
const/16 v2, 0x130
if-eq v0, v2, :cond_2
return v3
.line 229
:cond_2
invoke-static {p0}, Lokhttp3/internal/Util;->headersContentLength(Lokhttp3/Response;)J
move-result-wide v4
const-wide/16 v6, -0x1
cmp-long v0, v4, v6
if-nez v0, :cond_4
const-string v0, "Transfer-Encoding"
const/4 v2, 0x2
const/4 v4, 0x0
.line 230
invoke-static {p0, v0, v4, v2, v4}, Lokhttp3/Response;->header$default(Lokhttp3/Response;Ljava/lang/String;Ljava/lang/String;ILjava/lang/Object;)Ljava/lang/String;
move-result-object p0
const-string v0, "chunked"
invoke-static {v0, p0, v3}, Lkotlin/text/StringsKt;->equals(Ljava/lang/String;Ljava/lang/String;Z)Z
move-result p0
if-eqz p0, :cond_3
goto :goto_0
:cond_3
return v1
:cond_4
:goto_0
return v3
.end method
.method private static final readChallengeHeader(Lokio/Buffer;Ljava/util/List;)V
.locals 7
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lokio/Buffer;",
"Ljava/util/List<",
"Lokhttp3/Challenge;",
">;)V"
}
.end annotation
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/EOFException;
}
.end annotation
const/4 v0, 0x0
.line 76
move-object v1, v0
check-cast v1, Ljava/lang/String;
:goto_0
move-object v1, v0
:goto_1
if-nez v1, :cond_0
.line 81
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->skipCommasAndWhitespace(Lokio/Buffer;)Z
.line 82
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->readToken(Lokio/Buffer;)Ljava/lang/String;
move-result-object v1
if-nez v1, :cond_0
return-void
.line 89
:cond_0
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->skipCommasAndWhitespace(Lokio/Buffer;)Z
move-result v2
.line 90
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->readToken(Lokio/Buffer;)Ljava/lang/String;
move-result-object v3
if-nez v3, :cond_2
.line 92
invoke-virtual {p0}, Lokio/Buffer;->exhausted()Z
move-result p0
if-nez p0, :cond_1
return-void
.line 93
:cond_1
new-instance p0, Lokhttp3/Challenge;
invoke-static {}, Lkotlin/collections/MapsKt;->emptyMap()Ljava/util/Map;
move-result-object v0
invoke-direct {p0, v1, v0}, Lokhttp3/Challenge;-><init>(Ljava/lang/String;Ljava/util/Map;)V
invoke-interface {p1, p0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
return-void
:cond_2
const/16 v4, 0x3d
int-to-byte v4, v4
.line 97
invoke-static {p0, v4}, Lokhttp3/internal/Util;->skipAll(Lokio/Buffer;B)I
move-result v5
.line 98
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->skipCommasAndWhitespace(Lokio/Buffer;)Z
move-result v6
if-nez v2, :cond_4
if-nez v6, :cond_3
.line 101
invoke-virtual {p0}, Lokio/Buffer;->exhausted()Z
move-result v2
if-eqz v2, :cond_4
.line 102
:cond_3
new-instance v2, Lokhttp3/Challenge;
.line 103
new-instance v4, Ljava/lang/StringBuilder;
invoke-direct {v4}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v4, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
const-string v4, "="
check-cast v4, Ljava/lang/CharSequence;
invoke-static {v4, v5}, Lkotlin/text/StringsKt;->repeat(Ljava/lang/CharSequence;I)Ljava/lang/String;
move-result-object v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v0, v3}, Ljava/util/Collections;->singletonMap(Ljava/lang/Object;Ljava/lang/Object;)Ljava/util/Map;
move-result-object v3
const-string v4, "Collections.singletonMap\u2026ek + \"=\".repeat(eqCount))"
invoke-static {v3, v4}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
.line 102
invoke-direct {v2, v1, v3}, Lokhttp3/Challenge;-><init>(Ljava/lang/String;Ljava/util/Map;)V
invoke-interface {p1, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
goto :goto_0
.line 109
:cond_4
new-instance v2, Ljava/util/LinkedHashMap;
invoke-direct {v2}, Ljava/util/LinkedHashMap;-><init>()V
check-cast v2, Ljava/util/Map;
.line 110
invoke-static {p0, v4}, Lokhttp3/internal/Util;->skipAll(Lokio/Buffer;B)I
move-result v6
add-int/2addr v5, v6
:goto_2
if-nez v3, :cond_6
.line 113
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->readToken(Lokio/Buffer;)Ljava/lang/String;
move-result-object v3
.line 114
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->skipCommasAndWhitespace(Lokio/Buffer;)Z
move-result v5
if-eqz v5, :cond_5
goto :goto_3
.line 115
:cond_5
invoke-static {p0, v4}, Lokhttp3/internal/Util;->skipAll(Lokio/Buffer;B)I
move-result v5
:cond_6
if-nez v5, :cond_7
.line 131
:goto_3
new-instance v4, Lokhttp3/Challenge;
invoke-direct {v4, v1, v2}, Lokhttp3/Challenge;-><init>(Ljava/lang/String;Ljava/util/Map;)V
invoke-interface {p1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
move-object v1, v3
goto/16 :goto_1
:cond_7
const/4 v6, 0x1
if-le v5, v6, :cond_8
return-void
.line 119
:cond_8
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->skipCommasAndWhitespace(Lokio/Buffer;)Z
move-result v6
if-eqz v6, :cond_9
return-void
:cond_9
const/16 v6, 0x22
int-to-byte v6, v6
.line 122
invoke-static {p0, v6}, Lokhttp3/internal/http/HttpHeaders;->startsWith(Lokio/Buffer;B)Z
move-result v6
if-eqz v6, :cond_a
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->readQuotedString(Lokio/Buffer;)Ljava/lang/String;
move-result-object v6
goto :goto_4
.line 123
:cond_a
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->readToken(Lokio/Buffer;)Ljava/lang/String;
move-result-object v6
:goto_4
if-eqz v6, :cond_d
.line 126
invoke-interface {v2, v3, v6}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v3
check-cast v3, Ljava/lang/String;
if-eqz v3, :cond_b
return-void
.line 129
:cond_b
invoke-static {p0}, Lokhttp3/internal/http/HttpHeaders;->skipCommasAndWhitespace(Lokio/Buffer;)Z
move-result v3
if-nez v3, :cond_c
invoke-virtual {p0}, Lokio/Buffer;->exhausted()Z
move-result v3
if-nez v3, :cond_c
return-void
:cond_c
move-object v3, v0
goto :goto_2
:cond_d
return-void
.end method
.method private static final readQuotedString(Lokio/Buffer;)Ljava/lang/String;
.locals 12
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/EOFException;
}
.end annotation
.line 166
invoke-virtual {p0}, Lokio/Buffer;->readByte()B
move-result v0
const/16 v1, 0x22
int-to-byte v1, v1
if-ne v0, v1, :cond_0
const/4 v0, 0x1
goto :goto_0
:cond_0
const/4 v0, 0x0
:goto_0
if-eqz v0, :cond_4
.line 167
new-instance v0, Lokio/Buffer;
invoke-direct {v0}, Lokio/Buffer;-><init>()V
:goto_1
sget-object v2, Lokhttp3/internal/http/HttpHeaders;->QUOTED_STRING_DELIMITERS:Lokio/ByteString;
.line 169
invoke-virtual {p0, v2}, Lokio/Buffer;->indexOfElement(Lokio/ByteString;)J
move-result-wide v2
const-wide/16 v4, -0x1
cmp-long v4, v2, v4
const/4 v5, 0x0
if-nez v4, :cond_1
return-object v5
.line 172
:cond_1
invoke-virtual {p0, v2, v3}, Lokio/Buffer;->getByte(J)B
move-result v4
if-ne v4, v1, :cond_2
.line 173
invoke-virtual {v0, p0, v2, v3}, Lokio/Buffer;->write(Lokio/Buffer;J)V
.line 175
invoke-virtual {p0}, Lokio/Buffer;->readByte()B
.line 176
invoke-virtual {v0}, Lokio/Buffer;->readUtf8()Ljava/lang/String;
move-result-object p0
return-object p0
.line 179
:cond_2
invoke-virtual {p0}, Lokio/Buffer;->size()J
move-result-wide v6
const-wide/16 v8, 0x1
add-long v10, v2, v8
cmp-long v4, v6, v10
if-nez v4, :cond_3
return-object v5
.line 180
:cond_3
invoke-virtual {v0, p0, v2, v3}, Lokio/Buffer;->write(Lokio/Buffer;J)V
.line 182
invoke-virtual {p0}, Lokio/Buffer;->readByte()B
.line 183
invoke-virtual {v0, p0, v8, v9}, Lokio/Buffer;->write(Lokio/Buffer;J)V
goto :goto_1
.line 166
:cond_4
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "Failed requirement."
invoke-virtual {v0}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object v0
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method
.method private static final readToken(Lokio/Buffer;)Ljava/lang/String;
.locals 4
sget-object v0, Lokhttp3/internal/http/HttpHeaders;->TOKEN_DELIMITERS:Lokio/ByteString;
.line 192
invoke-virtual {p0, v0}, Lokio/Buffer;->indexOfElement(Lokio/ByteString;)J
move-result-wide v0
const-wide/16 v2, -0x1
cmp-long v2, v0, v2
if-nez v2, :cond_0
.line 193
invoke-virtual {p0}, Lokio/Buffer;->size()J
move-result-wide v0
:cond_0
const-wide/16 v2, 0x0
cmp-long v2, v0, v2
if-eqz v2, :cond_1
.line 196
invoke-virtual {p0, v0, v1}, Lokio/Buffer;->readUtf8(J)Ljava/lang/String;
move-result-object p0
goto :goto_0
:cond_1
const/4 p0, 0x0
:goto_0
return-object p0
.end method
.method public static final receiveHeaders(Lokhttp3/CookieJar;Lokhttp3/HttpUrl;Lokhttp3/Headers;)V
.locals 1
const-string v0, "$this$receiveHeaders"
invoke-static {p0, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "url"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "headers"
invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 202
sget-object v0, Lokhttp3/CookieJar;->NO_COOKIES:Lokhttp3/CookieJar;
if-ne p0, v0, :cond_0
return-void
.line 204
:cond_0
sget-object v0, Lokhttp3/Cookie;->Companion:Lokhttp3/Cookie$Companion;
invoke-virtual {v0, p1, p2}, Lokhttp3/Cookie$Companion;->parseAll(Lokhttp3/HttpUrl;Lokhttp3/Headers;)Ljava/util/List;
move-result-object p2
.line 205
invoke-interface {p2}, Ljava/util/List;->isEmpty()Z
move-result v0
if-eqz v0, :cond_1
return-void
.line 207
:cond_1
invoke-interface {p0, p1, p2}, Lokhttp3/CookieJar;->saveFromResponse(Lokhttp3/HttpUrl;Ljava/util/List;)V
return-void
.end method
.method private static final skipCommasAndWhitespace(Lokio/Buffer;)Z
.locals 3
const/4 v0, 0x0
.line 138
:goto_0
invoke-virtual {p0}, Lokio/Buffer;->exhausted()Z
move-result v1
if-nez v1, :cond_2
const-wide/16 v1, 0x0
.line 139
invoke-virtual {p0, v1, v2}, Lokio/Buffer;->getByte(J)B
move-result v1
const/16 v2, 0x9
if-eq v1, v2, :cond_1
const/16 v2, 0x20
if-eq v1, v2, :cond_1
const/16 v2, 0x2c
if-eq v1, v2, :cond_0
goto :goto_1
.line 142
:cond_0
invoke-virtual {p0}, Lokio/Buffer;->readByte()B
const/4 v0, 0x1
goto :goto_0
.line 147
:cond_1
invoke-virtual {p0}, Lokio/Buffer;->readByte()B
goto :goto_0
:cond_2
:goto_1
return v0
.end method
.method private static final startsWith(Lokio/Buffer;B)Z
.locals 2
.line 157
invoke-virtual {p0}, Lokio/Buffer;->exhausted()Z
move-result v0
if-nez v0, :cond_0
const-wide/16 v0, 0x0
invoke-virtual {p0, v0, v1}, Lokio/Buffer;->getByte(J)B
move-result p0
if-ne p0, p1, :cond_0
const/4 p0, 0x1
goto :goto_0
:cond_0
const/4 p0, 0x0
:goto_0
return p0
.end method