.class public Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;
.super Ljava/lang/Object;
.source "SceneSwitchHelper.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;
    }
.end annotation


# static fields
.field private static a:Ljava/util/concurrent/ConcurrentHashMap;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/concurrent/ConcurrentHashMap<",
            "Ljava/lang/String;",
            "Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;",
            ">;"
        }
    .end annotation
.end field


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


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

    .line 56
    new-instance v0, Ljava/util/concurrent/ConcurrentHashMap;

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

    sput-object v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    return-void
.end method

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

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

    return-void
.end method

.method static synthetic a(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;)Landroid/content/Context;
    .locals 0

    .line 50
    iget-object p0, p0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->b:Landroid/content/Context;

    return-object p0
.end method

.method static synthetic a(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V
    .locals 0

    .line 50
    invoke-direct {p0, p1}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->b(Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V

    return-void
.end method

.method public static b(Ljava/lang/String;)Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;
    .locals 1
    .annotation build Landroid/support/annotation/Nullable;
    .end annotation

    .line 83
    sget-object v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    invoke-virtual {v0, p0}, Ljava/util/concurrent/ConcurrentHashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p0

    check-cast p0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;

    return-object p0
.end method

.method static synthetic b(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;Lcom/moji/mjweather/scenestore/model/BgStoreModel;)Ljava/lang/String;
    .locals 0

    .line 50
    invoke-direct {p0, p1}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->c(Lcom/moji/mjweather/scenestore/model/BgStoreModel;)Ljava/lang/String;

    move-result-object p0

    return-object p0
.end method

.method private b(Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V
    .locals 11

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

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

    invoke-static {}, Lcom/moji/tool/FilePathUtil;->n()Ljava/lang/String;

    move-result-object v1

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

    iget-object v1, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v1, v1, Lcom/moji/http/scenestore/SceneList$List$ChildList;->themeId:Ljava/lang/String;

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

    sget-object v1, Ljava/io/File;->separator:Ljava/lang/String;

    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

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

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

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

    iget-object v2, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v2, v2, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-static {v2}, Lcom/moji/tool/MD5Util;->b(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

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

    move-result-object v2

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

    const-string v2, ".json"

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

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

    move-result-object v1

    .line 92
    new-instance v2, Lcom/moji/download/MJDownloadRequest;

    iget-object v3, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v3, v3, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-direct {v2, v3, v1}, Lcom/moji/download/MJDownloadRequest;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    const/4 v3, 0x0

    .line 95
    :try_start_0
    sget-object v4, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v5, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v5, v5, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    new-instance v6, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;

    iget-object v7, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v7, v7, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    const/4 v8, 0x0

    invoke-direct {v6, v7, v8, v3}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;-><init>(Ljava/lang/String;FZ)V

    invoke-virtual {v4, v5, v6}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    .line 96
    invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;

    move-result-object v4

    new-instance v5, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;

    iget-object v6, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v6, v6, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-direct {v5, v8, v6, v3}, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;-><init>(FLjava/lang/String;Z)V

    invoke-virtual {v4, v5}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V

    .line 97
    invoke-static {}, Lcom/moji/download/MJDownLoadManager;->a()Lcom/moji/download/MJDownLoadManager;

    move-result-object v4

    invoke-virtual {v4, v2}, Lcom/moji/download/MJDownLoadManager;->b(Lcom/moji/download/MJDownloadRequest;)Z

    move-result v2

    if-eqz v2, :cond_6

    .line 100
    invoke-static {v1}, Lcom/moji/weathersence/data/ThemeConfig$ThemeConfigFactory;->a(Ljava/lang/String;)Lcom/moji/weathersence/data/ThemeConfig;

    move-result-object v1

    if-eqz v1, :cond_6

    .line 101
    iget-object v2, v1, Lcom/moji/weathersence/data/ThemeConfig;->file_arr:Ljava/util/ArrayList;

    if-eqz v2, :cond_6

    iget-object v2, v1, Lcom/moji/weathersence/data/ThemeConfig;->file_arr:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    if-lez v2, :cond_6

    .line 102
    iget-object v2, v1, Lcom/moji/weathersence/data/ThemeConfig;->file_arr:Ljava/util/ArrayList;

    invoke-virtual {v2}, Ljava/util/ArrayList;->size()I

    move-result v2

    const/4 v4, 0x0

    :goto_0
    const/4 v5, 0x1

    if-ge v4, v2, :cond_5

    .line 104
    iget-object v6, v1, Lcom/moji/weathersence/data/ThemeConfig;->file_arr:Ljava/util/ArrayList;

    invoke-virtual {v6, v4}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Ljava/lang/String;

    .line 105
    new-instance v7, Ljava/lang/StringBuilder;

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

    iget-object v8, v1, Lcom/moji/weathersence/data/ThemeConfig;->base_url:Ljava/lang/String;

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

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

    const-string v8, ".zip"

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

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

    move-result-object v7

    .line 106
    new-instance v8, Ljava/lang/StringBuilder;

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

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

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

    sget-object v9, Ljava/io/File;->separator:Ljava/lang/String;

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

    const-string v9, "scene.zip"

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

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

    move-result-object v8

    .line 109
    new-instance v9, Ljava/io/File;

    invoke-direct {v9, v8}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 110
    invoke-virtual {v9}, Ljava/io/File;->exists()Z

    move-result v10

    if-eqz v10, :cond_0

    .line 111
    invoke-static {v9}, Lcom/moji/tool/MD5Util;->a(Ljava/io/File;)Ljava/lang/String;

    move-result-object v9

    .line 112
    invoke-virtual {v6, v9}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v9

    if-eqz v9, :cond_0

    const/4 v9, 0x1

    goto :goto_1

    :cond_0
    const/4 v9, 0x0

    :goto_1
    if-nez v9, :cond_2

    .line 118
    invoke-static {}, Lcom/moji/download/MJDownLoadManager;->a()Lcom/moji/download/MJDownLoadManager;

    move-result-object v9

    new-instance v10, Lcom/moji/download/MJDownloadRequest;

    invoke-direct {v10, v7, v8}, Lcom/moji/download/MJDownloadRequest;-><init>(Ljava/lang/String;Ljava/lang/String;)V

    invoke-virtual {v9, v10}, Lcom/moji/download/MJDownLoadManager;->b(Lcom/moji/download/MJDownloadRequest;)Z

    move-result v7

    if-eqz v7, :cond_1

    goto :goto_2

    :cond_1
    const/4 v5, 0x0

    :cond_2
    :goto_2
    if-eqz v5, :cond_4

    .line 122
    new-instance v5, Ljava/lang/StringBuilder;

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

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

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

    sget-object v6, Ljava/io/File;->separator:Ljava/lang/String;

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

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

    move-result-object v5

    invoke-static {v8, v5}, Lcom/moji/tool/FileTool;->d(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_3

    goto :goto_3

    :cond_3
    int-to-float v5, v4

    int-to-float v6, v2

    div-float/2addr v5, v6

    .line 128
    invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;

    move-result-object v6

    new-instance v7, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;

    iget-object v8, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v8, v8, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-direct {v7, v5, v8, v3}, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;-><init>(FLjava/lang/String;Z)V

    invoke-virtual {v6, v7}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V

    .line 129
    sget-object v6, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v7, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v7, v7, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    new-instance v8, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;

    iget-object v9, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v9, v9, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-direct {v8, v9, v5, v3}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$DownloadItem;-><init>(Ljava/lang/String;FZ)V

    invoke-virtual {v6, v7, v8}, Ljava/util/concurrent/ConcurrentHashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    add-int/lit8 v4, v4, 0x1

    goto/16 :goto_0

    :cond_4
    const-string v0, "SceneSwitchHelper"

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

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

    const-string v2, "download fail "

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

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

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->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
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_3

    :cond_5
    const/4 v3, 0x1

    goto :goto_3

    :catchall_0
    move-exception v0

    goto :goto_5

    :catch_0
    move-exception v0

    :try_start_1
    const-string v1, "SceneSwitchHelper"

    .line 145
    invoke-static {v1, v0}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 148
    :cond_6
    :goto_3
    sget-object v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object v1, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v1, v1, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-virtual {v0, v1}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    if-eqz v3, :cond_7

    .line 154
    new-instance v0, Lcom/moji/weathersence/theme/LocalSceneDAO;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/moji/weathersence/theme/LocalSceneDAO;-><init>(Landroid/content/Context;)V

    iget-object v1, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    invoke-virtual {v0, v1}, Lcom/moji/weathersence/theme/LocalSceneDAO;->b(Lcom/moji/http/scenestore/SceneList$List$ChildList;)V

    .line 157
    new-instance v0, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    new-instance v1, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$2;

    invoke-direct {v1, p0, p1}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$2;-><init>(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V

    invoke-virtual {v0, v1}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    goto :goto_4

    .line 187
    :cond_7
    new-instance p1, Landroid/os/Handler;

    invoke-static {}, Landroid/os/Looper;->getMainLooper()Landroid/os/Looper;

    move-result-object v0

    invoke-direct {p1, v0}, Landroid/os/Handler;-><init>(Landroid/os/Looper;)V

    new-instance v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$3;

    invoke-direct {v0, p0}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$3;-><init>(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;)V

    invoke-virtual {p1, v0}, Landroid/os/Handler;->post(Ljava/lang/Runnable;)Z

    :goto_4
    return-void

    .line 148
    :goto_5
    sget-object v1, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    iget-object p1, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object p1, p1, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    invoke-virtual {v1, p1}, Ljava/util/concurrent/ConcurrentHashMap;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    .line 149
    throw v0
.end method

.method static synthetic b(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;)V
    .locals 0

    .line 50
    invoke-direct {p0}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->d()V

    return-void
.end method

.method private c(Lcom/moji/mjweather/scenestore/model/BgStoreModel;)Ljava/lang/String;
    .locals 12

    .line 200
    invoke-static {}, Ljava/util/Calendar;->getInstance()Ljava/util/Calendar;

    move-result-object v0

    .line 201
    iget-object v1, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-wide v1, v1, Lcom/moji/http/scenestore/SceneList$List$ChildList;->beginTime:J

    invoke-virtual {v0, v1, v2}, Ljava/util/Calendar;->setTimeInMillis(J)V

    const/4 v1, 0x2

    .line 203
    invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I

    move-result v2

    const/4 v3, 0x1

    add-int/2addr v2, v3

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

    move-result-object v2

    const/4 v4, 0x5

    .line 204
    invoke-virtual {v0, v4}, Ljava/util/Calendar;->get(I)I

    move-result v5

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

    move-result-object v5

    .line 205
    invoke-virtual {v0, v3}, Ljava/util/Calendar;->get(I)I

    move-result v6

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

    move-result-object v6

    .line 207
    iget-object p1, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-wide v7, p1, Lcom/moji/http/scenestore/SceneList$List$ChildList;->endTime:J

    invoke-virtual {v0, v7, v8}, Ljava/util/Calendar;->setTimeInMillis(J)V

    .line 208
    invoke-virtual {v0, v1}, Ljava/util/Calendar;->get(I)I

    move-result p1

    add-int/2addr p1, v3

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

    move-result-object p1

    .line 209
    invoke-virtual {v0, v4}, Ljava/util/Calendar;->get(I)I

    move-result v7

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

    move-result-object v7

    .line 210
    invoke-virtual {v0, v3}, Ljava/util/Calendar;->get(I)I

    move-result v0

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

    move-result-object v0

    .line 214
    invoke-virtual {v0}, Ljava/lang/Integer;->intValue()I

    move-result v8

    invoke-virtual {v6}, Ljava/lang/Integer;->intValue()I

    move-result v6

    const/4 v9, 0x4

    const/4 v10, 0x3

    const/4 v11, 0x0

    if-le v8, v6, :cond_0

    .line 215
    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v6

    const v8, 0x7f0e075a

    new-array v4, v4, [Ljava/lang/Object;

    aput-object v2, v4, v11

    aput-object v5, v4, v3

    aput-object v0, v4, v1

    aput-object p1, v4, v10

    aput-object v7, v4, v9

    invoke-virtual {v6, v8, v4}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    return-object p1

    .line 217
    :cond_0
    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v0

    const v4, 0x7f0e0759

    new-array v6, v9, [Ljava/lang/Object;

    aput-object v2, v6, v11

    aput-object v5, v6, v3

    aput-object p1, v6, v1

    aput-object v7, v6, v10

    invoke-virtual {v0, v4, v6}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method static synthetic c()Ljava/util/concurrent/ConcurrentHashMap;
    .locals 1

    .line 50
    sget-object v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a:Ljava/util/concurrent/ConcurrentHashMap;

    return-object v0
.end method

.method private d()V
    .locals 6

    .line 312
    new-instance v0, Lcom/moji/preferences/ProcessPrefer;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/moji/preferences/ProcessPrefer;-><init>(Landroid/content/Context;)V

    invoke-virtual {v0}, Lcom/moji/preferences/ProcessPrefer;->g()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 314
    new-instance v0, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;

    invoke-direct {v0}, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;-><init>()V

    .line 316
    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

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

    move-result-object v2

    invoke-virtual {v2}, Lcom/moji/account/data/AccountProvider;->d()Ljava/lang/String;

    move-result-object v2

    invoke-virtual {v0, v1, v2}, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;->a(Landroid/content/Context;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 317
    new-instance v2, Lcom/moji/weathersence/data/WeatherScenePreference;

    invoke-direct {v2}, Lcom/moji/weathersence/data/WeatherScenePreference;-><init>()V

    invoke-virtual {v2}, Lcom/moji/weathersence/data/WeatherScenePreference;->c()Ljava/lang/String;

    move-result-object v2

    const-string v3, "SceneSwitchHelper"

    .line 320
    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v5, "restoreScene  old "

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

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

    const-string v5, " current is "

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

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

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

    move-result-object v4

    invoke-static {v3, v4}, Lcom/moji/tool/log/MJLogger;->b(Ljava/lang/String;Ljava/lang/String;)V

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

    move-result v3

    if-nez v3, :cond_1

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

    move-result v2

    if-nez v2, :cond_1

    .line 324
    new-instance v2, Lcom/moji/weathersence/theme/LocalSceneDAO;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v3

    invoke-direct {v2, v3}, Lcom/moji/weathersence/theme/LocalSceneDAO;-><init>(Landroid/content/Context;)V

    invoke-virtual {v2, v1}, Lcom/moji/weathersence/theme/LocalSceneDAO;->a(Ljava/lang/String;)Z

    move-result v2

    if-eqz v2, :cond_0

    .line 326
    invoke-virtual {p0, v1}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a(Ljava/lang/String;)V

    .line 328
    :cond_0
    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v1

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

    move-result-object v2

    invoke-virtual {v2}, Lcom/moji/account/data/AccountProvider;->d()Ljava/lang/String;

    move-result-object v2

    const-string v3, ""

    invoke-virtual {v0, v1, v2, v3}, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    :cond_1
    return-void
.end method


# virtual methods
.method a()V
    .locals 1

    .line 223
    new-instance v0, Lcom/moji/weathersence/data/WeatherScenePreference;

    invoke-direct {v0}, Lcom/moji/weathersence/data/WeatherScenePreference;-><init>()V

    invoke-virtual {v0}, Lcom/moji/weathersence/data/WeatherScenePreference;->g()Ljava/lang/String;

    move-result-object v0

    .line 224
    invoke-virtual {p0, v0}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->a(Ljava/lang/String;)V

    return-void
.end method

.method public a(Landroid/content/Context;Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V
    .locals 5

    .line 68
    invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;

    move-result-object v0

    new-instance v1, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;

    iget-object v2, p2, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v2, v2, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    const/4 v3, 0x0

    const/4 v4, 0x0

    invoke-direct {v1, v3, v2, v4}, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;-><init>(FLjava/lang/String;Z)V

    invoke-virtual {v0, v1}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V

    .line 69
    iput-object p1, p0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;->b:Landroid/content/Context;

    .line 70
    invoke-static {}, Lcom/moji/tool/thread/MJThreadManager;->a()Lcom/moji/tool/thread/MJThreadManager;

    move-result-object p1

    new-instance v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$1;

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

    invoke-direct {v0, p0, v1, p2}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$1;-><init>(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;Lcom/moji/tool/thread/ThreadPriority;Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V

    sget-object p2, Lcom/moji/tool/thread/ThreadType;->IO_THREAD:Lcom/moji/tool/thread/ThreadType;

    invoke-virtual {p1, v0, p2}, Lcom/moji/tool/thread/MJThreadManager;->a(Lcom/moji/tool/thread/wrapper/MJRunnable;Lcom/moji/tool/thread/ThreadType;)V

    return-void
.end method

.method public a(Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V
    .locals 5

    .line 228
    invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;

    move-result-object v0

    new-instance v1, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;

    iget-object v2, p1, Lcom/moji/mjweather/scenestore/model/BgStoreModel;->mChildListbean:Lcom/moji/http/scenestore/SceneList$List$ChildList;

    iget-object v2, v2, Lcom/moji/http/scenestore/SceneList$List$ChildList;->packageUrl:Ljava/lang/String;

    const/4 v3, 0x0

    const/4 v4, 0x1

    invoke-direct {v1, v3, v2, v4}, Lcom/moji/mjweather/scenestore/model/SceneDownloadEvent;-><init>(FLjava/lang/String;Z)V

    invoke-virtual {v0, v1}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V

    .line 230
    invoke-static {}, Lcom/moji/tool/thread/MJThreadManager;->a()Lcom/moji/tool/thread/MJThreadManager;

    move-result-object v0

    new-instance v1, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$4;

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

    invoke-direct {v1, p0, v2, p1}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$4;-><init>(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;Lcom/moji/tool/thread/ThreadPriority;Lcom/moji/mjweather/scenestore/model/BgStoreModel;)V

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

    invoke-virtual {v0, v1, p1}, Lcom/moji/tool/thread/MJThreadManager;->a(Lcom/moji/tool/thread/wrapper/MJRunnable;Lcom/moji/tool/thread/ThreadType;)V

    return-void
.end method

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

    .line 60
    const-class v0, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;

    monitor-enter v0

    .line 61
    :try_start_0
    new-instance v1, Lcom/moji/weathersence/data/WeatherScenePreference;

    invoke-direct {v1}, Lcom/moji/weathersence/data/WeatherScenePreference;-><init>()V

    invoke-virtual {v1, p1}, Lcom/moji/weathersence/data/WeatherScenePreference;->a(Ljava/lang/String;)V

    .line 62
    invoke-static {}, Lorg/greenrobot/eventbus/EventBus;->a()Lorg/greenrobot/eventbus/EventBus;

    move-result-object p1

    new-instance v1, Lcom/moji/weathersence/SceneSwitchEvent;

    invoke-direct {v1}, Lcom/moji/weathersence/SceneSwitchEvent;-><init>()V

    invoke-virtual {p1, v1}, Lorg/greenrobot/eventbus/EventBus;->d(Ljava/lang/Object;)V

    .line 63
    monitor-exit v0

    return-void

    :catchall_0
    move-exception p1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw p1
.end method

.method public b()V
    .locals 3

    const-string v0, "SceneSwitchHelper"

    const-string v1, "restoreScene"

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

    .line 301
    invoke-static {}, Lcom/moji/tool/thread/MJThreadManager;->a()Lcom/moji/tool/thread/MJThreadManager;

    move-result-object v0

    new-instance v1, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$5;

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

    invoke-direct {v1, p0, v2}, Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper$5;-><init>(Lcom/moji/mjweather/scenestore/model/SceneSwitchHelper;Lcom/moji/tool/thread/ThreadPriority;)V

    sget-object v2, Lcom/moji/tool/thread/ThreadType;->IO_THREAD:Lcom/moji/tool/thread/ThreadType;

    invoke-virtual {v0, v1, v2}, Lcom/moji/tool/thread/MJThreadManager;->a(Lcom/moji/tool/thread/wrapper/MJRunnable;Lcom/moji/tool/thread/ThreadType;)V

    return-void
.end method

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

    .line 336
    new-instance v0, Lcom/moji/weathersence/data/WeatherScenePreference;

    invoke-direct {v0}, Lcom/moji/weathersence/data/WeatherScenePreference;-><init>()V

    invoke-virtual {v0}, Lcom/moji/weathersence/data/WeatherScenePreference;->c()Ljava/lang/String;

    move-result-object v0

    .line 337
    new-instance v1, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;

    invoke-direct {v1}, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;-><init>()V

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v1, v2, p1, v0}, Lcom/moji/mjweather/scenestore/model/UserSceneRecoder;->a(Landroid/content/Context;Ljava/lang/String;Ljava/lang/String;)V

    return-void
.end method
