SmartHomeSDK.smali

.class public Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;
.super Ljava/lang/Object;


# static fields
.field public static DEBUG:Z = false

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

.field private static final XIAOBAO_STAT_ID:I = 0x3

.field private static final XIAOYA_STAT_ID:I = 0x1

.field private static sInstance:Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;

.field public static themeId:I


# instance fields
.field private appContext:Landroid/content/Context;

.field private optInterface:Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;


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

    sget v0, Lcom/cmcm/xiaobao/phone/smarthome/R$style;->sh_sdk_default_theme:I

    sput v0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->themeId:I

    const/4 v0, 0x1

    sput-boolean v0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->DEBUG:Z

    return-void
.end method

.method private constructor <init>()V
    .registers 1

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

    return-void
.end method

.method public static getInstance()Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;
    .registers 2

    sget-object v0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->sInstance:Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;

    if-nez v0, :cond_f

    const-class v1, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;

    monitor-enter v1

    :try_start_7
    new-instance v0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;

    invoke-direct {v0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;-><init>()V

    sput-object v0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->sInstance:Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;

    monitor-exit v1
    :try_end_f
    .catchall {:try_start_7 .. :try_end_f} :catchall_12

    :cond_f
    sget-object v0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->sInstance:Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;

    return-object v0

    :catchall_12
    move-exception v0

    :try_start_13
    monitor-exit v1
    :try_end_14
    .catchall {:try_start_13 .. :try_end_14} :catchall_12

    throw v0
.end method

.method public static initSmartHomeBindState(Ljava/util/List;)V
    .registers 5
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    invoke-static {}, Lcom/sdk/orion/orion/OrionClient;->getInstance()Lcom/sdk/orion/orion/OrionClient;

    move-result-object v0

    const-string/jumbo v1, "/SmartHome/checkBindThirdPartyInfo"

    new-instance v2, Lcom/cmcm/xiaobao/phone/smarthome/model/PlantFormAuthTypes;

    invoke-direct {v2, p0}, Lcom/cmcm/xiaobao/phone/smarthome/model/PlantFormAuthTypes;-><init>(Ljava/util/List;)V

    new-instance v3, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK$1;

    invoke-direct {v3}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK$1;-><init>()V

    invoke-virtual {v0, v1, v2, v3}, Lcom/sdk/orion/orion/OrionClient;->getSmartHomeSdk(Ljava/lang/String;Ljava/lang/Object;Lcom/sdk/orion/callback/ContentCallBack;)V

    return-void
.end method

.method public static setInitRegistSkill()V
    .registers 3

    invoke-static {}, Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;->getInstance()Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;

    move-result-object v0

    const/16 v1, 0xa

    const-class v2, Lcom/cmcm/xiaobao/phone/smarthome/newskill/NativeLoginSdkSkill;

    invoke-virtual {v0, v1, v2}, Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;->register(ILjava/lang/Class;)Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;

    invoke-static {}, Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;->getInstance()Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;

    move-result-object v0

    const/16 v1, 0xd

    const-class v2, Lcom/cmcm/xiaobao/phone/smarthome/newskill/OauthApiSkill;

    invoke-virtual {v0, v1, v2}, Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;->register(ILjava/lang/Class;)Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;

    invoke-static {}, Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;->getInstance()Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;

    move-result-object v0

    const/16 v1, 0x10

    const-class v2, Lcom/cmcm/xiaobao/phone/smarthome/newskill/NativeLoginApiSkill;

    invoke-virtual {v0, v1, v2}, Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;->register(ILjava/lang/Class;)Lcom/sdk/orion/lib/skillbase/OrionSkillRegister;

    return-void
.end method

.method private setLogger(Lcom/cmcm/xiaobao/phone/commons/log/LoggerListener;)V
    .registers 3

    invoke-static {}, Lcom/cmcm/xiaobao/phone/commons/log/SmartLogger;->getIns()Lcom/cmcm/xiaobao/phone/commons/log/SmartLogger;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/cmcm/xiaobao/phone/commons/log/SmartLogger;->initLogger(Lcom/cmcm/xiaobao/phone/commons/log/LoggerListener;)V

    return-void
.end method


# virtual methods
.method public forceRestartSocket()V
    .registers 2

    invoke-static {}, Lcom/cmcm/xiaobao/phone/smarthome/socket/SocketMgr;->getIns()Lcom/cmcm/xiaobao/phone/smarthome/socket/SocketMgr;

    move-result-object v0

    invoke-virtual {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/SocketMgr;->reconstructSocket()V

    return-void
.end method

.method public getAppContext()Landroid/content/Context;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->appContext:Landroid/content/Context;

    return-object v0
.end method

.method public getOpenId()V
    .registers 4

    invoke-static {}, Lcom/sdk/orion/utils/Constant;->getOpenID()Ljava/lang/String;

    move-result-object v0

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

    move-result v0

    if-nez v0, :cond_29

    const-string/jumbo v0, "SmartHomeSDK"

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string/jumbo v2, "openId==="

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

    move-result-object v1

    invoke-static {}, Lcom/sdk/orion/utils/Constant;->getOpenID()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v1

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

    move-result-object v1

    invoke-static {v0, v1}, Lcom/cmcm/xiaobao/phone/commons/log/LogUtil;->d(Ljava/lang/String;Ljava/lang/String;)V

    :goto_28
    return-void

    :cond_29
    invoke-static {}, Lcom/sdk/orion/orion/OrionClient;->getInstance()Lcom/sdk/orion/orion/OrionClient;

    move-result-object v0

    new-instance v1, Lcom/sdk/orion/callback/GetUserIDCallback;

    new-instance v2, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK$2;

    invoke-direct {v2, p0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK$2;-><init>(Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;)V

    invoke-direct {v1, v2}, Lcom/sdk/orion/callback/GetUserIDCallback;-><init>(Lcom/sdk/orion/callback/MobileRegisterCallBack;)V

    invoke-virtual {v0, v1}, Lcom/sdk/orion/orion/OrionClient;->getUserID(Lcom/sdk/orion/callback/GetUserIDCallback;)V

    goto :goto_28
.end method

.method public getOptInterface()Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->optInterface:Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;

    return-object v0
.end method

.method public getStatId()I
    .registers 2

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->isXiaobao()Z

    move-result v0

    if-eqz v0, :cond_8

    const/4 v0, 0x3

    :goto_7
    return v0

    :cond_8
    const/4 v0, 0x1

    goto :goto_7
.end method

.method public init(Landroid/content/Context;ZLjava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;)Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;
    .registers 10
    .param p7    # Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;
        .annotation build Landroid/support/annotation/NonNull;
        .end annotation
    .end param

    iput-object p7, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->optInterface:Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->getOpenId()V

    invoke-static {}, Lcom/h/s/Config;->getInstance()Lcom/h/s/Config;

    move-result-object v0

    invoke-virtual {v0, p3, p4, p5, p6}, Lcom/h/s/Config;->init(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    sput-boolean p2, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->DEBUG:Z

    iput-object p1, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->appContext:Landroid/content/Context;

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->appContext:Landroid/content/Context;

    invoke-static {v0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/ChannelUtil;->init(Landroid/content/Context;)V

    invoke-virtual {p0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->startSocket()V

    new-instance v0, Lcom/cmcm/xiaobao/phone/commons/log/SmartHomeLoggerListener;

    invoke-direct {v0}, Lcom/cmcm/xiaobao/phone/commons/log/SmartHomeLoggerListener;-><init>()V

    invoke-direct {p0, v0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->setLogger(Lcom/cmcm/xiaobao/phone/commons/log/LoggerListener;)V

    new-instance v0, Lcom/cmcm/xiaobao/phone/infoc/e;

    new-instance v1, Lcom/cmcm/xiaobao/phone/infoc/b;

    invoke-direct {v1}, Lcom/cmcm/xiaobao/phone/infoc/b;-><init>()V

    invoke-direct {v0, v1}, Lcom/cmcm/xiaobao/phone/infoc/e;-><init>(Lcom/cmcm/xiaobao/phone/infoc/c;)V

    invoke-static {v0, p1}, Lcom/cmcm/xiaobao/phone/infoc/a;->a(Lcom/cmcm/xiaobao/phone/infoc/e;Landroid/content/Context;)V

    new-instance v0, Lcom/sdk/orion/ui/baselibrary/report/InfocSupportHelper;

    new-instance v1, Lcom/sdk/orion/ui/baselibrary/report/HostInfocEnv;

    invoke-direct {v1}, Lcom/sdk/orion/ui/baselibrary/report/HostInfocEnv;-><init>()V

    invoke-direct {v0, v1}, Lcom/sdk/orion/ui/baselibrary/report/InfocSupportHelper;-><init>(Lcom/sdk/orion/ui/baselibrary/report/IInfocEnv;)V

    invoke-static {v0, p1}, Lcom/sdk/orion/ui/baselibrary/utils/CmSupportWrapper;->init(Lcom/sdk/orion/ui/baselibrary/report/InfocSupportHelper;Landroid/content/Context;)V

    return-object p0
.end method

.method public isXiaobao()Z
    .registers 2

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->optInterface:Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;

    if-eqz v0, :cond_e

    iget-object v0, p0, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->optInterface:Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;

    invoke-virtual {v0}, Lcom/cmcm/xiaobao/phone/smarthome/sdk/OptInterface;->isXiaobao()Z

    move-result v0

    if-eqz v0, :cond_e

    const/4 v0, 0x1

    :goto_d
    return v0

    :cond_e
    const/4 v0, 0x0

    goto :goto_d
.end method

.method public setTheme(I)Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;
    .registers 2

    sput p1, Lcom/cmcm/xiaobao/phone/smarthome/sdk/SmartHomeSDK;->themeId:I

    return-object p0
.end method

.method public startSocket()V
    .registers 2

    invoke-static {}, Lcom/cmcm/xiaobao/phone/smarthome/socket/SocketMgr;->getIns()Lcom/cmcm/xiaobao/phone/smarthome/socket/SocketMgr;

    move-result-object v0

    invoke-virtual {v0}, Lcom/cmcm/xiaobao/phone/smarthome/socket/SocketMgr;->constructSocketAtStartup()V

    return-void
.end method