apkfuckery/com.discord/smali/okhttp3/Headers.smali

532 lines
11 KiB
Smali
Raw Normal View History

2019-02-04 20:05:16 +00:00
.class public final Lokhttp3/Headers;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "Headers.java"
2019-02-04 20:05:16 +00:00
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
2019-02-04 20:08:30 +00:00
Lokhttp3/Headers$a;
2019-02-04 20:05:16 +00:00
}
.end annotation
# instance fields
2019-05-08 22:54:48 +00:00
.field public final boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
# direct methods
2019-02-04 20:08:30 +00:00
.method constructor <init>(Lokhttp3/Headers$a;)V
.locals 1
2019-02-04 20:05:16 +00:00
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2019-05-08 22:54:48 +00:00
iget-object v0, p1, Lokhttp3/Headers$a;->boE:Ljava/util/List;
2019-02-04 20:05:16 +00:00
2019-05-08 22:54:48 +00:00
iget-object p1, p1, Lokhttp3/Headers$a;->boE:Ljava/util/List;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-interface {p1}, Ljava/util/List;->size()I
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
new-array p1, p1, [Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-interface {v0, p1}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
check-cast p1, [Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-05-08 22:54:48 +00:00
iput-object p1, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
return-void
.end method
.method private constructor <init>([Ljava/lang/String;)V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2019-05-08 22:54:48 +00:00
iput-object p1, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-17 02:24:41 +00:00
return-void
.end method
2019-05-04 02:59:52 +00:00
.method static ai(Ljava/lang/String;Ljava/lang/String;)V
2019-02-17 02:24:41 +00:00
.locals 5
if-eqz p0, :cond_3
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_2
invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C
move-result v3
const/16 v4, 0x1f
if-gt v3, v4, :cond_0
const/16 v4, 0x9
if-ne v3, v4, :cond_1
:cond_0
const/16 v4, 0x7f
if-ge v3, v4, :cond_1
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_1
new-instance v0, Ljava/lang/IllegalArgumentException;
const/4 v4, 0x4
new-array v4, v4, [Ljava/lang/Object;
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
aput-object v3, v4, v1
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
const/4 v2, 0x1
aput-object v1, v4, v2
const/4 v1, 0x2
aput-object p1, v4, v1
const/4 p1, 0x3
aput-object p0, v4, p1
const-string p0, "Unexpected char %#04x at %d in %s value: %s"
invoke-static {p0, v4}, Lokhttp3/internal/c;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_2
return-void
:cond_3
new-instance p0, Ljava/lang/NullPointerException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "value for name "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p1, " == null"
invoke-virtual {v0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p0, p1}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p0
2019-02-04 20:05:16 +00:00
return-void
.end method
2019-02-04 20:08:30 +00:00
.method private static b([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
2019-02-04 20:05:16 +00:00
.locals 2
2019-02-04 20:08:30 +00:00
array-length v0, p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
add-int/lit8 v0, v0, -0x2
2019-02-04 20:05:16 +00:00
:goto_0
if-ltz v0, :cond_1
aget-object v1, p0, v0
invoke-virtual {p1, v1}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
move-result v1
if-eqz v1, :cond_0
2019-02-04 20:08:30 +00:00
add-int/lit8 v0, v0, 0x1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
aget-object p0, p0, v0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return-object p0
2019-02-04 20:05:16 +00:00
:cond_0
add-int/lit8 v0, v0, -0x2
goto :goto_0
:cond_1
2019-02-04 20:08:30 +00:00
const/4 p0, 0x0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return-object p0
2019-02-04 20:05:16 +00:00
.end method
2019-05-04 02:59:52 +00:00
.method static dK(Ljava/lang/String;)V
2019-02-17 02:24:41 +00:00
.locals 5
if-eqz p0, :cond_3
invoke-virtual {p0}, Ljava/lang/String;->isEmpty()Z
move-result v0
if-nez v0, :cond_2
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v0
const/4 v1, 0x0
const/4 v2, 0x0
:goto_0
if-ge v2, v0, :cond_1
invoke-virtual {p0, v2}, Ljava/lang/String;->charAt(I)C
move-result v3
const/16 v4, 0x20
if-le v3, v4, :cond_0
const/16 v4, 0x7f
if-ge v3, v4, :cond_0
add-int/lit8 v2, v2, 0x1
goto :goto_0
:cond_0
new-instance v0, Ljava/lang/IllegalArgumentException;
const/4 v4, 0x3
new-array v4, v4, [Ljava/lang/Object;
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
aput-object v3, v4, v1
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v1
const/4 v2, 0x1
aput-object v1, v4, v2
const/4 v1, 0x2
aput-object p0, v4, v1
const-string p0, "Unexpected char %#04x at %d in header name: %s"
invoke-static {p0, v4}, Lokhttp3/internal/c;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw v0
:cond_1
return-void
:cond_2
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string v0, "name is empty"
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
:cond_3
new-instance p0, Ljava/lang/NullPointerException;
const-string v0, "name == null"
invoke-direct {p0, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
throw p0
return-void
.end method
2019-02-04 20:32:01 +00:00
.method public static varargs e([Ljava/lang/String;)Lokhttp3/Headers;
2019-02-17 02:24:41 +00:00
.locals 3
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
array-length v0, p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
rem-int/lit8 v0, v0, 0x2
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
if-nez v0, :cond_3
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {p0}, [Ljava/lang/String;->clone()Ljava/lang/Object;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
check-cast p0, [Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const/4 v0, 0x0
2019-02-04 20:05:16 +00:00
const/4 v1, 0x0
:goto_0
2019-02-04 20:08:30 +00:00
array-length v2, p0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-ge v1, v2, :cond_1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
aget-object v2, p0, v1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz v2, :cond_0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
aget-object v2, p0, v1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;
2019-02-04 20:05:16 +00:00
move-result-object v2
2019-02-04 20:08:30 +00:00
aput-object v2, p0, v1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
add-int/lit8 v1, v1, 0x1
2019-02-04 20:05:16 +00:00
goto :goto_0
:cond_0
2019-02-04 20:08:30 +00:00
new-instance p0, Ljava/lang/IllegalArgumentException;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v0, "Headers cannot be null"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
throw p0
2019-02-04 20:05:16 +00:00
:cond_1
2019-02-04 20:08:30 +00:00
:goto_1
2019-02-17 02:24:41 +00:00
array-length v1, p0
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
if-ge v0, v1, :cond_2
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
aget-object v1, p0, v0
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
add-int/lit8 v2, v0, 0x1
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
aget-object v2, p0, v2
2019-02-04 20:05:16 +00:00
2019-05-04 02:59:52 +00:00
invoke-static {v1}, Lokhttp3/Headers;->dK(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-05-04 02:59:52 +00:00
invoke-static {v2, v1}, Lokhttp3/Headers;->ai(Ljava/lang/String;Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
add-int/lit8 v0, v0, 0x2
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
goto :goto_1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
:cond_2
new-instance v0, Lokhttp3/Headers;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {v0, p0}, Lokhttp3/Headers;-><init>([Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return-object v0
2019-02-04 20:05:16 +00:00
2019-02-17 02:24:41 +00:00
:cond_3
2019-02-04 20:08:30 +00:00
new-instance p0, Ljava/lang/IllegalArgumentException;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v0, "Expected alternating header names and values"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
throw p0
2019-02-04 20:29:01 +00:00
return-void
2019-02-04 20:08:30 +00:00
.end method
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
# virtual methods
2019-05-04 02:59:52 +00:00
.method public final BQ()Lokhttp3/Headers$a;
2019-02-06 20:30:57 +00:00
.locals 3
new-instance v0, Lokhttp3/Headers$a;
invoke-direct {v0}, Lokhttp3/Headers$a;-><init>()V
2019-05-08 22:54:48 +00:00
iget-object v1, v0, Lokhttp3/Headers$a;->boE:Ljava/util/List;
2019-02-06 20:30:57 +00:00
2019-05-08 22:54:48 +00:00
iget-object v2, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-06 20:30:57 +00:00
invoke-static {v1, v2}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z
return-object v0
.end method
2019-05-04 02:59:52 +00:00
.method public final dg(I)Ljava/lang/String;
2019-02-04 20:32:01 +00:00
.locals 1
2019-05-08 22:54:48 +00:00
iget-object v0, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:32:01 +00:00
mul-int/lit8 p1, p1, 0x2
aget-object p1, v0, p1
return-object p1
.end method
2019-05-04 02:59:52 +00:00
.method public final dh(I)Ljava/lang/String;
2019-02-04 20:32:01 +00:00
.locals 1
2019-05-08 22:54:48 +00:00
iget-object v0, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:32:01 +00:00
mul-int/lit8 p1, p1, 0x2
add-int/lit8 p1, p1, 0x1
aget-object p1, v0, p1
return-object p1
.end method
2019-02-04 20:08:30 +00:00
.method public final equals(Ljava/lang/Object;)Z
2019-02-04 20:05:16 +00:00
.locals 1
2019-02-04 20:08:30 +00:00
.param p1 # Ljava/lang/Object;
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
.end param
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
instance-of v0, p1, Lokhttp3/Headers;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz v0, :cond_0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
check-cast p1, Lokhttp3/Headers;
2019-02-04 20:05:16 +00:00
2019-05-08 22:54:48 +00:00
iget-object p1, p1, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-05-08 22:54:48 +00:00
iget-object v0, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {p1, v0}, Ljava/util/Arrays;->equals([Ljava/lang/Object;[Ljava/lang/Object;)Z
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
if-eqz p1, :cond_0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const/4 p1, 0x1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return p1
2019-02-04 20:05:16 +00:00
:cond_0
2019-02-04 20:08:30 +00:00
const/4 p1, 0x0
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return p1
2019-02-04 20:05:16 +00:00
.end method
2019-02-04 20:08:30 +00:00
.method public final get(Ljava/lang/String;)Ljava/lang/String;
.locals 1
.annotation runtime Ljavax/annotation/Nullable;
.end annotation
2019-02-04 20:05:16 +00:00
2019-05-08 22:54:48 +00:00
iget-object v0, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {v0, p1}, Lokhttp3/Headers;->b([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object p1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
return-object p1
2019-02-04 20:05:16 +00:00
.end method
2019-02-04 20:08:30 +00:00
.method public final hashCode()I
2019-02-04 20:05:16 +00:00
.locals 1
2019-05-08 22:54:48 +00:00
iget-object v0, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-static {v0}, Ljava/util/Arrays;->hashCode([Ljava/lang/Object;)I
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result v0
2019-02-04 20:05:16 +00:00
return v0
.end method
2019-02-04 20:08:30 +00:00
.method public final toString()Ljava/lang/String;
.locals 4
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
new-instance v0, Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
2019-02-04 20:05:16 +00:00
2019-05-08 22:54:48 +00:00
iget-object v1, p0, Lokhttp3/Headers;->boD:[Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
array-length v1, v1
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
div-int/lit8 v1, v1, 0x2
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const/4 v2, 0x0
2019-02-04 20:05:16 +00:00
:goto_0
2019-02-04 20:08:30 +00:00
if-ge v2, v1, :cond_0
2019-02-04 20:05:16 +00:00
2019-05-04 02:59:52 +00:00
invoke-virtual {p0, v2}, Lokhttp3/Headers;->dg(I)Ljava/lang/String;
2019-02-04 20:05:16 +00:00
move-result-object v3
2019-02-04 20:08:30 +00:00
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v3, ": "
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-05-04 02:59:52 +00:00
invoke-virtual {p0, v2}, Lokhttp3/Headers;->dh(I)Ljava/lang/String;
2019-02-04 20:05:16 +00:00
move-result-object v3
2019-02-04 20:08:30 +00:00
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
const-string v3, "\n"
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
add-int/lit8 v2, v2, 0x1
2019-02-04 20:05:16 +00:00
goto :goto_0
:cond_0
2019-02-04 20:08:30 +00:00
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2019-02-04 20:05:16 +00:00
2019-02-04 20:08:30 +00:00
move-result-object v0
2019-02-04 20:05:16 +00:00
return-object v0
.end method