.class public abstract Lcom/moji/mjad/common/video/AbsHandleAdVideo;
.super Ljava/lang/Object;
.source "AbsHandleAdVideo.java"


# instance fields
.field private a:Lcom/moji/mjad/common/db/AdBannerVideoDBManager;

.field private b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;


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

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

    return-void
.end method

.method static synthetic a(Lcom/moji/mjad/common/video/AbsHandleAdVideo;)Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;
    .locals 0

    .line 30
    iget-object p0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    return-object p0
.end method

.method static synthetic b(Lcom/moji/mjad/common/video/AbsHandleAdVideo;)Lcom/moji/mjad/common/db/AdBannerVideoDBManager;
    .locals 0

    .line 30
    iget-object p0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->a:Lcom/moji/mjad/common/db/AdBannerVideoDBManager;

    return-object p0
.end method


# virtual methods
.method public a(Ljava/lang/String;)Ljava/util/Map;
    .locals 11

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

    move-result v0

    if-eqz v0, :cond_0

    const/4 p1, 0x0

    return-object p1

    .line 40
    :cond_0
    new-instance v0, Ljava/util/HashMap;

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

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

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

    invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object p1

    const-string v1, ""

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

    move-result v2

    if-nez v2, :cond_7

    .line 45
    invoke-virtual {p1}, Ljava/lang/String;->trim()Ljava/lang/String;

    move-result-object v2

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

    move-result-object v2

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

    move-result v3

    if-nez v3, :cond_7

    const-string v3, "?"

    .line 47
    invoke-virtual {v2, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v3

    const/4 v4, 0x0

    if-eqz v3, :cond_6

    const-string p1, ".mp4"

    const-string v3, "[?]"

    .line 49
    invoke-virtual {v2, v3}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v3

    if-eqz v3, :cond_3

    .line 51
    array-length v5, v3

    if-lez v5, :cond_1

    aget-object v5, v3, v4

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

    move-result v5

    if-nez v5, :cond_1

    aget-object v5, v3, v4

    const-string v6, "."

    invoke-virtual {v5, v6}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v5

    if-eqz v5, :cond_1

    .line 52
    aget-object p1, v3, v4

    const-string v5, "."

    invoke-virtual {v2, v5}, Ljava/lang/String;->lastIndexOf(Ljava/lang/String;)I

    move-result v5

    invoke-virtual {p1, v5}, Ljava/lang/String;->substring(I)Ljava/lang/String;

    move-result-object p1

    .line 54
    :cond_1
    array-length v5, v3

    const/4 v6, 0x1

    if-le v5, v6, :cond_3

    aget-object v5, v3, v6

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

    move-result v5

    if-nez v5, :cond_3

    .line 55
    aget-object v3, v3, v6

    const-string v5, "[&]"

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

    move-result-object v3

    if-eqz v3, :cond_3

    .line 56
    array-length v5, v3

    if-lez v5, :cond_3

    .line 57
    array-length v5, v3

    const/4 v7, 0x0

    :goto_0
    if-ge v7, v5, :cond_3

    aget-object v8, v3, v7

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

    move-result v9

    if-nez v9, :cond_2

    const-string v9, "[=]"

    .line 59
    invoke-virtual {v8, v9}, Ljava/lang/String;->split(Ljava/lang/String;)[Ljava/lang/String;

    move-result-object v8

    if-eqz v8, :cond_2

    .line 61
    array-length v9, v8

    if-le v9, v6, :cond_2

    aget-object v9, v8, v4

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

    move-result v9

    if-nez v9, :cond_2

    aget-object v9, v8, v4

    const-string v10, "md5"

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

    move-result v9

    if-eqz v9, :cond_2

    .line 63
    aget-object v1, v8, v6

    goto :goto_1

    :cond_2
    add-int/lit8 v7, v7, 0x1

    goto :goto_0

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

    move-result v3

    if-eqz v3, :cond_5

    const-string p1, "."

    .line 72
    invoke-virtual {v2, p1}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result p1

    if-eqz p1, :cond_4

    const-string p1, "."

    .line 73
    invoke-virtual {v2, p1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result p1

    invoke-virtual {v2, v4, p1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    :cond_4
    const-string p1, "?"

    .line 75
    invoke-virtual {v2, p1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result p1

    invoke-virtual {v2, v4, p1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object p1

    goto :goto_2

    .line 77
    :cond_5
    new-instance v2, Ljava/lang/StringBuilder;

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

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

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

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

    move-result-object p1

    goto :goto_2

    :cond_6
    const-string v3, "."

    .line 79
    invoke-virtual {v2, v3}, Ljava/lang/String;->contains(Ljava/lang/CharSequence;)Z

    move-result v3

    if-eqz v3, :cond_7

    const-string v1, "."

    .line 80
    invoke-virtual {v2, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v2, v4, v1}, Ljava/lang/String;->substring(II)Ljava/lang/String;

    move-result-object v1

    :cond_7
    :goto_2
    const-string v2, "md5"

    .line 85
    invoke-interface {v0, v2, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    const-string v1, "filename"

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

    return-object v0
.end method

.method protected a()V
    .locals 1

    .line 128
    iget-object v0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    if-nez v0, :cond_0

    .line 129
    new-instance v0, Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    invoke-direct {v0}, Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;-><init>()V

    iput-object v0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    .line 131
    :cond_0
    iget-object v0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->a:Lcom/moji/mjad/common/db/AdBannerVideoDBManager;

    if-nez v0, :cond_1

    .line 132
    new-instance v0, Lcom/moji/mjad/common/db/AdBannerVideoDBManager;

    invoke-direct {v0}, Lcom/moji/mjad/common/db/AdBannerVideoDBManager;-><init>()V

    iput-object v0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->a:Lcom/moji/mjad/common/db/AdBannerVideoDBManager;

    :cond_1
    return-void
.end method

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

    if-eqz p1, :cond_5

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

    move-result v0

    if-eqz v0, :cond_0

    goto :goto_1

    .line 99
    :cond_0
    invoke-virtual {p0}, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->a()V

    .line 100
    new-instance v0, Lcom/moji/mjad/common/network/AdVideoDownLoadTask;

    invoke-direct {v0, p1}, Lcom/moji/mjad/common/network/AdVideoDownLoadTask;-><init>(Lcom/moji/mjad/common/data/MojiAdData;)V

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

    const/4 v2, 0x0

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

    invoke-virtual {v0, v1, v3}, Lcom/moji/mjad/common/network/AdVideoDownLoadTask;->a(Lcom/moji/tool/thread/ThreadType;[Ljava/lang/Object;)Lcom/moji/tool/thread/task/MJAsyncTask;

    .line 101
    iget-object v0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    const-string v1, "mdPsw"

    .line 102
    invoke-virtual {v0, v1, p2}, Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;->a(Ljava/lang/String;Ljava/lang/String;)Ljava/util/List;

    move-result-object p2

    const/4 v0, 0x1

    if-eqz p2, :cond_3

    .line 105
    invoke-interface {p2}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_3

    .line 106
    invoke-interface {p2}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :cond_1
    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v3

    if-eqz v3, :cond_2

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Lcom/moji/mjad/common/data/AdVedioExpiration;

    .line 107
    iget-wide v4, p1, Lcom/moji/mjad/common/data/AdCommon;->endtime:J

    iget-wide v6, v3, Lcom/moji/mjad/common/data/AdVedioExpiration;->c:J

    cmp-long v3, v4, v6

    if-gtz v3, :cond_1

    const/4 v0, 0x0

    goto :goto_0

    :cond_2
    if-eqz v0, :cond_3

    .line 112
    invoke-interface {p2}, Ljava/util/List;->isEmpty()Z

    move-result p2

    if-nez p2, :cond_3

    .line 113
    iget-object p2, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    iget-object v1, p1, Lcom/moji/mjad/common/data/AdCommon;->videoMd5:Ljava/lang/String;

    invoke-virtual {p2, v1}, Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;->a(Ljava/lang/String;)V

    :cond_3
    if-eqz v0, :cond_4

    .line 118
    new-instance p2, Lcom/moji/mjad/common/data/AdVedioExpiration;

    invoke-direct {p2}, Lcom/moji/mjad/common/data/AdVedioExpiration;-><init>()V

    .line 119
    iget-wide v0, p1, Lcom/moji/mjad/common/data/AdCommon;->endtime:J

    iput-wide v0, p2, Lcom/moji/mjad/common/data/AdVedioExpiration;->c:J

    .line 120
    iget-object v0, p1, Lcom/moji/mjad/common/data/AdCommon;->videoMd5:Ljava/lang/String;

    iput-object v0, p2, Lcom/moji/mjad/common/data/AdVedioExpiration;->b:Ljava/lang/String;

    .line 121
    iget-object v0, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->b:Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;

    invoke-virtual {v0, p2}, Lcom/moji/mjad/common/db/VideoFileEndTimeDbManager;->a(Lcom/moji/mjad/common/data/AdVedioExpiration;)V

    .line 124
    :cond_4
    iget-object p2, p0, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->a:Lcom/moji/mjad/common/db/AdBannerVideoDBManager;

    invoke-virtual {p2, p1}, Lcom/moji/mjad/common/db/AdBannerVideoDBManager;->a(Lcom/moji/mjad/common/data/MojiAdData;)V

    return-void

    :cond_5
    :goto_1
    return-void
.end method

.method public b(Ljava/lang/String;)Ljava/lang/String;
    .locals 4

    .line 175
    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 178
    :cond_0
    invoke-virtual {p0, p1}, Lcom/moji/mjad/common/video/AbsHandleAdVideo;->a(Ljava/lang/String;)Ljava/util/Map;

    move-result-object p1

    const-string v0, ""

    const-string v2, ""

    const-string v3, "md5"

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

    move-result v3

    if-eqz v3, :cond_1

    const-string v0, "md5"

    .line 182
    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 v3, "filename"

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

    move-result v3

    if-eqz v3, :cond_2

    const-string v2, "filename"

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

    move-result-object p1

    move-object v2, p1

    check-cast v2, Ljava/lang/String;

    .line 187
    :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 v0, 0x20

    if-eq p1, v0, :cond_3

    goto :goto_0

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

    new-instance v0, Ljava/lang/StringBuilder;

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

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

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

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

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

    move-result-object v0

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

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

    move-result v0

    if-eqz v0, :cond_4

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

    move-result-object p1

    return-object p1

    :cond_4
    return-object v1

    :cond_5
    :goto_0
    return-object v1
.end method

.method public b()V
    .locals 3

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

    move-result-object v0

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

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

    invoke-direct {v1, p0, v2}, Lcom/moji/mjad/common/video/AbsHandleAdVideo$1;-><init>(Lcom/moji/mjad/common/video/AbsHandleAdVideo;Lcom/moji/tool/thread/ThreadPriority;)V

    sget-object v2, Lcom/moji/tool/thread/ThreadType;->NORMAL_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
