apkfuckery/com.discord/smali_classes2/okhttp3/internal/c/e.smali
2019-07-27 02:12:07 +02:00

278 lines
4.8 KiB
Smali

.class public final Lokhttp3/internal/c/e;
.super Ljava/lang/Object;
.source "HttpHeaders.java"
# static fields
.field private static final bwQ:Lokio/ByteString;
.field private static final bwR:Lokio/ByteString;
# direct methods
.method static constructor <clinit>()V
.locals 1
const-string v0, "\"\\"
invoke-static {v0}, Lokio/ByteString;->eH(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/c/e;->bwQ:Lokio/ByteString;
const-string v0, "\t ,="
invoke-static {v0}, Lokio/ByteString;->eH(Ljava/lang/String;)Lokio/ByteString;
move-result-object v0
sput-object v0, Lokhttp3/internal/c/e;->bwR:Lokio/ByteString;
return-void
.end method
.method public static a(Lokhttp3/m;Lokhttp3/s;Lokhttp3/Headers;)V
.locals 1
sget-object v0, Lokhttp3/m;->bta:Lokhttp3/m;
if-ne p0, v0, :cond_0
return-void
:cond_0
invoke-static {p1, p2}, Lokhttp3/l;->a(Lokhttp3/s;Lokhttp3/Headers;)Ljava/util/List;
move-result-object p1
invoke-interface {p1}, Ljava/util/List;->isEmpty()Z
move-result p2
if-eqz p2, :cond_1
return-void
:cond_1
invoke-interface {p0, p1}, Lokhttp3/m;->o(Ljava/util/List;)V
return-void
.end method
.method public static c(Ljava/lang/String;ILjava/lang/String;)I
.locals 2
:goto_0
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v0
if-ge p1, v0, :cond_0
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
move-result v0
invoke-virtual {p2, v0}, Ljava/lang/String;->indexOf(I)I
move-result v0
const/4 v1, -0x1
if-ne v0, v1, :cond_0
add-int/lit8 p1, p1, 0x1
goto :goto_0
:cond_0
return p1
.end method
.method public static e(Lokhttp3/Response;)J
.locals 2
iget-object p0, p0, Lokhttp3/Response;->btX:Lokhttp3/Headers;
const-string v0, "Content-Length"
invoke-virtual {p0, v0}, Lokhttp3/Headers;->get(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
invoke-static {p0}, Lokhttp3/internal/c/e;->ey(Ljava/lang/String;)J
move-result-wide v0
return-wide v0
.end method
.method private static ey(Ljava/lang/String;)J
.locals 2
const-wide/16 v0, -0x1
if-nez p0, :cond_0
return-wide v0
:cond_0
:try_start_0
invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
move-result-wide v0
:try_end_0
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
:catch_0
return-wide v0
.end method
.method public static f(Lokhttp3/Response;)Z
.locals 8
iget-object v0, p0, Lokhttp3/Response;->buP:Lokhttp3/w;
iget-object v0, v0, Lokhttp3/w;->method:Ljava/lang/String;
const-string v1, "HEAD"
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
const/4 v1, 0x0
if-eqz v0, :cond_0
return v1
:cond_0
iget v0, p0, Lokhttp3/Response;->code:I
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
:cond_2
invoke-static {p0}, Lokhttp3/internal/c/e;->e(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"
invoke-virtual {p0, v0}, Lokhttp3/Response;->dM(Ljava/lang/String;)Ljava/lang/String;
move-result-object p0
const-string v0, "chunked"
invoke-virtual {v0, p0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)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 public static k(Ljava/lang/String;I)I
.locals 2
:goto_0
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v0
if-ge p1, v0, :cond_1
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
move-result v0
const/16 v1, 0x20
if-eq v0, v1, :cond_0
const/16 v1, 0x9
if-ne v0, v1, :cond_1
:cond_0
add-int/lit8 p1, p1, 0x1
goto :goto_0
:cond_1
return p1
.end method
.method public static l(Ljava/lang/String;I)I
.locals 3
:try_start_0
invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
move-result-wide p0
:try_end_0
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
const-wide/32 v0, 0x7fffffff
cmp-long v2, p0, v0
if-lez v2, :cond_0
const p0, 0x7fffffff
return p0
:cond_0
const-wide/16 v0, 0x0
cmp-long v2, p0, v0
if-gez v2, :cond_1
const/4 p0, 0x0
return p0
:cond_1
long-to-int p1, p0
:catch_0
return p1
.end method