114 lines
2.7 KiB
Smali
114 lines
2.7 KiB
Smali
.class public Lorg/apache/http/impl/cookie/BasicMaxAgeHandler;
|
|
.super Lorg/apache/http/impl/cookie/AbstractCookieAttributeHandler;
|
|
.source "BasicMaxAgeHandler.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 7
|
|
.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
|
|
:try_start_0
|
|
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
|
|
|
|
move-result v0
|
|
:try_end_0
|
|
.catch Ljava/lang/NumberFormatException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
if-ltz v0, :cond_0
|
|
|
|
.line 2
|
|
new-instance p2, Ljava/util/Date;
|
|
|
|
invoke-static {}, Ljava/lang/System;->currentTimeMillis()J
|
|
|
|
move-result-wide v1
|
|
|
|
int-to-long v3, v0
|
|
|
|
const-wide/16 v5, 0x3e8
|
|
|
|
mul-long/2addr v3, v5
|
|
|
|
add-long/2addr v3, v1
|
|
|
|
invoke-direct {p2, v3, v4}, Ljava/util/Date;-><init>(J)V
|
|
|
|
invoke-interface {p1, p2}, Lorg/apache/http/cookie/SetCookie;->setExpiryDate(Ljava/util/Date;)V
|
|
|
|
return-void
|
|
|
|
.line 3
|
|
:cond_0
|
|
new-instance p1, Lorg/apache/http/cookie/MalformedCookieException;
|
|
|
|
const-string v0, "Negative max-age attribute: "
|
|
|
|
invoke-static {v0, p2}, Lc/g;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Lorg/apache/http/cookie/MalformedCookieException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
.line 4
|
|
:catch_0
|
|
new-instance p1, Lorg/apache/http/cookie/MalformedCookieException;
|
|
|
|
const-string v0, "Invalid max-age attribute: "
|
|
|
|
invoke-static {v0, p2}, Lc/g;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
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 max-age 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
|