.class Lcom/baidu/mobads/g/i;
.super Landroid/os/Handler;
.source "SourceFile"


# instance fields
.field final synthetic a:Lcom/baidu/mobads/g/g;


# direct methods
.method constructor <init>(Lcom/baidu/mobads/g/g;Landroid/os/Looper;)V
    .locals 0

    .line 122
    iput-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

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

    return-void
.end method


# virtual methods
.method public handleMessage(Landroid/os/Message;)V
    .locals 7

    .line 125
    invoke-virtual {p1}, Landroid/os/Message;->getData()Landroid/os/Bundle;

    move-result-object v0

    const-string v1, "CODE"

    invoke-virtual {v0, v1}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 126
    invoke-virtual {p1}, Landroid/os/Message;->getData()Landroid/os/Bundle;

    move-result-object p1

    const-string v1, "APK_INFO"

    invoke-virtual {p1, v1}, Landroid/os/Bundle;->getParcelable(Ljava/lang/String;)Landroid/os/Parcelable;

    move-result-object p1

    check-cast p1, Lcom/baidu/mobads/g/e;

    const-string v1, "OK"

    .line 128
    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    const/4 v2, 0x2

    const/4 v3, 0x1

    const/4 v4, 0x0

    if-eqz v1, :cond_3

    .line 129
    new-instance v0, Lcom/baidu/mobads/g/b;

    invoke-virtual {p1}, Lcom/baidu/mobads/g/e;->e()Ljava/lang/String;

    move-result-object v1

    iget-object v5, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {v5}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g;)Landroid/content/Context;

    move-result-object v5

    invoke-direct {v0, v1, v5, p1}, Lcom/baidu/mobads/g/b;-><init>(Ljava/lang/String;Landroid/content/Context;Lcom/baidu/mobads/g/e;)V

    .line 138
    :try_start_0
    iget-object v1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    iget-object v1, v1, Lcom/baidu/mobads/g/g;->g:Landroid/os/Handler;

    sget-object v5, Lcom/baidu/mobads/g/g;->f:Landroid/os/Handler;

    if-ne v1, v5, :cond_1

    .line 140
    invoke-virtual {v0}, Lcom/baidu/mobads/g/b;->a()V

    .line 142
    invoke-static {}, Lcom/baidu/mobads/g/g;->e()Ljava/lang/String;

    move-result-object v1

    .line 143
    invoke-virtual {v0, v1}, Lcom/baidu/mobads/g/b;->a(Ljava/lang/String;)V

    .line 144
    sget-object v1, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    if-eqz v1, :cond_0

    .line 145
    sget-object v1, Lcom/baidu/mobads/g/g;->b:Lcom/baidu/mobads/g/a;

    invoke-virtual {p1}, Lcom/baidu/mobads/g/e;->b()D

    move-result-wide v5

    iput-wide v5, v1, Lcom/baidu/mobads/g/a;->a:D

    .line 148
    :cond_0
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/g;)Z

    move-result p1

    if-eqz p1, :cond_2

    .line 150
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1, v4}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g;Z)Z

    .line 151
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    iget-object v1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {v1}, Lcom/baidu/mobads/g/g;->c(Lcom/baidu/mobads/g/g;)Z

    move-result v1

    const-string v5, "load remote file just downloaded"

    invoke-static {p1, v1, v5}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g;ZLjava/lang/String;)V

    goto :goto_0

    .line 155
    :cond_1
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1, v0}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g;Lcom/baidu/mobads/g/b;)V

    .line 156
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {}, Lcom/baidu/mobads/g/g;->e()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, p1}, Lcom/baidu/mobads/g/b;->a(Ljava/lang/String;)V

    .line 157
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1, v3}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/g;Z)V
    :try_end_0
    .catch Lcom/baidu/mobads/g/g$a; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 164
    :cond_2
    :goto_0
    invoke-virtual {v0}, Lcom/baidu/mobads/g/b;->delete()Z

    goto :goto_2

    :catchall_0
    move-exception p1

    goto :goto_1

    :catch_0
    move-exception p1

    .line 160
    :try_start_1
    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v5, "download apk file failed: "

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

    invoke-virtual {p1}, Lcom/baidu/mobads/g/g$a;->toString()Ljava/lang/String;

    move-result-object p1

    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

    .line 161
    iget-object v1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {v1, v4}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/g;Z)V

    .line 162
    iget-object v1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {v1}, Lcom/baidu/mobads/g/g;->d(Lcom/baidu/mobads/g/g;)Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    move-result-object v1

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

    const-string v5, "XAdApkLoader"

    aput-object v5, v2, v4

    aput-object p1, v2, v3

    invoke-interface {v1, v2}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->e([Ljava/lang/Object;)I
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    goto :goto_0

    .line 164
    :goto_1
    invoke-virtual {v0}, Lcom/baidu/mobads/g/b;->delete()Z

    throw p1

    .line 167
    :cond_3
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1}, Lcom/baidu/mobads/g/g;->d(Lcom/baidu/mobads/g/g;)Lcom/baidu/mobads/interfaces/utils/IXAdLogger;

    move-result-object p1

    new-array v1, v2, [Ljava/lang/Object;

    const-string v2, "XAdApkLoader"

    aput-object v2, v1, v4

    new-instance v2, Ljava/lang/StringBuilder;

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

    const-string v5, "mOnApkDownloadCompleted: download failed, code: "

    invoke-virtual {v2, v5}, 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 v0

    aput-object v0, v1, v3

    invoke-interface {p1, v1}, Lcom/baidu/mobads/interfaces/utils/IXAdLogger;->e([Ljava/lang/Object;)I

    .line 168
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1, v4}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/g;Z)V

    .line 169
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1}, Lcom/baidu/mobads/g/g;->b(Lcom/baidu/mobads/g/g;)Z

    move-result p1

    if-eqz p1, :cond_4

    .line 170
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    invoke-static {p1, v4}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g;Z)Z

    .line 171
    iget-object p1, p0, Lcom/baidu/mobads/g/i;->a:Lcom/baidu/mobads/g/g;

    const-string v0, "Refused to download remote for version..."

    invoke-static {p1, v4, v0}, Lcom/baidu/mobads/g/g;->a(Lcom/baidu/mobads/g/g;ZLjava/lang/String;)V

    :cond_4
    :goto_2
    return-void
.end method
