544 lines
11 KiB
Smali
544 lines
11 KiB
Smali
.class public final Lokhttp3/Headers;
|
|
.super Ljava/lang/Object;
|
|
.source "Headers.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokhttp3/Headers$a;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final btF:[Ljava/lang/String;
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(Lokhttp3/Headers$a;)V
|
|
.locals 1
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iget-object v0, p1, Lokhttp3/Headers$a;->btG:Ljava/util/List;
|
|
|
|
iget-object p1, p1, Lokhttp3/Headers$a;->btG:Ljava/util/List;
|
|
|
|
invoke-interface {p1}, Ljava/util/List;->size()I
|
|
|
|
move-result p1
|
|
|
|
new-array p1, p1, [Ljava/lang/String;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/List;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, [Ljava/lang/String;
|
|
|
|
iput-object p1, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private constructor <init>([Ljava/lang/String;)V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p1, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method static aj(Ljava/lang/String;Ljava/lang/String;)V
|
|
.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
|
|
|
|
goto :goto_2
|
|
|
|
:goto_1
|
|
throw p0
|
|
|
|
:goto_2
|
|
goto :goto_1
|
|
.end method
|
|
|
|
.method private static b([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 2
|
|
|
|
array-length v0, p0
|
|
|
|
add-int/lit8 v0, v0, -0x2
|
|
|
|
: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
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
aget-object p0, p0, v0
|
|
|
|
return-object p0
|
|
|
|
:cond_0
|
|
add-int/lit8 v0, v0, -0x2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const/4 p0, 0x0
|
|
|
|
return-object p0
|
|
.end method
|
|
|
|
.method static ee(Ljava/lang/String;)V
|
|
.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
|
|
|
|
goto :goto_2
|
|
|
|
:goto_1
|
|
throw p0
|
|
|
|
:goto_2
|
|
goto :goto_1
|
|
.end method
|
|
|
|
.method public static varargs f([Ljava/lang/String;)Lokhttp3/Headers;
|
|
.locals 3
|
|
|
|
array-length v0, p0
|
|
|
|
rem-int/lit8 v0, v0, 0x2
|
|
|
|
if-nez v0, :cond_3
|
|
|
|
invoke-virtual {p0}, [Ljava/lang/String;->clone()Ljava/lang/Object;
|
|
|
|
move-result-object p0
|
|
|
|
check-cast p0, [Ljava/lang/String;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
:goto_0
|
|
array-length v2, p0
|
|
|
|
if-ge v1, v2, :cond_1
|
|
|
|
aget-object v2, p0, v1
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
aget-object v2, p0, v1
|
|
|
|
invoke-virtual {v2}, Ljava/lang/String;->trim()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
aput-object v2, p0, v1
|
|
|
|
add-int/lit8 v1, v1, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Headers cannot be null"
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_1
|
|
:goto_1
|
|
array-length v1, p0
|
|
|
|
if-ge v0, v1, :cond_2
|
|
|
|
aget-object v1, p0, v0
|
|
|
|
add-int/lit8 v2, v0, 0x1
|
|
|
|
aget-object v2, p0, v2
|
|
|
|
invoke-static {v1}, Lokhttp3/Headers;->ee(Ljava/lang/String;)V
|
|
|
|
invoke-static {v2, v1}, Lokhttp3/Headers;->aj(Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
add-int/lit8 v0, v0, 0x2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
new-instance v0, Lokhttp3/Headers;
|
|
|
|
invoke-direct {v0, p0}, Lokhttp3/Headers;-><init>([Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_3
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "Expected alternating header names and values"
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
goto :goto_3
|
|
|
|
:goto_2
|
|
throw p0
|
|
|
|
:goto_3
|
|
goto :goto_2
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final Gz()Lokhttp3/Headers$a;
|
|
.locals 3
|
|
|
|
new-instance v0, Lokhttp3/Headers$a;
|
|
|
|
invoke-direct {v0}, Lokhttp3/Headers$a;-><init>()V
|
|
|
|
iget-object v1, v0, Lokhttp3/Headers$a;->btG:Ljava/util/List;
|
|
|
|
iget-object v2, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
invoke-static {v1, v2}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public final dA(I)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
mul-int/lit8 p1, p1, 0x2
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
aget-object p1, v0, p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final dz(I)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
mul-int/lit8 p1, p1, 0x2
|
|
|
|
aget-object p1, v0, p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final equals(Ljava/lang/Object;)Z
|
|
.locals 1
|
|
.param p1 # Ljava/lang/Object;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
instance-of v0, p1, Lokhttp3/Headers;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
check-cast p1, Lokhttp3/Headers;
|
|
|
|
iget-object p1, p1, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
invoke-static {p1, v0}, Ljava/util/Arrays;->equals([Ljava/lang/Object;[Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final get(Ljava/lang/String;)Ljava/lang/String;
|
|
.locals 1
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
invoke-static {v0, p1}, Lokhttp3/Headers;->b([Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final hashCode()I
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
invoke-static {v0}, Ljava/util/Arrays;->hashCode([Ljava/lang/Object;)I
|
|
|
|
move-result v0
|
|
|
|
return v0
|
|
.end method
|
|
|
|
.method public final toString()Ljava/lang/String;
|
|
.locals 4
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v1, p0, Lokhttp3/Headers;->btF:[Ljava/lang/String;
|
|
|
|
array-length v1, v1
|
|
|
|
div-int/lit8 v1, v1, 0x2
|
|
|
|
const/4 v2, 0x0
|
|
|
|
:goto_0
|
|
if-ge v2, v1, :cond_0
|
|
|
|
invoke-virtual {p0, v2}, Lokhttp3/Headers;->dz(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, ": "
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p0, v2}, Lokhttp3/Headers;->dA(I)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "\n"
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
add-int/lit8 v2, v2, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
return-object v0
|
|
.end method
|