154 lines
3.8 KiB
Smali
154 lines
3.8 KiB
Smali
.class public Lorg/apache/http/impl/cookie/RFC2109VersionHandler;
|
|
.super Lorg/apache/http/impl/cookie/AbstractCookieAttributeHandler;
|
|
.source "RFC2109VersionHandler.java"
|
|
|
|
|
|
# annotations
|
|
.annotation build Lorg/apache/http/annotation/Immutable;
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Lorg/apache/http/impl/cookie/AbstractCookieAttributeHandler;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public parse(Lorg/apache/http/cookie/SetCookie;Ljava/lang/String;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/apache/http/cookie/MalformedCookieException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_2
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
.line 1
|
|
invoke-virtual {p2}, Ljava/lang/String;->trim()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
:try_start_0
|
|
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result p2
|
|
|
|
invoke-interface {p1, p2}, Lorg/apache/http/cookie/SetCookie;->setVersion(I)V
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 3
|
|
new-instance p2, Lorg/apache/http/cookie/MalformedCookieException;
|
|
|
|
const-string v0, "Invalid version: "
|
|
|
|
invoke-static {v0}, Landroid/support/v4/media/d;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/NumberFormatException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
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 {p2, p1}, Lorg/apache/http/cookie/MalformedCookieException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
|
|
.line 4
|
|
:cond_0
|
|
new-instance p1, Lorg/apache/http/cookie/MalformedCookieException;
|
|
|
|
const-string p2, "Blank value for version attribute"
|
|
|
|
invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 5
|
|
:cond_1
|
|
new-instance p1, Lorg/apache/http/cookie/MalformedCookieException;
|
|
|
|
const-string p2, "Missing value for version attribute"
|
|
|
|
invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 6
|
|
:cond_2
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Cookie may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public validate(Lorg/apache/http/cookie/Cookie;Lorg/apache/http/cookie/CookieOrigin;)V
|
|
.locals 0
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Lorg/apache/http/cookie/MalformedCookieException;
|
|
}
|
|
.end annotation
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
.line 1
|
|
invoke-interface {p1}, Lorg/apache/http/cookie/Cookie;->getVersion()I
|
|
|
|
move-result p1
|
|
|
|
if-ltz p1, :cond_0
|
|
|
|
return-void
|
|
|
|
.line 2
|
|
:cond_0
|
|
new-instance p1, Lorg/apache/http/cookie/MalformedCookieException;
|
|
|
|
const-string p2, "Cookie version may not be negative"
|
|
|
|
invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 3
|
|
:cond_1
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string p2, "Cookie may not be null"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|