.class Lcom/moji/mjweather/weather/avatar/Mona$1;
.super Lcom/moji/tool/thread/wrapper/MJRunnable;
.source "Mona.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/moji/mjweather/weather/avatar/Mona;->a()V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic a:Landroid/content/SharedPreferences;

.field final synthetic b:Lcom/moji/mjweather/weather/avatar/Mona;


# direct methods
.method constructor <init>(Lcom/moji/mjweather/weather/avatar/Mona;Lcom/moji/tool/thread/ThreadPriority;Landroid/content/SharedPreferences;)V
    .locals 0

    .line 91
    iput-object p1, p0, Lcom/moji/mjweather/weather/avatar/Mona$1;->b:Lcom/moji/mjweather/weather/avatar/Mona;

    iput-object p3, p0, Lcom/moji/mjweather/weather/avatar/Mona$1;->a:Landroid/content/SharedPreferences;

    invoke-direct {p0, p2}, Lcom/moji/tool/thread/wrapper/MJRunnable;-><init>(Lcom/moji/tool/thread/ThreadPriority;)V

    return-void
.end method


# virtual methods
.method public run()V
    .locals 4

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

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

    sget-object v1, Lcom/moji/mjweather/weather/avatar/AvatarImageUtil;->a:Ljava/lang/String;

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

    const-string v1, "avatar"

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

    const-string v1, "mona"

    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 97
    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;

    const-string v2, "mona_gif.zip"

    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 98
    new-instance v2, Lcom/moji/download/MJDownloadRequest;

    const-string v3, "https://oss4bpc.moji.com/2018/01/25/monagif20180125.zip"

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

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

    move-result-object v3

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

    move-result v2

    if-eqz v2, :cond_0

    .line 102
    invoke-static {v1, v0}, Lcom/moji/tool/FileTool;->d(Ljava/lang/String;Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 104
    iget-object v0, p0, Lcom/moji/mjweather/weather/avatar/Mona$1;->a:Landroid/content/SharedPreferences;

    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    const-string v1, "https://oss4bpc.moji.com/2018/01/25/monagif20180125.zip"

    const/4 v2, 0x1

    invoke-interface {v0, v1, v2}, Landroid/content/SharedPreferences$Editor;->putBoolean(Ljava/lang/String;Z)Landroid/content/SharedPreferences$Editor;

    move-result-object v0

    invoke-interface {v0}, Landroid/content/SharedPreferences$Editor;->apply()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    .line 108
    invoke-virtual {v0}, Ljava/io/IOException;->printStackTrace()V

    :cond_0
    :goto_0
    return-void
.end method
