372 lines
7.7 KiB
Smali
372 lines
7.7 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 bkJ:[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;->bkK:Ljava/util/List;
|
|
|
|
iget-object p1, p1, Lokhttp3/Headers$a;->bkK: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;->bkJ:[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;->bkJ:[Ljava/lang/String;
|
|
|
|
return-void
|
|
.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 public static varargs e([Ljava/lang/String;)Lokhttp3/Headers;
|
|
.locals 6
|
|
|
|
array-length v0, p0
|
|
|
|
rem-int/lit8 v0, v0, 0x2
|
|
|
|
if-nez v0, :cond_4
|
|
|
|
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
|
|
const/4 v1, 0x0
|
|
|
|
:goto_1
|
|
array-length v2, p0
|
|
|
|
if-ge v1, v2, :cond_3
|
|
|
|
aget-object v2, p0, v1
|
|
|
|
add-int/lit8 v3, v1, 0x1
|
|
|
|
aget-object v3, p0, v3
|
|
|
|
invoke-virtual {v2}, Ljava/lang/String;->length()I
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/String;->indexOf(I)I
|
|
|
|
move-result v4
|
|
|
|
const/4 v5, -0x1
|
|
|
|
if-ne v4, v5, :cond_2
|
|
|
|
invoke-virtual {v3, v0}, Ljava/lang/String;->indexOf(I)I
|
|
|
|
move-result v4
|
|
|
|
if-ne v4, v5, :cond_2
|
|
|
|
add-int/lit8 v1, v1, 0x2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
new-instance p0, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Unexpected header: "
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, ": "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p0, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p0
|
|
|
|
:cond_3
|
|
new-instance v0, Lokhttp3/Headers;
|
|
|
|
invoke-direct {v0, p0}, Lokhttp3/Headers;-><init>([Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
|
|
:cond_4
|
|
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
|
|
|
|
throw p0
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final cR(I)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->bkJ:[Ljava/lang/String;
|
|
|
|
mul-int/lit8 p1, p1, 0x2
|
|
|
|
aget-object p1, v0, p1
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method public final cS(I)Ljava/lang/String;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->bkJ:[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 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;->bkJ:[Ljava/lang/String;
|
|
|
|
iget-object v0, p0, Lokhttp3/Headers;->bkJ:[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;->bkJ:[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;->bkJ:[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;->bkJ:[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;->cR(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;->cS(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
|
|
|
|
.method public final zZ()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;->bkK:Ljava/util/List;
|
|
|
|
iget-object v2, p0, Lokhttp3/Headers;->bkJ:[Ljava/lang/String;
|
|
|
|
invoke-static {v1, v2}, Ljava/util/Collections;->addAll(Ljava/util/Collection;[Ljava/lang/Object;)Z
|
|
|
|
return-object v0
|
|
.end method
|