.class public abstract Lcom/moji/mjweather/me/presenter/LoginPresenter;
.super Lcom/moji/mjweather/me/presenter/BaseAccountPresenter;
.source "LoginPresenter.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "<V::",
        "Lcom/moji/mjweather/me/view/ILoginView;",
        ">",
        "Lcom/moji/mjweather/me/presenter/BaseAccountPresenter<",
        "Lcom/moji/mjweather/me/AccountApi;",
        "TV;>;"
    }
.end annotation


# instance fields
.field private a:Lcom/moji/http/ugc/bean/account/LoginResultEntity;

.field protected c:Lcom/moji/account/data/UserInfoSQLiteManager;


# direct methods
.method public constructor <init>(Lcom/moji/mjweather/me/view/ILoginView;)V
    .locals 0
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(TV;)V"
        }
    .end annotation

    .line 46
    invoke-direct {p0, p1}, Lcom/moji/mjweather/me/presenter/BaseAccountPresenter;-><init>(Lcom/moji/mjweather/me/view/IBaseAccountInputView;)V

    .line 47
    invoke-virtual {p0}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->n()Landroid/content/Context;

    move-result-object p1

    invoke-static {p1}, Lcom/moji/account/data/UserInfoSQLiteManager;->a(Landroid/content/Context;)Lcom/moji/account/data/UserInfoSQLiteManager;

    move-result-object p1

    iput-object p1, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->c:Lcom/moji/account/data/UserInfoSQLiteManager;

    return-void
.end method

.method static synthetic a(Lcom/moji/mjweather/me/presenter/LoginPresenter;Lcom/moji/http/ugc/bean/account/LoginResultEntity;)Lcom/moji/http/ugc/bean/account/LoginResultEntity;
    .locals 0

    .line 38
    iput-object p1, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->a:Lcom/moji/http/ugc/bean/account/LoginResultEntity;

    return-object p1
.end method

.method static synthetic a(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic a(Lcom/moji/mjweather/me/presenter/LoginPresenter;I)Ljava/lang/String;
    .locals 0

    .line 38
    invoke-direct {p0, p1}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->b(I)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method private a(Landroid/content/Context;Ljava/lang/String;)V
    .locals 1

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

    move-result v0

    if-eqz v0, :cond_0

    return-void

    :cond_0
    if-nez p1, :cond_1

    return-void

    .line 144
    :cond_1
    :try_start_0
    new-instance v0, Lcom/moji/http/cs/UserCreditRequest;

    invoke-direct {v0, p2}, Lcom/moji/http/cs/UserCreditRequest;-><init>(Ljava/lang/String;)V

    .line 145
    new-instance p2, Lcom/moji/credit/util/CreditSharedPref;

    invoke-direct {p2, p1}, Lcom/moji/credit/util/CreditSharedPref;-><init>(Landroid/content/Context;)V

    .line 147
    invoke-virtual {v0}, Lcom/moji/http/cs/UserCreditRequest;->f()Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Lcom/moji/http/cs/entity/UserCreditResp;

    if-nez p1, :cond_2

    const-string p1, "LoginPresenter"

    const-string p2, " login get credit failed : null"

    .line 149
    invoke-static {p1, p2}, Lcom/moji/tool/log/MJLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    return-void

    .line 153
    :cond_2
    invoke-virtual {p1}, Lcom/moji/http/cs/entity/UserCreditResp;->OK()Z

    move-result v0

    if-eqz v0, :cond_4

    .line 154
    iget p1, p1, Lcom/moji/http/cs/entity/UserCreditResp;->count:I

    if-lez p1, :cond_3

    .line 156
    sget-object v0, Lcom/moji/credit/util/CreditSharedPref$KeyConstant;->USER_CREDIT:Lcom/moji/credit/util/CreditSharedPref$KeyConstant;

    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {p2, v0, p1}, Lcom/moji/credit/util/CreditSharedPref;->a(Lcom/moji/tool/preferences/core/IPreferKey;Ljava/lang/Number;)V

    goto :goto_0

    :cond_3
    const-string p1, "LoginPresenter"

    const-string v0, " login get credit failed: no point return from server"

    .line 158
    invoke-static {p1, v0}, Lcom/moji/tool/log/MJLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 159
    sget-object p1, Lcom/moji/credit/util/CreditSharedPref$KeyConstant;->USER_CREDIT:Lcom/moji/credit/util/CreditSharedPref$KeyConstant;

    const/4 v0, -0x1

    invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object v0

    invoke-virtual {p2, p1, v0}, Lcom/moji/credit/util/CreditSharedPref;->a(Lcom/moji/tool/preferences/core/IPreferKey;Ljava/lang/Number;)V

    goto :goto_0

    :cond_4
    const-string p1, "LoginPresenter"

    const-string p2, " login get credit failed:"

    .line 162
    invoke-static {p1, p2}, Lcom/moji/tool/log/MJLogger;->d(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception p1

    const-string p2, "LoginPresenter"

    .line 165
    invoke-static {p2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V

    :goto_0
    return-void
.end method

.method static synthetic a(Lcom/moji/mjweather/me/presenter/LoginPresenter;Landroid/content/Context;Ljava/lang/String;)V
    .locals 0

    .line 38
    invoke-direct {p0, p1, p2}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->a(Landroid/content/Context;Ljava/lang/String;)V

    return-void
.end method

.method static synthetic b(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method private b(I)Ljava/lang/String;
    .locals 0

    packed-switch p1, :pswitch_data_0

    :pswitch_0
    const-string p1, "Moji"

    return-object p1

    :pswitch_1
    const-string p1, "Xiaomi"

    return-object p1

    :pswitch_2
    const-string p1, "Weixin"

    return-object p1

    :pswitch_3
    const-string p1, "Kakao"

    return-object p1

    :pswitch_4
    const-string p1, "Twtter"

    return-object p1

    :pswitch_5
    const-string p1, "Facebook"

    return-object p1

    :pswitch_6
    const-string p1, "Tencent"

    return-object p1

    :pswitch_7
    const-string p1, "Sina"

    return-object p1

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_7
        :pswitch_6
        :pswitch_5
        :pswitch_4
        :pswitch_3
        :pswitch_2
        :pswitch_0
        :pswitch_1
    .end packed-switch
.end method

.method static synthetic c(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic d(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic e(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic f(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic g(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Landroid/content/Context;
    .locals 0

    .line 38
    invoke-virtual {p0}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->n()Landroid/content/Context;

    move-result-object p0

    return-object p0
.end method

.method static synthetic h(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic i(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Lcom/moji/mvpframe/IMJMvpView;
    .locals 0

    .line 38
    iget-object p0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    return-object p0
.end method

.method static synthetic j(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Landroid/content/Context;
    .locals 0

    .line 38
    invoke-virtual {p0}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->n()Landroid/content/Context;

    move-result-object p0

    return-object p0
.end method

.method static synthetic k(Lcom/moji/mjweather/me/presenter/LoginPresenter;)Landroid/content/Context;
    .locals 0

    .line 38
    invoke-virtual {p0}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->n()Landroid/content/Context;

    move-result-object p0

    return-object p0
.end method


# virtual methods
.method abstract a(Lcom/moji/http/ugc/bean/account/UserInfoEntity;)Lcom/moji/account/data/UserInfo;
.end method

.method protected a(ZI)Lcom/moji/requestcore/MJBaseHttpCallback;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(ZI)",
            "Lcom/moji/requestcore/MJBaseHttpCallback<",
            "Lcom/moji/http/ugc/bean/account/LoginResultEntity;",
            ">;"
        }
    .end annotation

    .line 56
    new-instance v0, Lcom/moji/mjweather/me/presenter/LoginPresenter$1;

    invoke-direct {v0, p0, p1, p2}, Lcom/moji/mjweather/me/presenter/LoginPresenter$1;-><init>(Lcom/moji/mjweather/me/presenter/LoginPresenter;ZI)V

    return-object v0
.end method

.method public a(ILjava/lang/String;Ljava/lang/String;I)V
    .locals 2

    .line 80
    iget-object v0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->e:Ljava/lang/Object;

    check-cast v0, Lcom/moji/mjweather/me/AccountApi;

    new-instance v1, Lcom/moji/mjweather/me/presenter/LoginPresenter$2;

    invoke-direct {v1, p0, p0, p4}, Lcom/moji/mjweather/me/presenter/LoginPresenter$2;-><init>(Lcom/moji/mjweather/me/presenter/LoginPresenter;Lcom/moji/mvpframe/BasePresenter;I)V

    invoke-virtual {v0, p1, p2, p3, v1}, Lcom/moji/mjweather/me/AccountApi;->a(ILjava/lang/String;Ljava/lang/String;Lcom/moji/requestcore/MJHttpCallback;)V

    return-void
.end method

.method public a(Lcom/moji/http/ugc/bean/account/LoginResultEntity;I)V
    .locals 2

    .line 102
    new-instance v0, Lcom/moji/mjweather/me/presenter/LoginPresenter$3;

    sget-object v1, Lcom/moji/tool/thread/ThreadPriority;->NORMAL:Lcom/moji/tool/thread/ThreadPriority;

    invoke-direct {v0, p0, v1, p1, p2}, Lcom/moji/mjweather/me/presenter/LoginPresenter$3;-><init>(Lcom/moji/mjweather/me/presenter/LoginPresenter;Lcom/moji/tool/thread/ThreadPriority;Lcom/moji/http/ugc/bean/account/LoginResultEntity;I)V

    sget-object p1, Lcom/moji/tool/thread/ThreadType;->NORMAL_THREAD:Lcom/moji/tool/thread/ThreadType;

    const/4 p2, 0x0

    new-array p2, p2, [Ljava/lang/Void;

    .line 129
    invoke-virtual {v0, p1, p2}, Lcom/moji/mjweather/me/presenter/LoginPresenter$3;->a(Lcom/moji/tool/thread/ThreadType;[Ljava/lang/Object;)Lcom/moji/tool/thread/task/MJAsyncTask;

    return-void
.end method

.method public a(Lcom/moji/http/ugc/bean/account/UserInfoEntity;I)V
    .locals 2

    .line 175
    invoke-virtual {p0, p1}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->a(Lcom/moji/http/ugc/bean/account/UserInfoEntity;)Lcom/moji/account/data/UserInfo;

    move-result-object p1

    if-nez p1, :cond_0

    .line 177
    iget-object p1, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->f:Lcom/moji/mvpframe/IMJMvpView;

    check-cast p1, Lcom/moji/mjweather/me/view/ILoginView;

    const/4 p2, 0x0

    invoke-interface {p1, p2}, Lcom/moji/mjweather/me/view/ILoginView;->saveUserInfoSuccess(Lcom/moji/account/data/UserInfo;)V

    return-void

    :cond_0
    const-string v0, "LoginPresenter"

    .line 180
    invoke-virtual {p1}, Lcom/moji/account/data/UserInfo;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 181
    new-instance v0, Lcom/moji/mjweather/me/presenter/LoginPresenter$4;

    sget-object v1, Lcom/moji/tool/thread/ThreadPriority;->NORMAL:Lcom/moji/tool/thread/ThreadPriority;

    invoke-direct {v0, p0, v1, p1, p2}, Lcom/moji/mjweather/me/presenter/LoginPresenter$4;-><init>(Lcom/moji/mjweather/me/presenter/LoginPresenter;Lcom/moji/tool/thread/ThreadPriority;Lcom/moji/account/data/UserInfo;I)V

    sget-object p1, Lcom/moji/tool/thread/ThreadType;->NORMAL_THREAD:Lcom/moji/tool/thread/ThreadType;

    const/4 p2, 0x0

    new-array p2, p2, [Ljava/lang/Void;

    .line 218
    invoke-virtual {v0, p1, p2}, Lcom/moji/mjweather/me/presenter/LoginPresenter$4;->a(Lcom/moji/tool/thread/ThreadType;[Ljava/lang/Object;)Lcom/moji/tool/thread/task/MJAsyncTask;

    return-void
.end method

.method protected synthetic b()Ljava/lang/Object;
    .locals 1

    .line 38
    invoke-virtual {p0}, Lcom/moji/mjweather/me/presenter/LoginPresenter;->d()Lcom/moji/mjweather/me/AccountApi;

    move-result-object v0

    return-object v0
.end method

.method protected d()Lcom/moji/mjweather/me/AccountApi;
    .locals 1

    .line 52
    new-instance v0, Lcom/moji/mjweather/me/AccountApi;

    invoke-direct {v0}, Lcom/moji/mjweather/me/AccountApi;-><init>()V

    return-object v0
.end method

.method public e(Ljava/lang/String;)V
    .locals 3

    .line 257
    invoke-static {}, Lcom/moji/preferences/AccountPrefer;->c()Lcom/moji/preferences/AccountPrefer;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/moji/preferences/AccountPrefer;->a(Ljava/lang/String;)V

    const-string v0, "LoginPresenter"

    .line 258
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "\u4fdd\u5b58\u5386\u53f2\u767b\u5f55\u4fe1\u606f\u6210\u529f username is "

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

    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

    invoke-static {v0, p1}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method

.method public h()V
    .locals 1

    .line 133
    invoke-static {}, Lcom/moji/account/data/AccountProvider;->a()Lcom/moji/account/data/AccountProvider;

    move-result-object v0

    invoke-virtual {v0}, Lcom/moji/account/data/AccountProvider;->b()V

    return-void
.end method

.method public i()Z
    .locals 2

    .line 249
    iget-object v0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->a:Lcom/moji/http/ugc/bean/account/LoginResultEntity;

    if-eqz v0, :cond_0

    .line 252
    iget-object v0, p0, Lcom/moji/mjweather/me/presenter/LoginPresenter;->a:Lcom/moji/http/ugc/bean/account/LoginResultEntity;

    invoke-static {v0}, Lcom/moji/mjweather/me/AccountUtils;->a(Lcom/moji/http/ugc/bean/account/LoginResultEntity;)Z

    move-result v0

    return v0

    .line 250
    :cond_0
    new-instance v0, Ljava/lang/RuntimeException;

    const-string v1, "before use this method,please make sure you have  execute loginBySnsCode"

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

    throw v0
.end method

.method public j()Ljava/lang/String;
    .locals 1

    .line 262
    invoke-static {}, Lcom/moji/preferences/AccountPrefer;->c()Lcom/moji/preferences/AccountPrefer;

    move-result-object v0

    invoke-virtual {v0}, Lcom/moji/preferences/AccountPrefer;->d()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method
