.class public Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;
.super Lcom/ali/auth/third/ui/support/BaseActivityResultHandler;
.source "LoginActivityResultHandler.java"


# static fields
.field private static final TAG:Ljava/lang/String; = "login"


# direct methods
.method public constructor <init>()V
    .locals 0

    .line 40
    invoke-direct {p0}, Lcom/ali/auth/third/ui/support/BaseActivityResultHandler;-><init>()V

    return-void
.end method

.method static synthetic access$000(Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V
    .locals 0

    .line 40
    invoke-direct {p0, p1, p2, p3, p4}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    return-void
.end method

.method static synthetic access$100(Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V
    .locals 0

    .line 40
    invoke-direct {p0, p1, p2, p3}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    return-void
.end method

.method private handleCheck(Landroid/content/Intent;Lcom/ali/auth/third/core/callback/LoginCallback;)V
    .locals 4

    const-string v0, "login"

    const-string v1, "handleCheck"

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

    .line 125
    sget-object v0, Lcom/ali/auth/third/ui/context/CallbackContext;->activity:Ljava/lang/ref/WeakReference;

    if-eqz v0, :cond_1

    .line 127
    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v1

    if-eqz v1, :cond_1

    if-eqz p1, :cond_1

    const-string v1, "token"

    .line 128
    invoke-virtual {p1, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 129
    sget-object p1, Lcom/ali/auth/third/core/context/KernelContext;->executorService:Lcom/ali/auth/third/core/service/MemberExecutorService;

    new-instance v1, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler$1;

    invoke-direct {v1, p0, v0, p2}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler$1;-><init>(Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;Ljava/lang/ref/WeakReference;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    invoke-interface {p1, v1}, Lcom/ali/auth/third/core/service/MemberExecutorService;->postUITask(Ljava/lang/Runnable;)V

    return-void

    .line 139
    :cond_0
    new-instance v1, Lcom/ali/auth/third/login/task/LoginByIVTokenTask;

    invoke-virtual {v0}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Landroid/app/Activity;

    new-instance v3, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler$2;

    invoke-direct {v3, p0, v0, p2}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler$2;-><init>(Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;Ljava/lang/ref/WeakReference;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    invoke-direct {v1, v2, v3}, Lcom/ali/auth/third/login/task/LoginByIVTokenTask;-><init>(Landroid/app/Activity;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    .line 164
    sget-object p2, Landroid/os/AsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;

    const/4 v0, 0x3

    new-array v0, v0, [Ljava/lang/String;

    const/4 v2, 0x0

    const-string v3, "token"

    invoke-virtual {p1, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    aput-object v3, v0, v2

    const/4 v2, 0x1

    const-string v3, "scene"

    invoke-virtual {p1, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    aput-object v3, v0, v2

    const/4 v2, 0x2

    const-string v3, "aliusersdk_h5querystring"

    invoke-virtual {p1, v3}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p1

    aput-object p1, v0, v2

    invoke-virtual {v1, p2, v0}, Lcom/ali/auth/third/login/task/LoginByIVTokenTask;->executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroid/os/AsyncTask;

    goto :goto_0

    .line 166
    :cond_1
    sget-object p1, Lcom/ali/auth/third/core/context/KernelContext;->executorService:Lcom/ali/auth/third/core/service/MemberExecutorService;

    new-instance v1, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler$3;

    invoke-direct {v1, p0, v0, p2}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler$3;-><init>(Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;Ljava/lang/ref/WeakReference;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    invoke-interface {p1, v1}, Lcom/ali/auth/third/core/service/MemberExecutorService;->postUITask(Ljava/lang/Runnable;)V

    :goto_0
    return-void
.end method

.method private onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V
    .locals 7

    const-string v0, "login"

    const-string v1, "onLoginFailure "

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

    const/16 v0, 0x2714

    const/16 v1, 0x2713

    const/4 v2, 0x0

    const/4 v3, 0x0

    if-eqz p3, :cond_5

    .line 200
    new-array v4, v2, [Ljava/lang/Object;

    invoke-static {p4, v4}, Lcom/ali/auth/third/core/message/MessageUtils;->createMessage(I[Ljava/lang/Object;)Lcom/ali/auth/third/core/message/Message;

    move-result-object v4

    .line 201
    iget v5, v4, Lcom/ali/auth/third/core/message/Message;->code:I

    iget-object v6, v4, Lcom/ali/auth/third/core/message/Message;->message:Ljava/lang/String;

    invoke-interface {p3, v5, v6}, Lcom/ali/auth/third/core/callback/LoginCallback;->onFailure(ILjava/lang/String;)V

    .line 202
    sget-object p3, Lcom/ali/auth/third/login/UTConstants;->E_IV_LOGIN_FAILURE:Ljava/lang/String;

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

    move-result p2

    if-nez p2, :cond_5

    if-ne p4, v1, :cond_0

    .line 205
    const-class p2, Lcom/ali/auth/third/core/service/UserTrackerService;

    invoke-static {p2}, Lcom/ali/auth/third/core/context/KernelContext;->getService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Lcom/ali/auth/third/core/service/UserTrackerService;

    sget-object p3, Lcom/ali/auth/third/login/UTConstants;->E_H5_LOGIN_CANCEL:Ljava/lang/String;

    invoke-interface {p2, p3, v3}, Lcom/ali/auth/third/core/service/UserTrackerService;->send(Ljava/lang/String;Ljava/util/Map;)V

    goto/16 :goto_0

    :cond_0
    if-ne p4, v0, :cond_1

    .line 207
    const-class p2, Lcom/ali/auth/third/core/service/UserTrackerService;

    invoke-static {p2}, Lcom/ali/auth/third/core/context/KernelContext;->getService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Lcom/ali/auth/third/core/service/UserTrackerService;

    sget-object p3, Lcom/ali/auth/third/login/UTConstants;->E_TB_LOGIN_CANCEL:Ljava/lang/String;

    invoke-interface {p2, p3, v3}, Lcom/ali/auth/third/core/service/UserTrackerService;->send(Ljava/lang/String;Ljava/util/Map;)V

    goto :goto_0

    :cond_1
    const/16 p2, 0x2715

    if-ne p4, p2, :cond_3

    .line 209
    new-instance p2, Ljava/util/HashMap;

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

    .line 210
    iget p3, v4, Lcom/ali/auth/third/core/message/Message;->code:I

    .line 211
    iget-object v4, v4, Lcom/ali/auth/third/core/message/Message;->message:Ljava/lang/String;

    const-string v5, "code"

    .line 212
    new-instance v6, Ljava/lang/StringBuilder;

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

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

    const-string p3, ""

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

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

    move-result-object p3

    invoke-interface {p2, v5, p3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

    move-result p3

    if-nez p3, :cond_2

    const-string p3, "message"

    .line 214
    invoke-interface {p2, p3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 215
    :cond_2
    const-class p3, Lcom/ali/auth/third/core/service/UserTrackerService;

    invoke-static {p3}, Lcom/ali/auth/third/core/context/KernelContext;->getService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Lcom/ali/auth/third/core/service/UserTrackerService;

    sget-object v4, Lcom/ali/auth/third/login/UTConstants;->E_TB_LOGIN_FAILURE:Ljava/lang/String;

    invoke-interface {p3, v4, p2}, Lcom/ali/auth/third/core/service/UserTrackerService;->send(Ljava/lang/String;Ljava/util/Map;)V

    goto :goto_0

    .line 217
    :cond_3
    new-instance p2, Ljava/util/HashMap;

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

    .line 218
    iget p3, v4, Lcom/ali/auth/third/core/message/Message;->code:I

    .line 219
    iget-object v4, v4, Lcom/ali/auth/third/core/message/Message;->message:Ljava/lang/String;

    const-string v5, "code"

    .line 220
    new-instance v6, Ljava/lang/StringBuilder;

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

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

    const-string p3, ""

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

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

    move-result-object p3

    invoke-interface {p2, v5, p3}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

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

    move-result p3

    if-nez p3, :cond_4

    const-string p3, "message"

    .line 222
    invoke-interface {p2, p3, v4}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 223
    :cond_4
    const-class p3, Lcom/ali/auth/third/core/service/UserTrackerService;

    invoke-static {p3}, Lcom/ali/auth/third/core/context/KernelContext;->getService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Lcom/ali/auth/third/core/service/UserTrackerService;

    sget-object v4, Lcom/ali/auth/third/login/UTConstants;->E_H5_LOGIN_FAILURE:Ljava/lang/String;

    invoke-interface {p3, v4, p2}, Lcom/ali/auth/third/core/service/UserTrackerService;->send(Ljava/lang/String;Ljava/util/Map;)V

    .line 228
    :cond_5
    :goto_0
    sget-object p2, Lcom/ali/auth/third/ui/context/CallbackContext;->mGlobalLoginCallback:Lcom/ali/auth/third/core/callback/LoginCallback;

    if-eqz p2, :cond_6

    .line 229
    new-array p2, v2, [Ljava/lang/Object;

    invoke-static {p4, p2}, Lcom/ali/auth/third/core/message/MessageUtils;->createMessage(I[Ljava/lang/Object;)Lcom/ali/auth/third/core/message/Message;

    move-result-object p2

    .line 230
    sget-object p3, Lcom/ali/auth/third/ui/context/CallbackContext;->mGlobalLoginCallback:Lcom/ali/auth/third/core/callback/LoginCallback;

    iget v2, p2, Lcom/ali/auth/third/core/message/Message;->code:I

    iget-object p2, p2, Lcom/ali/auth/third/core/message/Message;->message:Ljava/lang/String;

    invoke-interface {p3, v2, p2}, Lcom/ali/auth/third/core/callback/LoginCallback;->onFailure(ILjava/lang/String;)V

    :cond_6
    if-eq p4, v1, :cond_8

    if-ne p4, v0, :cond_7

    goto :goto_1

    .line 236
    :cond_7
    sget-object p2, Lcom/ali/auth/third/core/broadcast/LoginAction;->NOTIFY_LOGIN_FAILED:Lcom/ali/auth/third/core/broadcast/LoginAction;

    invoke-static {p2}, Lcom/ali/auth/third/core/util/CommonUtils;->sendBroadcast(Lcom/ali/auth/third/core/broadcast/LoginAction;)V

    goto :goto_2

    .line 234
    :cond_8
    :goto_1
    sget-object p2, Lcom/ali/auth/third/core/broadcast/LoginAction;->NOTIFY_LOGIN_CANCEL:Lcom/ali/auth/third/core/broadcast/LoginAction;

    invoke-static {p2}, Lcom/ali/auth/third/core/util/CommonUtils;->sendBroadcast(Lcom/ali/auth/third/core/broadcast/LoginAction;)V

    :goto_2
    if-eqz p1, :cond_9

    .line 239
    instance-of p2, p1, Lcom/ali/auth/third/ui/LoginActivity;

    if-eqz p2, :cond_9

    .line 240
    sput-object v3, Lcom/ali/auth/third/ui/context/CallbackContext;->activity:Ljava/lang/ref/WeakReference;

    .line 241
    invoke-virtual {p1}, Landroid/app/Activity;->finish()V

    :cond_9
    return-void
.end method

.method private onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V
    .locals 1

    const-string p2, "login"

    const-string v0, "onLoginSuccess "

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

    const/4 p2, 0x0

    if-eqz p3, :cond_0

    .line 182
    sget-object v0, Lcom/ali/auth/third/login/context/LoginContext;->credentialService:Lcom/ali/auth/third/core/service/CredentialService;

    invoke-interface {v0}, Lcom/ali/auth/third/core/service/CredentialService;->getSession()Lcom/ali/auth/third/core/model/Session;

    move-result-object v0

    invoke-interface {p3, v0}, Lcom/ali/auth/third/core/callback/LoginCallback;->onSuccess(Lcom/ali/auth/third/core/model/Session;)V

    .line 183
    const-class p3, Lcom/ali/auth/third/core/service/UserTrackerService;

    invoke-static {p3}, Lcom/ali/auth/third/core/context/KernelContext;->getService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object p3

    check-cast p3, Lcom/ali/auth/third/core/service/UserTrackerService;

    sget-object v0, Lcom/ali/auth/third/login/UTConstants;->E_H5_LOGIN_SUCCESS:Ljava/lang/String;

    invoke-interface {p3, v0, p2}, Lcom/ali/auth/third/core/service/UserTrackerService;->send(Ljava/lang/String;Ljava/util/Map;)V

    .line 185
    :cond_0
    sget-object p3, Lcom/ali/auth/third/ui/context/CallbackContext;->mGlobalLoginCallback:Lcom/ali/auth/third/core/callback/LoginCallback;

    if-eqz p3, :cond_1

    .line 186
    sget-object p3, Lcom/ali/auth/third/ui/context/CallbackContext;->mGlobalLoginCallback:Lcom/ali/auth/third/core/callback/LoginCallback;

    sget-object v0, Lcom/ali/auth/third/login/context/LoginContext;->credentialService:Lcom/ali/auth/third/core/service/CredentialService;

    invoke-interface {v0}, Lcom/ali/auth/third/core/service/CredentialService;->getSession()Lcom/ali/auth/third/core/model/Session;

    move-result-object v0

    invoke-interface {p3, v0}, Lcom/ali/auth/third/core/callback/LoginCallback;->onSuccess(Lcom/ali/auth/third/core/model/Session;)V

    .line 188
    :cond_1
    sget-object p3, Lcom/ali/auth/third/core/broadcast/LoginAction;->NOTIFY_LOGIN_SUCCESS:Lcom/ali/auth/third/core/broadcast/LoginAction;

    invoke-static {p3}, Lcom/ali/auth/third/core/util/CommonUtils;->sendBroadcast(Lcom/ali/auth/third/core/broadcast/LoginAction;)V

    if-eqz p1, :cond_2

    .line 189
    instance-of p3, p1, Lcom/ali/auth/third/ui/LoginActivity;

    if-eqz p3, :cond_2

    .line 190
    sput-object p2, Lcom/ali/auth/third/ui/context/CallbackContext;->activity:Ljava/lang/ref/WeakReference;

    .line 191
    invoke-virtual {p1}, Landroid/app/Activity;->finish()V

    .line 192
    sput-object p2, Lcom/ali/auth/third/ui/context/CallbackContext;->loginCallback:Ljava/lang/Object;

    :cond_2
    return-void
.end method


# virtual methods
.method protected onCallbackContext(IILandroid/content/Intent;Landroid/app/Activity;Ljava/util/Map;Landroid/webkit/WebView;)V
    .locals 2
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(II",
            "Landroid/content/Intent;",
            "Landroid/app/Activity;",
            "Ljava/util/Map<",
            "Ljava/lang/Class<",
            "*>;",
            "Ljava/lang/Object;",
            ">;",
            "Landroid/webkit/WebView;",
            ")V"
        }
    .end annotation

    const-string p5, "login"

    .line 47
    new-instance p6, Ljava/lang/StringBuilder;

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

    const-string v0, "onCallbackContext requestCode="

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

    invoke-virtual {p6, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, " resultCode = "

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

    invoke-virtual {p6, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v0, " authCode = "

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

    if-nez p3, :cond_0

    const-string v0, ""

    goto :goto_0

    :cond_0
    const-string v0, "result"

    invoke-virtual {p3, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

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

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

    move-result-object p6

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

    .line 48
    invoke-static {}, Lcom/ali/auth/third/login/util/LoginStatus;->resetLoginFlag()V

    .line 50
    sget-object p5, Lcom/ali/auth/third/ui/context/CallbackContext;->loginCallback:Ljava/lang/Object;

    check-cast p5, Lcom/ali/auth/third/core/callback/LoginCallback;

    .line 53
    sget p6, Lcom/ali/auth/third/login/RequestCode;->OPEN_H5_LOGIN:I

    const/16 v0, 0x2713

    if-ne p1, p6, :cond_4

    if-eqz p5, :cond_4

    .line 55
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->SUCCESS:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_1

    const-string p1, "E_H5_LOGIN_SUCCESS"

    .line 56
    invoke-direct {p0, p4, p1, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto/16 :goto_3

    .line 57
    :cond_1
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->IGNORE:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_2

    goto/16 :goto_3

    .line 60
    :cond_2
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->CHECK:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_3

    .line 61
    invoke-direct {p0, p3, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->handleCheck(Landroid/content/Intent;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto/16 :goto_3

    :cond_3
    const-string p1, "E_H5_CANCEL_FAILURE"

    .line 65
    invoke-direct {p0, p4, p1, p5, v0}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    goto/16 :goto_3

    .line 68
    :cond_4
    sget p6, Lcom/ali/auth/third/login/RequestCode;->OPEN_TAOBAO:I

    const/4 v1, 0x0

    if-ne p1, p6, :cond_8

    if-eqz p5, :cond_8

    .line 69
    const-class p1, Lcom/ali/auth/third/core/service/UserTrackerService;

    invoke-static {p1}, Lcom/ali/auth/third/core/context/KernelContext;->getService(Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/ali/auth/third/core/service/UserTrackerService;

    const-string p6, "AUTH_TAOBAO"

    invoke-interface {p1, p6, v1}, Lcom/ali/auth/third/core/service/UserTrackerService;->send(Ljava/lang/String;Ljava/util/Map;)V

    const/4 p1, -0x1

    if-ne p2, p1, :cond_5

    if-eqz p3, :cond_5

    .line 72
    new-instance p1, Lcom/ali/auth/third/login/task/LoginAfterOpenTb;

    sget-object p2, Lcom/ali/auth/third/ui/context/CallbackContext;->activity:Ljava/lang/ref/WeakReference;

    invoke-virtual {p2}, Ljava/lang/ref/WeakReference;->get()Ljava/lang/Object;

    move-result-object p2

    check-cast p2, Landroid/app/Activity;

    invoke-direct {p1, p2, p5}, Lcom/ali/auth/third/login/task/LoginAfterOpenTb;-><init>(Landroid/app/Activity;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    .line 75
    sget-object p2, Landroid/os/AsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;

    const/4 p4, 0x1

    new-array p4, p4, [Ljava/lang/String;

    const/4 p5, 0x0

    const-string p6, "result"

    invoke-virtual {p3, p6}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    aput-object p3, p4, p5

    invoke-virtual {p1, p2, p4}, Lcom/ali/auth/third/login/task/LoginAfterOpenTb;->executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroid/os/AsyncTask;

    goto/16 :goto_3

    :cond_5
    if-nez p2, :cond_6

    const-string p1, "E_TB_LOGIN_CANCEL"

    const/16 p2, 0x2714

    .line 78
    invoke-direct {p0, p4, p1, p5, p2}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    goto/16 :goto_3

    :cond_6
    const-string p1, "login"

    .line 80
    new-instance p2, Ljava/lang/StringBuilder;

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

    const-string p6, "result from taobao : "

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

    if-nez p3, :cond_7

    const-string p3, ""

    goto :goto_1

    :cond_7
    const-string p6, "result"

    invoke-virtual {p3, p6}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    :goto_1
    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

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

    move-result-object p2

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

    const-string p1, "E_TB_LOGIN_FAILURE"

    const/16 p2, 0x2715

    .line 82
    invoke-direct {p0, p4, p1, p5, p2}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    goto :goto_3

    .line 85
    :cond_8
    sget p6, Lcom/ali/auth/third/login/RequestCode;->OPEN_QR_LOGIN:I

    if-ne p1, p6, :cond_a

    if-eqz p5, :cond_a

    .line 87
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->SUCCESS:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_9

    const-string p1, "E_QR_LOGIN_SUCCESS"

    .line 88
    invoke-direct {p0, p4, p1, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto :goto_3

    :cond_9
    const-string p1, "E_QR_CANCEL_FAILURE"

    .line 91
    invoke-direct {p0, p4, p1, p5, v0}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    goto :goto_3

    .line 94
    :cond_a
    sget p6, Lcom/ali/auth/third/login/RequestCode;->OPEN_QR_LOGIN_CONFIRM:I

    if-ne p1, p6, :cond_c

    if-eqz p5, :cond_c

    .line 96
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->SUCCESS:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_b

    const-string p1, "E_QR_LOGIN_CONFIRM_SUCCESS"

    .line 97
    invoke-direct {p0, p4, p1, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto :goto_3

    :cond_b
    const-string p1, "E_QR_LOGIN_CONFIRM_CANCEL"

    .line 100
    invoke-direct {p0, p4, p1, p5, v0}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    goto :goto_3

    .line 103
    :cond_c
    sget p6, Lcom/ali/auth/third/login/RequestCode;->OPEN_DOUBLE_CHECK:I

    if-ne p1, p6, :cond_d

    .line 104
    invoke-direct {p0, p3, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->handleCheck(Landroid/content/Intent;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto :goto_3

    .line 106
    :cond_d
    sget p3, Lcom/ali/auth/third/login/RequestCode;->OPEN_H5_UNBIND:I

    if-ne p1, p3, :cond_f

    .line 107
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->SUCCESS:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_e

    const-string p1, "E_H5_UNBIND_SUCCESS"

    .line 108
    invoke-direct {p0, p4, p1, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto :goto_2

    :cond_e
    const-string p1, "E_H5_UNBIND_FAILURE"

    .line 110
    invoke-direct {p0, p4, p1, p5, v0}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    .line 112
    :goto_2
    sput-object v1, Lcom/ali/auth/third/ui/context/CallbackContext;->loginCallback:Ljava/lang/Object;

    :cond_f
    :goto_3
    return-void
.end method

.method protected onTaeSDKActivity(IILandroid/content/Intent;Lcom/ali/auth/third/ui/webview/BaseWebViewActivity;Ljava/util/Map;Landroid/webkit/WebView;)V
    .locals 3
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(II",
            "Landroid/content/Intent;",
            "Lcom/ali/auth/third/ui/webview/BaseWebViewActivity;",
            "Ljava/util/Map<",
            "Ljava/lang/Class<",
            "*>;",
            "Ljava/lang/Object;",
            ">;",
            "Landroid/webkit/WebView;",
            ")V"
        }
    .end annotation

    const-string p5, "login"

    .line 248
    new-instance v0, Ljava/lang/StringBuilder;

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

    const-string v1, "onTaeSDKActivity requestCode="

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

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

    const-string v1, " resultCode = "

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

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

    const-string v1, " authCode = "

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

    if-nez p3, :cond_0

    const-string v1, ""

    goto :goto_0

    :cond_0
    const-string v1, "result"

    invoke-virtual {p3, v1}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

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

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

    move-result-object v0

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

    .line 249
    sget-object p5, Lcom/ali/auth/third/ui/context/CallbackContext;->loginCallback:Ljava/lang/Object;

    check-cast p5, Lcom/ali/auth/third/core/callback/LoginCallback;

    .line 251
    invoke-static {}, Lcom/ali/auth/third/login/util/LoginStatus;->resetLoginFlag()V

    .line 252
    sget v0, Lcom/ali/auth/third/login/RequestCode;->OPEN_H5_LOGIN:I

    const/4 v1, 0x0

    const/16 v2, 0x2713

    if-ne p1, v0, :cond_2

    .line 253
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->SUCCESS:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_1

    .line 254
    invoke-virtual {p6}, Landroid/webkit/WebView;->reload()V

    goto :goto_2

    .line 256
    :cond_1
    new-array p1, v1, [Ljava/lang/Object;

    invoke-static {v2, p1}, Lcom/ali/auth/third/core/model/ResultCode;->create(I[Ljava/lang/Object;)Lcom/ali/auth/third/core/model/ResultCode;

    move-result-object p1

    invoke-virtual {p4, p1}, Lcom/ali/auth/third/ui/webview/BaseWebViewActivity;->setResult(Lcom/ali/auth/third/core/model/ResultCode;)V

    goto :goto_2

    .line 258
    :cond_2
    sget v0, Lcom/ali/auth/third/login/RequestCode;->OPEN_TAOBAO:I

    if-ne p1, v0, :cond_5

    const/4 p1, -0x1

    if-ne p2, p1, :cond_3

    if-eqz p3, :cond_3

    .line 260
    new-instance p1, Lcom/ali/auth/third/login/task/RefreshPageAfterOpenTb;

    invoke-direct {p1, p4, p6}, Lcom/ali/auth/third/login/task/RefreshPageAfterOpenTb;-><init>(Landroid/app/Activity;Landroid/webkit/WebView;)V

    sget-object p2, Landroid/os/AsyncTask;->THREAD_POOL_EXECUTOR:Ljava/util/concurrent/Executor;

    const/4 p4, 0x1

    new-array p4, p4, [Ljava/lang/String;

    const-string p5, "result"

    invoke-virtual {p3, p5}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object p3

    aput-object p3, p4, v1

    invoke-virtual {p1, p2, p4}, Lcom/ali/auth/third/login/task/RefreshPageAfterOpenTb;->executeOnExecutor(Ljava/util/concurrent/Executor;[Ljava/lang/Object;)Landroid/os/AsyncTask;

    goto :goto_2

    :cond_3
    if-nez p2, :cond_4

    .line 262
    new-array p1, v1, [Ljava/lang/Object;

    invoke-static {v2, p1}, Lcom/ali/auth/third/core/model/ResultCode;->create(I[Ljava/lang/Object;)Lcom/ali/auth/third/core/model/ResultCode;

    move-result-object p1

    invoke-virtual {p4, p1}, Lcom/ali/auth/third/ui/webview/BaseWebViewActivity;->setResult(Lcom/ali/auth/third/core/model/ResultCode;)V

    goto :goto_2

    :cond_4
    const-string p1, "login"

    .line 264
    new-instance p3, Ljava/lang/StringBuilder;

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

    const-string p5, "taobao return "

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

    invoke-virtual {p3, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

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

    move-result-object p2

    invoke-static {p1, p2}, Lcom/ali/auth/third/core/trace/SDKLogger;->e(Ljava/lang/String;Ljava/lang/String;)V

    .line 265
    sget-object p1, Lcom/ali/auth/third/login/LoginComponent;->INSTANCE:Lcom/ali/auth/third/login/LoginComponent;

    invoke-virtual {p1, p4}, Lcom/ali/auth/third/login/LoginComponent;->showH5Login(Landroid/app/Activity;)V

    goto :goto_2

    .line 267
    :cond_5
    sget p3, Lcom/ali/auth/third/login/RequestCode;->OPEN_H5_UNBIND:I

    if-ne p1, p3, :cond_7

    .line 268
    sget-object p1, Lcom/ali/auth/third/core/model/ResultCode;->SUCCESS:Lcom/ali/auth/third/core/model/ResultCode;

    iget p1, p1, Lcom/ali/auth/third/core/model/ResultCode;->code:I

    if-ne p2, p1, :cond_6

    const-string p1, "E_H5_UNBIND_SUCCESS"

    .line 269
    invoke-direct {p0, p4, p1, p5}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginSuccess(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;)V

    goto :goto_1

    :cond_6
    const-string p1, "E_H5_UNBIND_FAILURE"

    .line 271
    invoke-direct {p0, p4, p1, p5, v2}, Lcom/ali/auth/third/login/handler/LoginActivityResultHandler;->onLoginFailure(Landroid/app/Activity;Ljava/lang/String;Lcom/ali/auth/third/core/callback/LoginCallback;I)V

    :goto_1
    const/4 p1, 0x0

    .line 273
    sput-object p1, Lcom/ali/auth/third/ui/context/CallbackContext;->loginCallback:Ljava/lang/Object;

    :cond_7
    :goto_2
    return-void
.end method
