.class Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;
.super Ljava/lang/Thread;
.source "DownloadManager.java"


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/moji/mjweather/voice/DownloadManager;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x2
    name = "DownloadThread"
.end annotation

.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/mjweather/voice/DownloadManager$DownloadThread$DownloadProgress;
    }
.end annotation


# instance fields
.field final synthetic a:Lcom/moji/mjweather/voice/DownloadManager;

.field private b:Z

.field private c:Lcom/moji/requestcore/DownloadRequest;

.field private d:Z


# direct methods
.method public constructor <init>(Lcom/moji/mjweather/voice/DownloadManager;Z)V
    .locals 0

    .line 288
    iput-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    const-string p1, "MJDownLoadManager.DownloadThread"

    .line 289
    invoke-direct {p0, p1}, Ljava/lang/Thread;-><init>(Ljava/lang/String;)V

    .line 290
    iput-boolean p2, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->d:Z

    return-void
.end method

.method static synthetic a(Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;Z)V
    .locals 0

    .line 282
    invoke-direct {p0, p1}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a(Z)V

    return-void
.end method

.method private a(Z)V
    .locals 6

    const-string v0, "canceled before downloading"

    .line 337
    invoke-direct {p0, v0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    .line 343
    :cond_0
    :try_start_0
    new-instance v0, Lcom/moji/http/single/VoiceDownloadRequest;

    invoke-direct {v0}, Lcom/moji/http/single/VoiceDownloadRequest;-><init>()V

    invoke-virtual {v0}, Lcom/moji/http/single/VoiceDownloadRequest;->f()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    const-string v1, "MJDownLoadManager.DownloadThread"

    .line 344
    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "infoResult = "

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

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

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

    move-result-object v2

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

    .line 345
    new-instance v1, Lcom/google/gson/Gson;

    invoke-direct {v1}, Lcom/google/gson/Gson;-><init>()V

    const-class v2, Lcom/moji/http/cdn/VoiceFileAddress;

    invoke-virtual {v1, v0, v2}, Lcom/google/gson/Gson;->fromJson(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/moji/http/cdn/VoiceFileAddress;

    .line 348
    invoke-static {}, Lcom/moji/preferences/units/SettingCenter;->a()Lcom/moji/preferences/units/SettingCenter;

    move-result-object v1

    invoke-virtual {v1}, Lcom/moji/preferences/units/SettingCenter;->c()Lcom/moji/preferences/units/VOICE_LANGUAGE;

    move-result-object v1

    invoke-virtual {v1}, Lcom/moji/preferences/units/VOICE_LANGUAGE;->name()Ljava/lang/String;

    move-result-object v1

    const/4 v2, -0x1

    invoke-virtual {v1}, Ljava/lang/String;->hashCode()I

    move-result v3

    const/16 v4, 0x86b

    const/4 v5, 0x2

    if-eq v3, v4, :cond_3

    const/16 v4, 0x903

    if-eq v3, v4, :cond_2

    const/16 v4, 0xa83

    if-eq v3, v4, :cond_1

    goto :goto_0

    :cond_1
    const-string v3, "TW"

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

    move-result v1

    if-eqz v1, :cond_4

    const/4 v2, 0x2

    goto :goto_0

    :cond_2
    const-string v3, "HK"

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

    move-result v1

    if-eqz v1, :cond_4

    const/4 v2, 0x1

    goto :goto_0

    :cond_3
    const-string v3, "CN"

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

    move-result v1

    if-eqz v1, :cond_4

    const/4 v2, 0x0

    :cond_4
    :goto_0
    packed-switch v2, :pswitch_data_0

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

    goto :goto_1

    .line 356
    :pswitch_0
    new-instance v1, Ljava/lang/StringBuilder;

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

    iget-object v2, v0, Lcom/moji/http/cdn/VoiceFileAddress;->domain:Ljava/lang/String;

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

    iget-object v0, v0, Lcom/moji/http/cdn/VoiceFileAddress;->TW:Ljava/lang/String;

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

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

    move-result-object v0

    goto :goto_2

    .line 353
    :pswitch_1
    new-instance v1, Ljava/lang/StringBuilder;

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

    iget-object v2, v0, Lcom/moji/http/cdn/VoiceFileAddress;->domain:Ljava/lang/String;

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

    iget-object v0, v0, Lcom/moji/http/cdn/VoiceFileAddress;->HK:Ljava/lang/String;

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

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

    move-result-object v0

    goto :goto_2

    .line 350
    :pswitch_2
    new-instance v1, Ljava/lang/StringBuilder;

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

    iget-object v2, v0, Lcom/moji/http/cdn/VoiceFileAddress;->domain:Ljava/lang/String;

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

    iget-object v0, v0, Lcom/moji/http/cdn/VoiceFileAddress;->CN:Ljava/lang/String;

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

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

    move-result-object v0

    goto :goto_2

    .line 359
    :goto_1
    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    iget-object v2, v0, Lcom/moji/http/cdn/VoiceFileAddress;->domain:Ljava/lang/String;

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

    iget-object v0, v0, Lcom/moji/http/cdn/VoiceFileAddress;->CN:Ljava/lang/String;

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

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

    move-result-object v0

    :goto_2
    const-string v1, "MJDownLoadManager.DownloadThread"

    .line 363
    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v3, "\u8bed\u97f3\u5305\u4e0b\u8f7d\u8def\u5f84\u4e3a:"

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

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

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

    move-result-object v2

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

    .line 364
    new-instance v1, Ljava/io/File;

    iget-object v2, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v2}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v2

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

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

    move-result v2

    if-nez v2, :cond_5

    .line 366
    invoke-virtual {v1}, Ljava/io/File;->mkdirs()Z

    move-result v1

    if-nez v1, :cond_5

    const-string v1, "MJDownLoadManager.DownloadThread"

    const-string v2, "File mkdirs failed"

    .line 367
    invoke-static {v1, v2}, Lcom/moji/tool/log/MJLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 374
    :cond_5
    new-instance v1, Lcom/moji/requestcore/DownloadRequest;

    new-instance v2, Ljava/lang/StringBuilder;

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

    iget-object v3, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v3}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v3

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

    iget-object v3, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v3}, Lcom/moji/mjweather/voice/DownloadManager;->i(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v3

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

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

    move-result-object v2

    new-instance v3, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread$DownloadProgress;

    invoke-direct {v3, p0, p1}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread$DownloadProgress;-><init>(Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;Z)V

    invoke-direct {v1, v2, v0, v3}, Lcom/moji/requestcore/DownloadRequest;-><init>(Ljava/lang/String;Ljava/lang/String;Lcom/moji/requestcore/ProgressListener;)V

    iput-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c:Lcom/moji/requestcore/DownloadRequest;

    .line 375
    iget-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c:Lcom/moji/requestcore/DownloadRequest;

    invoke-virtual {p1}, Lcom/moji/requestcore/DownloadRequest;->j()Z

    move-result p1

    if-eqz p1, :cond_6

    .line 377
    iget-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {p1}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object p1

    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v0

    invoke-virtual {v0, v5}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto :goto_3

    .line 379
    :cond_6
    iget-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {p1}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object p1

    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v0

    const/4 v1, 0x7

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_3

    :catch_0
    move-exception p1

    const-string v0, "MJDownLoadManager.DownloadThread"

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

    const-string p1, "canceled during downloading"

    .line 386
    invoke-direct {p0, p1}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a(Ljava/lang/String;)Z

    move-result p1

    if-nez p1, :cond_7

    .line 387
    invoke-direct {p0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c()V

    .line 388
    iget-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {p1}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object p1

    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v0

    const/4 v1, 0x5

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    invoke-virtual {p1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    :cond_7
    :goto_3
    return-void

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_2
        :pswitch_1
        :pswitch_0
    .end packed-switch
.end method

.method static synthetic a(Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;)Z
    .locals 0

    .line 282
    iget-boolean p0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->d:Z

    return p0
.end method

.method private a(Ljava/lang/String;)Z
    .locals 1

    .line 446
    invoke-direct {p0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->b()Z

    move-result v0

    if-eqz v0, :cond_0

    const-string v0, "MJDownLoadManager.DownloadThread"

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

    .line 448
    iget-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {p1}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object p1

    invoke-static {p1}, Lcom/moji/tool/FileTool;->e(Ljava/lang/String;)Z

    const/4 p1, 0x1

    return p1

    :cond_0
    const/4 p1, 0x0

    return p1
.end method

.method static synthetic b(Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;Z)V
    .locals 0

    .line 282
    invoke-direct {p0, p1}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->b(Z)V

    return-void
.end method

.method private b(Z)V
    .locals 3

    const-string v0, "canceled before unzipping"

    .line 394
    invoke-direct {p0, v0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0

    return-void

    :cond_0
    :try_start_0
    const-string v0, "MJDownLoadManager.DownloadThread"

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

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

    const-string v2, "file:"

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

    iget-object v2, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v2}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v2

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

    iget-object v2, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v2}, Lcom/moji/mjweather/voice/DownloadManager;->i(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v2

    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

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

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

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

    iget-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v1}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v1

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

    iget-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v1}, Lcom/moji/mjweather/voice/DownloadManager;->i(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v1

    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

    sget-object v1, Lcom/moji/mjweather/voice/VoiceConstants;->h:Ljava/lang/String;

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

    const-string v0, "canceled after unzipping"

    .line 402
    invoke-direct {p0, v0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a(Ljava/lang/String;)Z

    move-result v0

    if-nez v0, :cond_1

    .line 403
    invoke-direct {p0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c()V

    .line 404
    sget-object v0, Lcom/moji/mjweather/voice/VoiceConstants;->d:Ljava/lang/String;

    const-string v1, ""

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

    .line 405
    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v0

    const/4 v1, 0x4

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    .line 406
    iput p1, v0, Landroid/os/Message;->arg1:I

    .line 407
    iget-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v1}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v1

    invoke-virtual {v1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception p1

    goto :goto_1

    :catch_0
    move-exception v0

    :try_start_1
    const-string v1, "MJDownLoadManager.DownloadThread"

    const-string v2, "error to unzip: "

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

    .line 411
    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v0

    invoke-static {v0}, Lcom/moji/tool/FileTool;->e(Ljava/lang/String;)Z

    .line 412
    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v0

    const/4 v1, 0x6

    invoke-virtual {v0, v1}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v0

    .line 413
    iput p1, v0, Landroid/os/Message;->arg1:I

    .line 414
    iget-object p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {p1}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object p1

    invoke-virtual {p1, v0}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 416
    :cond_1
    :goto_0
    invoke-direct {p0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c()V

    return-void

    :goto_1
    invoke-direct {p0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c()V

    .line 417
    throw p1
.end method

.method private declared-synchronized b()Z
    .locals 1

    monitor-enter p0

    .line 438
    :try_start_0
    iget-boolean v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->b:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    monitor-exit p0

    return v0

    :catchall_0
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method private c()V
    .locals 2

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

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

    iget-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v1}, Lcom/moji/mjweather/voice/DownloadManager;->h(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v1

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

    iget-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v1}, Lcom/moji/mjweather/voice/DownloadManager;->i(Lcom/moji/mjweather/voice/DownloadManager;)Ljava/lang/String;

    move-result-object v1

    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 457
    invoke-static {v0}, Lcom/moji/tool/FileTool;->d(Ljava/lang/String;)Z

    return-void
.end method

.method private declared-synchronized c(Z)V
    .locals 0

    monitor-enter p0

    .line 442
    :try_start_0
    iput-boolean p1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->b:Z
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 443
    monitor-exit p0

    return-void

    :catchall_0
    move-exception p1

    .line 441
    monitor-exit p0

    throw p1
.end method


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

    const/4 v0, 0x1

    .line 294
    invoke-direct {p0, v0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c(Z)V

    .line 295
    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c:Lcom/moji/requestcore/DownloadRequest;

    if-eqz v0, :cond_0

    .line 296
    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->c:Lcom/moji/requestcore/DownloadRequest;

    invoke-virtual {v0}, Lcom/moji/requestcore/DownloadRequest;->h_()V

    :cond_0
    return-void
.end method

.method public run()V
    .locals 3

    .line 302
    invoke-static {}, Landroid/os/Looper;->prepare()V

    .line 304
    new-instance v0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread$1;

    invoke-direct {v0, p0}, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread$1;-><init>(Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;)V

    .line 327
    iget-object v1, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v1}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v1

    const/4 v2, 0x0

    invoke-virtual {v1, v2}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;

    move-result-object v1

    .line 328
    iput-object v0, v1, Landroid/os/Message;->obj:Ljava/lang/Object;

    .line 329
    iget-boolean v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->d:Z

    iput v0, v1, Landroid/os/Message;->arg1:I

    .line 330
    iget-object v0, p0, Lcom/moji/mjweather/voice/DownloadManager$DownloadThread;->a:Lcom/moji/mjweather/voice/DownloadManager;

    invoke-static {v0}, Lcom/moji/mjweather/voice/DownloadManager;->g(Lcom/moji/mjweather/voice/DownloadManager;)Landroid/os/Handler;

    move-result-object v0

    invoke-virtual {v0, v1}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    .line 331
    invoke-static {}, Landroid/os/Looper;->loop()V

    const-string v0, "MJDownLoadManager.DownloadThread"

    const-string v1, "download thread returns"

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

    return-void
.end method
