apkfuckery/com.discord/smali/okhttp3/internal/http/HeaderParser.smali
2019-02-04 21:05:16 +01:00

139 lines
2.6 KiB
Smali

.class public final Lokhttp3/internal/http/HeaderParser;
.super Ljava/lang/Object;
.source "HeaderParser.java"
# direct methods
.method private constructor <init>()V
.locals 0
.prologue
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static parseSeconds(Ljava/lang/String;I)I
.locals 6
.param p0, "value" # Ljava/lang/String;
.param p1, "defaultValue" # I
.prologue
:try_start_0
invoke-static {p0}, Ljava/lang/Long;->parseLong(Ljava/lang/String;)J
:try_end_0
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
move-result-wide v2
.local v2, "seconds":J
const-wide/32 v4, 0x7fffffff
cmp-long v1, v2, v4
if-lez v1, :cond_0
const p1, 0x7fffffff
.end local v2 # "seconds":J
.end local p1 # "defaultValue":I
:goto_0
return p1
.restart local v2 # "seconds":J
.restart local p1 # "defaultValue":I
:cond_0
const-wide/16 v4, 0x0
cmp-long v1, v2, v4
if-gez v1, :cond_1
const/4 p1, 0x0
goto :goto_0
:cond_1
long-to-int p1, v2
goto :goto_0
.end local v2 # "seconds":J
:catch_0
move-exception v0
.local v0, "e":Ljava/lang/NumberFormatException;
goto :goto_0
.end method
.method public static skipUntil(Ljava/lang/String;ILjava/lang/String;)I
.locals 2
.param p0, "input" # Ljava/lang/String;
.param p1, "pos" # I
.param p2, "characters" # Ljava/lang/String;
.prologue
: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-eq v0, v1, :cond_1
:cond_0
return p1
:cond_1
add-int/lit8 p1, p1, 0x1
goto :goto_0
.end method
.method public static skipWhitespace(Ljava/lang/String;I)I
.locals 2
.param p0, "input" # Ljava/lang/String;
.param p1, "pos" # I
.prologue
:goto_0
invoke-virtual {p0}, Ljava/lang/String;->length()I
move-result v1
if-ge p1, v1, :cond_0
invoke-virtual {p0, p1}, Ljava/lang/String;->charAt(I)C
move-result v0
.local v0, "c":C
const/16 v1, 0x20
if-eq v0, v1, :cond_1
const/16 v1, 0x9
if-eq v0, v1, :cond_1
.end local v0 # "c":C
:cond_0
return p1
.restart local v0 # "c":C
:cond_1
add-int/lit8 p1, p1, 0x1
goto :goto_0
.end method