1089 lines
25 KiB
Smali
1089 lines
25 KiB
Smali
.class Lcom/my/target/MyTargetCookieStore;
|
|
.super Ljava/lang/Object;
|
|
.source "MyTargetCookieStore.java"
|
|
|
|
# interfaces
|
|
.implements Ljava/net/CookieStore;
|
|
|
|
|
|
# annotations
|
|
.annotation build Landroid/annotation/TargetApi;
|
|
value = 0x9
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field private final a:Landroid/content/SharedPreferences;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final b:Ljava/util/Map;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/Map<",
|
|
"Ljava/net/URI;",
|
|
"Ljava/util/Set<",
|
|
"Ljava/net/HttpCookie;",
|
|
">;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method constructor <init>(Landroid/content/Context;)V
|
|
.locals 2
|
|
.param p1 # Landroid/content/Context;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
const-string v0, "mytarget_httpcookie_prefs"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 2
|
|
invoke-virtual {p1, v0, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/my/target/MyTargetCookieStore;->a:Landroid/content/SharedPreferences;
|
|
|
|
.line 3
|
|
new-instance p1, Ljava/util/HashMap;
|
|
|
|
invoke-direct {p1}, Ljava/util/HashMap;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
.line 4
|
|
invoke-direct {p0}, Lcom/my/target/MyTargetCookieStore;->a()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private static a(Ljava/net/URI;Ljava/net/HttpCookie;)Ljava/net/URI;
|
|
.locals 4
|
|
.param p0 # Ljava/net/URI;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Ljava/net/HttpCookie;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.line 1
|
|
invoke-virtual {p1}, Ljava/net/HttpCookie;->getDomain()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_3
|
|
|
|
.line 2
|
|
invoke-virtual {p1}, Ljava/net/HttpCookie;->getDomain()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
.line 3
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v1
|
|
|
|
const/16 v2, 0x2e
|
|
|
|
if-ne v1, v2, :cond_0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
.line 4
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
.line 5
|
|
:cond_0
|
|
:try_start_0
|
|
new-instance v1, Ljava/net/URI;
|
|
|
|
invoke-virtual {p0}, Ljava/net/URI;->getScheme()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_1
|
|
|
|
const-string v2, "http"
|
|
|
|
goto :goto_0
|
|
|
|
.line 6
|
|
:cond_1
|
|
invoke-virtual {p0}, Ljava/net/URI;->getScheme()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
.line 7
|
|
:goto_0
|
|
invoke-virtual {p1}, Ljava/net/HttpCookie;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
if-nez v3, :cond_2
|
|
|
|
const-string p1, "/"
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
invoke-virtual {p1}, Ljava/net/HttpCookie;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
:goto_1
|
|
const/4 v3, 0x0
|
|
|
|
invoke-direct {v1, v2, v0, p1, v3}, Ljava/net/URI;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V
|
|
:try_end_0
|
|
.catch Ljava/net/URISyntaxException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
move-object p0, v1
|
|
|
|
goto :goto_2
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
.line 8
|
|
invoke-virtual {p1}, Ljava/net/URISyntaxException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-static {p1}, Lcom/my/target/Tracer;->a(Ljava/lang/String;)V
|
|
|
|
:cond_3
|
|
:goto_2
|
|
return-object p0
|
|
.end method
|
|
|
|
.method private a(Ljava/net/URI;)Ljava/util/List;
|
|
.locals 6
|
|
.param p1 # Ljava/net/URI;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/net/URI;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Ljava/net/HttpCookie;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
.line 20
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
.line 21
|
|
iget-object v1, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:cond_0
|
|
:goto_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Map$Entry;
|
|
|
|
.line 22
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/net/URI;
|
|
|
|
.line 23
|
|
invoke-virtual {v3}, Ljava/net/URI;->getHost()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-virtual {p1}, Ljava/net/URI;->getHost()Ljava/lang/String;
|
|
|
|
move-result-object v5
|
|
|
|
invoke-direct {p0, v4, v5}, Lcom/my/target/MyTargetCookieStore;->a(Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
.line 24
|
|
invoke-virtual {v3}, Ljava/net/URI;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {p1}, Ljava/net/URI;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-direct {p0, v3, v4}, Lcom/my/target/MyTargetCookieStore;->b(Ljava/lang/String;Ljava/lang/String;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_0
|
|
|
|
.line 25
|
|
invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Collection;
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/Set;->addAll(Ljava/util/Collection;)Z
|
|
|
|
goto :goto_0
|
|
|
|
.line 26
|
|
:cond_1
|
|
new-instance v1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 27
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
.line 28
|
|
:cond_2
|
|
:goto_1
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_3
|
|
|
|
.line 29
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/net/HttpCookie;
|
|
|
|
.line 30
|
|
invoke-virtual {v3}, Ljava/net/HttpCookie;->hasExpired()Z
|
|
|
|
move-result v4
|
|
|
|
if-eqz v4, :cond_2
|
|
|
|
.line 31
|
|
invoke-interface {v1, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
|
|
|
.line 32
|
|
invoke-interface {v2}, Ljava/util/Iterator;->remove()V
|
|
|
|
goto :goto_1
|
|
|
|
.line 33
|
|
:cond_3
|
|
invoke-interface {v1}, Ljava/util/List;->isEmpty()Z
|
|
|
|
move-result v2
|
|
|
|
if-nez v2, :cond_4
|
|
|
|
.line 34
|
|
invoke-direct {p0, p1, v1}, Lcom/my/target/MyTargetCookieStore;->a(Ljava/net/URI;Ljava/util/List;)V
|
|
|
|
.line 35
|
|
:cond_4
|
|
new-instance p1, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {p1, v0}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
|
|
return-object p1
|
|
.end method
|
|
|
|
.method private a()V
|
|
.locals 5
|
|
|
|
.line 9
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->a:Landroid/content/SharedPreferences;
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->getAll()Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
.line 10
|
|
invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v0
|
|
|
|
:goto_0
|
|
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/util/Map$Entry;
|
|
|
|
.line 11
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getKey()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/lang/String;
|
|
|
|
const/4 v3, 0x2
|
|
|
|
const-string v4, "\\|"
|
|
|
|
invoke-virtual {v2, v4, v3}, Ljava/lang/String;->split(Ljava/lang/String;I)[Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
.line 12
|
|
:try_start_0
|
|
new-instance v3, Ljava/net/URI;
|
|
|
|
const/4 v4, 0x0
|
|
|
|
aget-object v2, v2, v4
|
|
|
|
invoke-direct {v3, v2}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
|
|
|
|
.line 13
|
|
invoke-interface {v1}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/lang/String;
|
|
|
|
.line 14
|
|
new-instance v2, Lcom/my/target/MyTargetJSONCookie;
|
|
|
|
invoke-direct {v2}, Lcom/my/target/MyTargetJSONCookie;-><init>()V
|
|
|
|
invoke-virtual {v2, v1}, Lcom/my/target/MyTargetJSONCookie;->a(Ljava/lang/String;)Ljava/net/HttpCookie;
|
|
|
|
move-result-object v1
|
|
|
|
.line 15
|
|
iget-object v2, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/util/Set;
|
|
|
|
if-nez v2, :cond_0
|
|
|
|
.line 16
|
|
new-instance v2, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v2}, Ljava/util/HashSet;-><init>()V
|
|
|
|
.line 17
|
|
iget-object v4, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v4, v3, v2}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 18
|
|
:cond_0
|
|
invoke-interface {v2, v1}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
:try_end_0
|
|
.catch Ljava/net/URISyntaxException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
goto :goto_0
|
|
|
|
:catch_0
|
|
move-exception v1
|
|
|
|
.line 19
|
|
invoke-virtual {v1}, Ljava/net/URISyntaxException;->getMessage()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-static {v1}, Lcom/my/target/Tracer;->a(Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Ljava/net/URI;Ljava/util/List;)V
|
|
.locals 4
|
|
.param p1 # Ljava/net/URI;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/util/List;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/net/URI;",
|
|
"Ljava/util/List<",
|
|
"Ljava/net/HttpCookie;",
|
|
">;)V"
|
|
}
|
|
.end annotation
|
|
|
|
.line 37
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->a:Landroid/content/SharedPreferences;
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object v0
|
|
|
|
.line 38
|
|
invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object p2
|
|
|
|
:goto_0
|
|
invoke-interface {p2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-interface {p2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v1
|
|
|
|
check-cast v1, Ljava/net/HttpCookie;
|
|
|
|
.line 39
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p1}, Ljava/net/URI;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "|"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 40
|
|
invoke-virtual {v1}, Ljava/net/HttpCookie;->getName()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
.line 41
|
|
invoke-interface {v0, v1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
|
|
|
|
goto :goto_0
|
|
|
|
.line 42
|
|
:cond_0
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Ljava/lang/String;Ljava/lang/String;)Z
|
|
.locals 2
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 36
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v1, "."
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
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-virtual {p2, p1}, Ljava/lang/String;->endsWith(Ljava/lang/String;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 p1, 0x0
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
const/4 p1, 0x1
|
|
|
|
:goto_1
|
|
return p1
|
|
.end method
|
|
|
|
.method private b()V
|
|
.locals 1
|
|
|
|
.line 7
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->a:Landroid/content/SharedPreferences;
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->clear()Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private b(Ljava/net/URI;Ljava/net/HttpCookie;)V
|
|
.locals 2
|
|
.param p1 # Ljava/net/URI;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/net/HttpCookie;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->a:Landroid/content/SharedPreferences;
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p1}, Ljava/net/URI;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "|"
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/net/HttpCookie;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
new-instance v1, Lcom/my/target/MyTargetJSONCookie;
|
|
|
|
invoke-direct {v1}, Lcom/my/target/MyTargetJSONCookie;-><init>()V
|
|
|
|
invoke-virtual {v1, p2}, Lcom/my/target/MyTargetJSONCookie;->a(Ljava/net/HttpCookie;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-interface {v0, p1, p2}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
|
|
|
|
.line 3
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private b(Ljava/lang/String;Ljava/lang/String;)Z
|
|
.locals 4
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 4
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
.line 5
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
const/16 v3, 0x2f
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result v0
|
|
|
|
sub-int/2addr v0, v2
|
|
|
|
invoke-virtual {p1, v0}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result v0
|
|
|
|
if-eq v0, v3, :cond_1
|
|
|
|
.line 6
|
|
:cond_0
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
invoke-virtual {p1}, Ljava/lang/String;->length()I
|
|
|
|
move-result p1
|
|
|
|
invoke-virtual {p2, p1}, Ljava/lang/String;->substring(I)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, v1}, Ljava/lang/String;->charAt(I)C
|
|
|
|
move-result p1
|
|
|
|
if-ne p1, v3, :cond_2
|
|
|
|
:cond_1
|
|
const/4 v1, 0x1
|
|
|
|
:cond_2
|
|
return v1
|
|
.end method
|
|
|
|
.method private c(Ljava/net/URI;Ljava/net/HttpCookie;)V
|
|
.locals 2
|
|
.param p1 # Ljava/net/URI;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Ljava/net/HttpCookie;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
.line 1
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->a:Landroid/content/SharedPreferences;
|
|
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
|
|
|
|
move-result-object v0
|
|
|
|
.line 2
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
invoke-virtual {p1}, Ljava/net/URI;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string p1, "|"
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
.line 3
|
|
invoke-virtual {p2}, Ljava/net/HttpCookie;->getName()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
.line 4
|
|
invoke-interface {v0, p1}, Landroid/content/SharedPreferences$Editor;->remove(Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;
|
|
|
|
.line 5
|
|
invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public declared-synchronized add(Ljava/net/URI;Ljava/net/HttpCookie;)V
|
|
.locals 2
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-static {p1, p2}, Lcom/my/target/MyTargetCookieStore;->a(Ljava/net/URI;Ljava/net/HttpCookie;)Ljava/net/URI;
|
|
|
|
move-result-object p1
|
|
|
|
.line 2
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Set;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
.line 3
|
|
new-instance v0, Ljava/util/HashSet;
|
|
|
|
invoke-direct {v0}, Ljava/util/HashSet;-><init>()V
|
|
|
|
.line 4
|
|
iget-object v1, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v1, p1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
.line 5
|
|
:cond_0
|
|
invoke-interface {v0, p2}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
|
|
|
|
.line 6
|
|
invoke-interface {v0, p2}, Ljava/util/Set;->add(Ljava/lang/Object;)Z
|
|
|
|
.line 7
|
|
invoke-direct {p0, p1, p2}, Lcom/my/target/MyTargetCookieStore;->b(Ljava/net/URI;Ljava/net/HttpCookie;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 8
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized get(Ljava/net/URI;)Ljava/util/List;
|
|
.locals 0
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"(",
|
|
"Ljava/net/URI;",
|
|
")",
|
|
"Ljava/util/List<",
|
|
"Ljava/net/HttpCookie;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
invoke-direct {p0, p1}, Lcom/my/target/MyTargetCookieStore;->a(Ljava/net/URI;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized getCookies()Ljava/util/List;
|
|
.locals 3
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Ljava/net/HttpCookie;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
|
|
|
|
.line 2
|
|
iget-object v1, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map;->keySet()Ljava/util/Set;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Ljava/net/URI;
|
|
|
|
.line 3
|
|
invoke-direct {p0, v2}, Lcom/my/target/MyTargetCookieStore;->a(Ljava/net/URI;)Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v0, v2}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
goto :goto_0
|
|
|
|
.line 4
|
|
:cond_0
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized getURIs()Ljava/util/List;
|
|
.locals 2
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"()",
|
|
"Ljava/util/List<",
|
|
"Ljava/net/URI;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
new-instance v0, Ljava/util/ArrayList;
|
|
|
|
iget-object v1, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v1}, Ljava/util/Map;->keySet()Ljava/util/Set;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/util/ArrayList;-><init>(Ljava/util/Collection;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-object v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public declared-synchronized remove(Ljava/net/URI;Ljava/net/HttpCookie;)Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v0, p1}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/util/Set;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
.line 2
|
|
invoke-interface {v0, p2}, Ljava/util/Set;->remove(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
const/4 v0, 0x0
|
|
|
|
:goto_0
|
|
if-eqz v0, :cond_1
|
|
|
|
.line 3
|
|
invoke-direct {p0, p1, p2}, Lcom/my/target/MyTargetCookieStore;->c(Ljava/net/URI;Ljava/net/HttpCookie;)V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 4
|
|
:cond_1
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public declared-synchronized removeAll()Z
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
.line 1
|
|
:try_start_0
|
|
iget-object v0, p0, Lcom/my/target/MyTargetCookieStore;->b:Ljava/util/Map;
|
|
|
|
invoke-interface {v0}, Ljava/util/Map;->clear()V
|
|
|
|
.line 2
|
|
invoke-direct {p0}, Lcom/my/target/MyTargetCookieStore;->b()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
const/4 v0, 0x1
|
|
|
|
.line 3
|
|
monitor-exit p0
|
|
|
|
return v0
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|