.class public Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;
.super Ljava/lang/Object;
.source "CookieManagerWrapper.java"


# static fields
.field public static final INSTANCE:Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;

.field private static final TAG:Ljava/lang/String; = "CookieManagerWrapper"


# instance fields
.field private mCookies:[Ljava/lang/String;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .line 19
    new-instance v0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;

    invoke-direct {v0}, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;-><init>()V

    sput-object v0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->INSTANCE:Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;

    return-void
.end method

.method private constructor <init>()V
    .locals 0

    .line 22
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public clearCookies()V
    .locals 11

    const-string v0, "clearCookies"

    const-string v1, "into clearCookies "

    .line 104
    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 107
    invoke-static {}, Lcom/ali/auth/third/core/context/KernelContext;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/webkit/CookieSyncManager;->createInstance(Landroid/content/Context;)Landroid/webkit/CookieSyncManager;

    .line 109
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v0

    invoke-interface {v0}, Lcom/ali/auth/third/core/WebViewProxy;->removeSessionCookie()V

    const-string v0, "clearCookies"

    const-string v1, "into clearCookies removeSessionCookie finish"

    .line 110
    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 112
    iget-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    if-nez v0, :cond_0

    .line 113
    invoke-static {}, Lcom/ali/auth/third/core/context/KernelContext;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "cookies"

    invoke-static {v0, v1}, Lcom/ali/auth/third/core/util/FileUtils;->readFileData(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 114
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 115
    sget-object v1, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "get cookie from storage:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/ali/auth/third/core/trace/SDKLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "\u0005"

    .line 116
    invoke-static {v0, v1}, Landroid/text/TextUtils;->split(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    :cond_0
    const-string v0, "clearCookies"

    const-string v1, "into clearCookies readFileData finish"

    .line 119
    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 120
    iget-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    if-eqz v0, :cond_8

    .line 121
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 122
    iget-object v1, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    array-length v2, v1

    const/4 v3, 0x0

    const/4 v4, 0x0

    :goto_0
    if-ge v4, v2, :cond_3

    aget-object v5, v1, v4

    .line 123
    invoke-static {v5}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v6

    if-nez v6, :cond_2

    .line 125
    :try_start_0
    invoke-static {v5}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->parseCookie(Ljava/lang/String;)Lcom/ali/auth/third/core/cookies/LoginCookie;

    move-result-object v5

    const-string v6, "munb"

    .line 126
    iget-object v7, v5, Lcom/ali/auth/third/core/cookies/LoginCookie;->name:Ljava/lang/String;

    invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v6

    if-eqz v6, :cond_1

    goto :goto_1

    .line 127
    :cond_1
    invoke-static {v5}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->getHttpDomin(Lcom/ali/auth/third/core/cookies/LoginCookie;)Ljava/lang/String;

    move-result-object v6

    .line 128
    invoke-static {v5}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->expiresCookies(Lcom/ali/auth/third/core/cookies/LoginCookie;)V

    .line 129
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v7

    invoke-virtual {v5}, Lcom/ali/auth/third/core/cookies/LoginCookie;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-interface {v7, v6, v8}, Lcom/ali/auth/third/core/WebViewProxy;->setCookie(Ljava/lang/String;Ljava/lang/String;)V

    .line 130
    iget-object v6, v5, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    const-string v7, ".taobao.com"

    invoke-static {v6, v7}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v6

    if-eqz v6, :cond_2

    .line 131
    invoke-interface {v0, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Ljava/lang/Throwable; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_1

    :catch_0
    move-exception v5

    .line 134
    invoke-virtual {v5}, Ljava/lang/Throwable;->printStackTrace()V

    :cond_2
    :goto_1
    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    :cond_3
    const/4 v1, 0x0

    .line 142
    :try_start_1
    sget-object v2, Lcom/ali/auth/third/core/service/impl/CredentialManager;->INSTANCE:Lcom/ali/auth/third/core/service/impl/CredentialManager;

    invoke-virtual {v2}, Lcom/ali/auth/third/core/service/impl/CredentialManager;->getInternalSession()Lcom/ali/auth/third/core/model/InternalSession;

    move-result-object v2

    iget-object v2, v2, Lcom/ali/auth/third/core/model/InternalSession;->otherInfo:Ljava/util/Map;

    if-eqz v2, :cond_4

    .line 143
    sget-object v2, Lcom/ali/auth/third/core/service/impl/CredentialManager;->INSTANCE:Lcom/ali/auth/third/core/service/impl/CredentialManager;

    invoke-virtual {v2}, Lcom/ali/auth/third/core/service/impl/CredentialManager;->getInternalSession()Lcom/ali/auth/third/core/model/InternalSession;

    move-result-object v2

    iget-object v2, v2, Lcom/ali/auth/third/core/model/InternalSession;->otherInfo:Ljava/util/Map;

    const-string v4, "ssoDomainList"

    invoke-interface {v2, v4}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    if-eqz v2, :cond_4

    .line 144
    instance-of v4, v2, Ljava/util/ArrayList;

    if-eqz v4, :cond_4

    .line 145
    check-cast v2, Ljava/util/ArrayList;

    .line 147
    new-array v4, v3, [Ljava/lang/String;

    invoke-virtual {v2, v4}, Ljava/util/ArrayList;->toArray([Ljava/lang/Object;)[Ljava/lang/Object;

    move-result-object v2

    check-cast v2, [Ljava/lang/String;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    goto :goto_2

    :catch_1
    move-exception v2

    .line 152
    invoke-virtual {v2}, Ljava/lang/Exception;->printStackTrace()V

    :cond_4
    move-object v2, v1

    :goto_2
    if-eqz v2, :cond_7

    .line 155
    array-length v4, v2

    if-lez v4, :cond_7

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v4

    if-nez v4, :cond_7

    .line 156
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_3
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v4

    if-eqz v4, :cond_7

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v4

    check-cast v4, Lcom/ali/auth/third/core/cookies/LoginCookie;

    .line 158
    iget-object v5, v4, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    .line 159
    array-length v6, v2

    const/4 v7, 0x0

    :goto_4
    if-ge v7, v6, :cond_6

    aget-object v8, v2, v7

    const-string v9, "munb"

    .line 160
    iget-object v10, v4, Lcom/ali/auth/third/core/cookies/LoginCookie;->name:Ljava/lang/String;

    invoke-virtual {v9, v10}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_5

    goto :goto_5

    .line 161
    :cond_5
    iput-object v8, v4, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    .line 162
    invoke-static {v4}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->getHttpDomin(Lcom/ali/auth/third/core/cookies/LoginCookie;)Ljava/lang/String;

    move-result-object v8

    .line 164
    invoke-static {v4}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->expiresCookies(Lcom/ali/auth/third/core/cookies/LoginCookie;)V

    .line 165
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v9

    invoke-virtual {v4}, Lcom/ali/auth/third/core/cookies/LoginCookie;->toString()Ljava/lang/String;

    move-result-object v10

    invoke-interface {v9, v8, v10}, Lcom/ali/auth/third/core/WebViewProxy;->setCookie(Ljava/lang/String;Ljava/lang/String;)V

    :goto_5
    add-int/lit8 v7, v7, 0x1

    goto :goto_4

    .line 168
    :cond_6
    iput-object v5, v4, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    goto :goto_3

    .line 172
    :cond_7
    sget-object v0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->TAG:Ljava/lang/String;

    const-string v2, "injectCookie cookies is null"

    invoke-static {v0, v2}, Lcom/ali/auth/third/core/trace/SDKLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 173
    iput-object v1, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    .line 177
    invoke-static {}, Lcom/ali/auth/third/core/context/KernelContext;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "cookies"

    const-string v2, ""

    invoke-static {v0, v1, v2}, Lcom/ali/auth/third/core/util/FileUtils;->writeFileData(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    :cond_8
    const-string v0, "clearCookies"

    const-string v1, "into clearCookies reset cookie finish"

    .line 179
    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 180
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v0

    invoke-interface {v0}, Lcom/ali/auth/third/core/WebViewProxy;->removeExpiredCookie()V

    const-string v0, "clearCookies"

    const-string v1, "into clearCookies removeExpiredCookie finish"

    .line 181
    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 182
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v0

    invoke-interface {v0}, Lcom/ali/auth/third/core/WebViewProxy;->flush()V

    const-string v0, "clearCookies"

    const-string v1, "into clearCookies  finish"

    .line 183
    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public declared-synchronized injectCookie([Ljava/lang/String;[Ljava/lang/String;)V
    .locals 12

    monitor-enter p0

    .line 50
    :try_start_0
    iput-object p1, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    .line 51
    sget-object v0, Lcom/ali/auth/third/core/context/KernelContext;->context:Landroid/content/Context;

    if-eqz v0, :cond_5

    if-eqz p1, :cond_4

    .line 53
    sget-object v0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->TAG:Ljava/lang/String;

    const-string v1, "injectCookie cookies != null"

    invoke-static {v0, v1}, Lcom/ali/auth/third/core/trace/SDKLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 54
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    .line 55
    array-length v1, p1

    const/4 v2, 0x0

    const/4 v3, 0x0

    :goto_0
    if-ge v3, v1, :cond_1

    aget-object v4, p1, v3

    .line 56
    invoke-static {v4}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v5
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-nez v5, :cond_0

    .line 58
    :try_start_1
    invoke-static {v4}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->parseCookie(Ljava/lang/String;)Lcom/ali/auth/third/core/cookies/LoginCookie;

    move-result-object v4

    .line 59
    invoke-static {v4}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->getHttpDomin(Lcom/ali/auth/third/core/cookies/LoginCookie;)Ljava/lang/String;

    move-result-object v5

    .line 60
    invoke-virtual {v4}, Lcom/ali/auth/third/core/cookies/LoginCookie;->toString()Ljava/lang/String;

    move-result-object v6

    .line 61
    sget-object v7, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->TAG:Ljava/lang/String;

    new-instance v8, Ljava/lang/StringBuilder;

    invoke-direct {v8}, Ljava/lang/StringBuilder;-><init>()V

    const-string v9, "add cookie: "

    invoke-virtual {v8, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v8}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v8

    invoke-static {v7, v8}, Lcom/ali/auth/third/core/trace/SDKLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 63
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v7

    invoke-interface {v7, v5, v6}, Lcom/ali/auth/third/core/WebViewProxy;->setCookie(Ljava/lang/String;Ljava/lang/String;)V

    .line 64
    iget-object v5, v4, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    const-string v6, ".taobao.com"

    invoke-static {v5, v6}, Landroid/text/TextUtils;->equals(Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_0

    .line 65
    invoke-interface {v0, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_1

    :catch_0
    move-exception v4

    .line 68
    :try_start_2
    invoke-virtual {v4}, Ljava/lang/Throwable;->printStackTrace()V

    :cond_0
    :goto_1
    add-int/lit8 v3, v3, 0x1

    goto :goto_0

    :cond_1
    if-eqz p2, :cond_3

    .line 74
    array-length v1, p2

    if-lez v1, :cond_3

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_3

    .line 75
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_2
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_3

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/ali/auth/third/core/cookies/LoginCookie;

    .line 77
    iget-object v3, v1, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    .line 78
    array-length v4, p2

    const/4 v5, 0x0

    :goto_3
    if-ge v5, v4, :cond_2

    aget-object v6, p2, v5

    .line 79
    iput-object v6, v1, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    .line 80
    invoke-static {v1}, Lcom/ali/auth/third/core/cookies/LoginCookieUtils;->getHttpDomin(Lcom/ali/auth/third/core/cookies/LoginCookie;)Ljava/lang/String;

    move-result-object v7

    .line 82
    invoke-virtual {v1}, Lcom/ali/auth/third/core/cookies/LoginCookie;->toString()Ljava/lang/String;

    move-result-object v8

    .line 83
    sget-object v9, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->TAG:Ljava/lang/String;

    new-instance v10, Ljava/lang/StringBuilder;

    invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V

    const-string v11, "add cookies to domain:"

    invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v10, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    const-string v6, ", cookie = "

    invoke-virtual {v10, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    invoke-static {v9, v6}, Lcom/ali/auth/third/core/trace/SDKLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 84
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object v6

    invoke-interface {v6, v7, v8}, Lcom/ali/auth/third/core/WebViewProxy;->setCookie(Ljava/lang/String;Ljava/lang/String;)V

    add-int/lit8 v5, v5, 0x1

    goto :goto_3

    .line 87
    :cond_2
    iput-object v3, v1, Lcom/ali/auth/third/core/cookies/LoginCookie;->domain:Ljava/lang/String;

    goto :goto_2

    .line 91
    :cond_3
    invoke-static {}, Lcom/ali/auth/third/core/cookies/CookieManagerService;->getWebViewProxy()Lcom/ali/auth/third/core/WebViewProxy;

    move-result-object p2

    invoke-interface {p2}, Lcom/ali/auth/third/core/WebViewProxy;->flush()V

    .line 94
    iget-object p2, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    if-eqz p2, :cond_5

    .line 95
    sget-object p2, Lcom/ali/auth/third/core/context/KernelContext;->context:Landroid/content/Context;

    const-string v0, "cookies"

    const-string v1, "\u0005"

    invoke-static {v1, p1}, Landroid/text/TextUtils;->join(Ljava/lang/CharSequence;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    invoke-static {p2, v0, p1}, Lcom/ali/auth/third/core/util/FileUtils;->writeFileData(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    goto :goto_4

    .line 98
    :cond_4
    invoke-virtual {p0}, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->clearCookies()V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 101
    :cond_5
    :goto_4
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    .line 49
    monitor-exit p0

    throw p1
.end method

.method public declared-synchronized refreshCookie()V
    .locals 4

    monitor-enter p0

    .line 26
    :try_start_0
    iget-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    if-nez v0, :cond_0

    .line 29
    :try_start_1
    invoke-static {}, Lcom/ali/auth/third/core/context/KernelContext;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    const-string v1, "cookies"

    invoke-static {v0, v1}, Lcom/ali/auth/third/core/util/FileUtils;->readFileData(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 30
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 31
    sget-object v1, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->TAG:Ljava/lang/String;

    new-instance v2, Ljava/lang/StringBuilder;

    invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V

    const-string v3, "get cookie from storage:"

    invoke-virtual {v2, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v2

    invoke-static {v1, v2}, Lcom/ali/auth/third/core/trace/SDKLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    const-string v1, "\u0005"

    .line 32
    invoke-static {v0, v1}, Landroid/text/TextUtils;->split(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;
    :try_end_1
    .catch Ljava/lang/Throwable; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 39
    :catch_0
    :cond_0
    :try_start_2
    iget-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    if-eqz v0, :cond_1

    .line 40
    iget-object v0, p0, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->mCookies:[Ljava/lang/String;

    const/4 v1, 0x0

    invoke-virtual {p0, v0, v1}, Lcom/ali/auth/third/core/cookies/CookieManagerWrapper;->injectCookie([Ljava/lang/String;[Ljava/lang/String;)V
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_0

    .line 42
    :cond_1
    monitor-exit p0

    return-void

    :catchall_0
    move-exception v0

    .line 25
    monitor-exit p0

    throw v0
.end method
