.class public Lcom/moji/mjad/common/video/HandleAdMona;
.super Lcom/moji/mjad/common/video/AbsHandleZipAd;
.source "HandleAdMona.java"

# interfaces
.implements Lcom/moji/mjad/common/video/IAbsDownloadAd;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/mjad/common/video/AbsHandleZipAd;",
        "Lcom/moji/mjad/common/video/IAbsDownloadAd<",
        "Lcom/moji/mjad/base/data/AdPublish;",
        ">;"
    }
.end annotation


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

    .line 25
    invoke-direct {p0}, Lcom/moji/mjad/common/video/AbsHandleZipAd;-><init>()V

    return-void
.end method


# virtual methods
.method public a(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 4

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

    move-result v0

    const/4 v1, 0x0

    if-eqz v0, :cond_0

    return-object v1

    .line 102
    :cond_0
    invoke-virtual {p0, p1}, Lcom/moji/mjad/common/video/HandleAdMona;->a(Ljava/lang/String;)Ljava/util/Map;

    move-result-object p1

    const-string v0, ""

    const-string v2, "md5"

    .line 105
    invoke-interface {p1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_1

    const-string v0, "md5"

    .line 106
    invoke-interface {p1, v0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    :cond_1
    const-string v2, "filename"

    .line 108
    invoke-interface {p1, v2}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v2

    if-eqz v2, :cond_2

    const-string v2, "filename"

    .line 109
    invoke-interface {p1, v2}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Ljava/lang/String;

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

    move-result p1

    if-nez p1, :cond_5

    invoke-virtual {v0}, Ljava/lang/String;->length()I

    move-result p1

    const/16 v2, 0x20

    if-eq p1, v2, :cond_3

    goto :goto_0

    .line 114
    :cond_3
    new-instance p1, Ljava/io/File;

    new-instance v2, Ljava/lang/StringBuilder;

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

    sget-object v3, Lcom/moji/mjad/util/AdUtil;->l:Ljava/lang/String;

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

    const-string v3, "/"

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

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

    const-string p2, "/"

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

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

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

    move-result p2

    if-eqz p2, :cond_4

    .line 116
    invoke-virtual {p1}, Ljava/io/File;->getPath()Ljava/lang/String;

    move-result-object p1

    return-object p1

    :cond_4
    const-string p1, "zdxmona"

    const-string p2, " ----- HandleAdMona -- getLocalFileName -- file not exist  "

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

    return-object v1

    :cond_5
    :goto_0
    return-object v1
.end method

.method public a(Ljava/util/List;)Ljava/util/List;
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/mjad/base/data/AdPublish;",
            ">;)",
            "Ljava/util/List<",
            "Lcom/moji/mjad/base/data/AdPublish;",
            ">;"
        }
    .end annotation

    if-eqz p1, :cond_6

    .line 54
    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result v0

    if-nez v0, :cond_0

    goto/16 :goto_1

    .line 58
    :cond_0
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    .line 59
    :cond_1
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_5

    .line 60
    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/moji/mjad/base/data/AdPublish;

    if-eqz v1, :cond_1

    .line 61
    iget-object v2, v1, Lcom/moji/mjad/base/data/AdPublish;->url:Ljava/lang/String;

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

    move-result v2

    if-nez v2, :cond_1

    .line 62
    iget-object v2, v1, Lcom/moji/mjad/base/data/AdPublish;->url:Ljava/lang/String;

    invoke-virtual {p0, v2}, Lcom/moji/mjad/common/video/HandleAdMona;->a(Ljava/lang/String;)Ljava/util/Map;

    move-result-object v2

    const-string v3, ""

    const-string v4, ""

    const-string v5, "md5"

    .line 65
    invoke-interface {v2, v5}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_2

    const-string v3, "md5"

    .line 66
    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Ljava/lang/String;

    :cond_2
    move-object v7, v3

    const-string v3, "filename"

    .line 68
    invoke-interface {v2, v3}, Ljava/util/Map;->containsKey(Ljava/lang/Object;)Z

    move-result v3

    if-eqz v3, :cond_3

    const-string v3, "filename"

    .line 69
    invoke-interface {v2, v3}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v2

    move-object v4, v2

    check-cast v4, Ljava/lang/String;

    .line 71
    :cond_3
    invoke-static {v7}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-nez v2, :cond_1

    invoke-virtual {v7}, Ljava/lang/String;->length()I

    move-result v2

    const/16 v3, 0x20

    if-eq v2, v3, :cond_4

    goto :goto_0

    .line 74
    :cond_4
    new-instance v2, Ljava/io/File;

    new-instance v3, Ljava/lang/StringBuilder;

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

    sget-object v5, Lcom/moji/mjad/util/AdUtil;->l:Ljava/lang/String;

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

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

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

    move-result-object v3

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

    .line 75
    new-instance v3, Ljava/io/File;

    new-instance v4, Ljava/lang/StringBuilder;

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

    sget-object v5, Lcom/moji/mjad/util/AdUtil;->l:Ljava/lang/String;

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

    iget-wide v5, v1, Lcom/moji/mjad/base/data/AdPublish;->adId:J

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

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

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

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

    const-string v5, ".zip"

    invoke-virtual {v4, v5}, 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-direct {v3, v4}, Ljava/io/File;-><init>(Ljava/lang/String;)V

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

    move-result v2

    if-nez v2, :cond_1

    invoke-virtual {v3}, Ljava/io/File;->exists()Z

    move-result v2

    if-nez v2, :cond_1

    .line 77
    new-instance v2, Lcom/moji/mjad/background/network/AdDynamicMonaDownLoadTask;

    iget-wide v3, v1, Lcom/moji/mjad/base/data/AdPublish;->adId:J

    invoke-static {v3, v4}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v6

    iget-object v8, v1, Lcom/moji/mjad/base/data/AdPublish;->url:Ljava/lang/String;

    iget-wide v9, v1, Lcom/moji/mjad/base/data/AdPublish;->endTime:J

    move-object v5, v2

    invoke-direct/range {v5 .. v10}, Lcom/moji/mjad/background/network/AdDynamicMonaDownLoadTask;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;J)V

    new-instance v1, Lcom/moji/mjad/common/video/HandleAdMona$1;

    invoke-direct {v1, p0}, Lcom/moji/mjad/common/video/HandleAdMona$1;-><init>(Lcom/moji/mjad/common/video/HandleAdMona;)V

    .line 78
    invoke-virtual {v2, v1}, Lcom/moji/mjad/background/network/AdDynamicMonaDownLoadTask;->a(Lcom/moji/mjad/background/interfaces/IBgAdLoadFileCallback;)Lcom/moji/mjad/background/network/AbsDownLoadZipTask;

    move-result-object v1

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

    const/4 v3, 0x0

    new-array v3, v3, [Ljava/lang/Void;

    .line 88
    invoke-virtual {v1, v2, v3}, Lcom/moji/mjad/background/network/AbsDownLoadZipTask;->a(Lcom/moji/tool/thread/ThreadType;[Ljava/lang/Object;)Lcom/moji/tool/thread/task/MJAsyncTask;

    goto/16 :goto_0

    .line 92
    :cond_5
    invoke-virtual {p0}, Lcom/moji/mjad/common/video/HandleAdMona;->b()V

    return-object p1

    .line 55
    :cond_6
    :goto_1
    invoke-virtual {p0}, Lcom/moji/mjad/common/video/HandleAdMona;->b()V

    return-object p1
.end method

.method public a(Lcom/moji/mjad/common/data/AdCommon;Ljava/lang/String;)V
    .locals 0

    return-void
.end method

.method public b()V
    .locals 0

    .line 49
    invoke-virtual {p0}, Lcom/moji/mjad/common/video/HandleAdMona;->e()V

    return-void
.end method

.method protected c()J
    .locals 2

    .line 33
    iget-object v0, p0, Lcom/moji/mjad/common/video/HandleAdMona;->b:Lcom/moji/mjad/preferences/MojiAdPreference;

    if-nez v0, :cond_0

    .line 34
    new-instance v0, Lcom/moji/mjad/preferences/MojiAdPreference;

    invoke-direct {v0}, Lcom/moji/mjad/preferences/MojiAdPreference;-><init>()V

    iput-object v0, p0, Lcom/moji/mjad/common/video/HandleAdMona;->b:Lcom/moji/mjad/preferences/MojiAdPreference;

    .line 36
    :cond_0
    iget-object v0, p0, Lcom/moji/mjad/common/video/HandleAdMona;->b:Lcom/moji/mjad/preferences/MojiAdPreference;

    invoke-virtual {v0}, Lcom/moji/mjad/preferences/MojiAdPreference;->q()J

    move-result-wide v0

    return-wide v0
.end method

.method protected d()V
    .locals 3

    .line 41
    iget-object v0, p0, Lcom/moji/mjad/common/video/HandleAdMona;->b:Lcom/moji/mjad/preferences/MojiAdPreference;

    if-nez v0, :cond_0

    .line 42
    new-instance v0, Lcom/moji/mjad/preferences/MojiAdPreference;

    invoke-direct {v0}, Lcom/moji/mjad/preferences/MojiAdPreference;-><init>()V

    iput-object v0, p0, Lcom/moji/mjad/common/video/HandleAdMona;->b:Lcom/moji/mjad/preferences/MojiAdPreference;

    .line 44
    :cond_0
    iget-object v0, p0, Lcom/moji/mjad/common/video/HandleAdMona;->b:Lcom/moji/mjad/preferences/MojiAdPreference;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v1

    invoke-virtual {v0, v1, v2}, Lcom/moji/mjad/preferences/MojiAdPreference;->d(J)V

    return-void
.end method
