.class public Lcom/moji/mjweather/setting/task/MemorySizeTask;
.super Lcom/moji/tool/thread/task/MJAsyncTask;
.source "MemorySizeTask.java"


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/moji/tool/thread/task/MJAsyncTask<",
        "Ljava/lang/Void;",
        "Ljava/lang/Void;",
        "Ljava/lang/Long;",
        ">;"
    }
.end annotation


# instance fields
.field private a:Lcom/moji/mjweather/setting/task/callback/MemoryCallBack;

.field private final b:J

.field private final c:J

.field private final d:J

.field private final e:J

.field private final f:Ljava/lang/String;

.field private final g:Ljava/lang/String;

.field private final h:Ljava/lang/String;

.field private final i:Ljava/lang/String;

.field private j:I


# direct methods
.method public constructor <init>(Lcom/moji/tool/thread/ThreadPriority;Lcom/moji/mjweather/setting/task/callback/MemoryCallBack;)V
    .locals 2

    .line 34
    invoke-direct {p0, p1}, Lcom/moji/tool/thread/task/MJAsyncTask;-><init>(Lcom/moji/tool/thread/ThreadPriority;)V

    const-wide/16 v0, 0x400

    .line 19
    iput-wide v0, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->b:J

    const-wide/32 v0, 0x100000

    .line 20
    iput-wide v0, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->c:J

    const-wide/32 v0, 0x40000000

    .line 21
    iput-wide v0, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->d:J

    const-wide v0, 0x10000000000L

    .line 22
    iput-wide v0, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->e:J

    const-string p1, "cache"

    .line 23
    iput-object p1, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->f:Ljava/lang/String;

    const-string p1, "imgnotdelete"

    .line 24
    iput-object p1, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->g:Ljava/lang/String;

    const-string p1, "download"

    .line 25
    iput-object p1, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->h:Ljava/lang/String;

    const-string p1, "com.tencent.qqpimsecure"

    .line 26
    iput-object p1, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->i:Ljava/lang/String;

    const/4 p1, 0x0

    .line 75
    iput p1, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->j:I

    .line 35
    iput-object p2, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a:Lcom/moji/mjweather/setting/task/callback/MemoryCallBack;

    return-void
.end method

.method private a(Ljava/io/File;)J
    .locals 7
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/lang/Exception;
        }
    .end annotation

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

    move-result v0

    const-wide/16 v1, 0x0

    if-eqz v0, :cond_3

    .line 63
    invoke-virtual {p1}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object p1

    .line 64
    array-length v0, p1

    if-gtz v0, :cond_0

    return-wide v1

    .line 67
    :cond_0
    array-length v0, p1

    const/4 v3, 0x0

    :goto_0
    if-ge v3, v0, :cond_3

    aget-object v4, p1, v3

    .line 68
    invoke-virtual {v4}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v5

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

    move-result-object v5

    const-string v6, "cache"

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

    move-result v5

    if-nez v5, :cond_1

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

    move-result-object v5

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

    move-result-object v5

    const-string v6, "download"

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

    move-result v5

    if-eqz v5, :cond_2

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

    move-result-object v5

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

    move-result-object v5

    const-string v6, "imgnotdelete"

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

    move-result v5

    if-nez v5, :cond_2

    .line 69
    invoke-direct {p0, v4}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->b(Ljava/io/File;)I

    move-result v1

    int-to-long v1, v1

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

    goto :goto_0

    :cond_3
    return-wide v1
.end method

.method private a(DI)Ljava/lang/String;
    .locals 5

    const/4 v0, 0x0

    const/4 v1, 0x1

    const-wide v2, 0x408f400000000000L    # 1000.0

    cmpl-double v4, p1, v2

    if-ltz v4, :cond_0

    const/4 p3, 0x0

    goto :goto_0

    :cond_0
    const-wide/high16 v2, 0x4059000000000000L    # 100.0

    cmpl-double v4, p1, v2

    if-ltz v4, :cond_1

    const/4 p3, 0x1

    .line 144
    :cond_1
    :goto_0
    new-instance v2, Ljava/math/BigDecimal;

    invoke-direct {v2, p1, p2}, Ljava/math/BigDecimal;-><init>(D)V

    if-gtz p3, :cond_2

    .line 147
    :try_start_0
    invoke-virtual {v2, v0, v1}, Ljava/math/BigDecimal;->setScale(II)Ljava/math/BigDecimal;

    move-result-object v1

    invoke-virtual {v1}, Ljava/math/BigDecimal;->floatValue()F

    move-result v1

    float-to-double p1, v1

    goto :goto_2

    :catch_0
    move-exception v1

    goto :goto_1

    .line 149
    :cond_2
    invoke-virtual {v2, p3, v1}, Ljava/math/BigDecimal;->setScale(II)Ljava/math/BigDecimal;

    move-result-object v1

    invoke-virtual {v1}, Ljava/math/BigDecimal;->floatValue()F

    move-result v1
    :try_end_0
    .catch Ljava/lang/ArithmeticException; {:try_start_0 .. :try_end_0} :catch_0

    float-to-double p1, v1

    goto :goto_2

    :goto_1
    const-string v2, "MemorySizeTask"

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

    :goto_2
    const-string v1, ""

    if-gtz p3, :cond_3

    const-string p3, "#"

    goto :goto_4

    :cond_3
    :goto_3
    if-ge v0, p3, :cond_4

    .line 159
    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;

    const-string v1, "#"

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

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

    move-result-object v1

    add-int/lit8 v0, v0, 0x1

    goto :goto_3

    :cond_4
    move-object p3, v1

    .line 163
    :goto_4
    new-instance v0, Ljava/text/DecimalFormat;

    new-instance v1, Ljava/lang/StringBuilder;

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

    const-string v2, "###."

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

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

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

    move-result-object p3

    invoke-direct {v0, p3}, Ljava/text/DecimalFormat;-><init>(Ljava/lang/String;)V

    .line 164
    invoke-virtual {v0, p1, p2}, Ljava/text/DecimalFormat;->format(D)Ljava/lang/String;

    move-result-object p1

    return-object p1
.end method

.method private a(J)Ljava/lang/String;
    .locals 12

    const-wide/16 v0, 0x0

    const/4 v2, 0x0

    const-wide/16 v3, 0x400

    const/4 v5, 0x1

    cmp-long v6, p1, v0

    if-gez v6, :cond_0

    const-wide/16 v6, -0x1

    mul-long p1, p1, v6

    move-wide v6, v3

    const/4 v8, 0x1

    goto :goto_0

    :cond_0
    move-wide v6, v3

    const/4 v8, 0x0

    .line 104
    :goto_0
    div-long v9, p1, v6

    cmp-long v11, v9, v0

    if-lez v11, :cond_1

    add-int/lit8 v2, v2, 0x1

    mul-long v6, v6, v3

    goto :goto_0

    :cond_1
    const/4 v0, 0x0

    const/4 v1, 0x2

    const-wide/high16 v6, 0x3ff0000000000000L    # 1.0

    packed-switch v2, :pswitch_data_0

    goto/16 :goto_1

    .line 128
    :pswitch_0
    new-instance v0, Ljava/lang/StringBuilder;

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

    long-to-double p1, p1

    invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z

    mul-double p1, p1, v6

    const-wide/high16 v2, 0x4270000000000000L    # 1.099511627776E12

    div-double/2addr p1, v2

    invoke-direct {p0, p1, p2, v1}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(DI)Ljava/lang/String;

    move-result-object p1

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

    const-string p1, "T"

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

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

    move-result-object v0

    goto :goto_1

    :pswitch_1
    long-to-double p1, p1

    .line 124
    invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z

    mul-double p1, p1, v6

    const-wide/high16 v2, 0x41d0000000000000L    # 1.073741824E9

    div-double/2addr p1, v2

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

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

    invoke-direct {p0, p1, p2, v1}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(DI)Ljava/lang/String;

    move-result-object p1

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

    const-string p1, "G"

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

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

    move-result-object v0

    goto :goto_1

    :pswitch_2
    long-to-double p1, p1

    .line 120
    invoke-static {p1, p2}, Ljava/lang/Double;->isNaN(D)Z

    mul-double p1, p1, v6

    const-wide/high16 v0, 0x4130000000000000L    # 1048576.0

    div-double/2addr p1, v0

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

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

    invoke-direct {p0, p1, p2, v5}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(DI)Ljava/lang/String;

    move-result-object p1

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

    const-string p1, "M"

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

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

    move-result-object v0

    goto :goto_1

    .line 116
    :pswitch_3
    div-long/2addr p1, v3

    long-to-double p1, p1

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

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

    invoke-direct {p0, p1, p2, v5}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(DI)Ljava/lang/String;

    move-result-object p1

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

    const-string p1, "K"

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

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

    move-result-object v0

    goto :goto_1

    :pswitch_4
    const-string v0, "0K"

    :goto_1
    if-eqz v8, :cond_2

    .line 132
    new-instance p1, Ljava/lang/StringBuilder;

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

    const-string p2, "-"

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

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

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

    move-result-object v0

    :cond_2
    return-object v0

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

.method private b(Ljava/io/File;)I
    .locals 7

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

    move-result v0

    if-eqz v0, :cond_2

    .line 78
    invoke-virtual {p1}, Ljava/io/File;->listFiles()[Ljava/io/File;

    move-result-object p1

    if-eqz p1, :cond_2

    .line 79
    array-length v0, p1

    if-lez v0, :cond_2

    .line 80
    array-length v0, p1

    const/4 v1, 0x0

    :goto_0
    if-ge v1, v0, :cond_2

    aget-object v2, p1, v1

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

    move-result v3

    if-eqz v3, :cond_0

    .line 82
    invoke-direct {p0, v2}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->b(Ljava/io/File;)I

    goto :goto_1

    .line 84
    :cond_0
    invoke-virtual {v2}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    const-string v4, "com.tencent.qqpimsecure"

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

    move-result v3

    if-nez v3, :cond_1

    .line 86
    iget v3, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->j:I

    int-to-long v3, v3

    invoke-virtual {v2}, Ljava/io/File;->length()J

    move-result-wide v5

    add-long/2addr v3, v5

    long-to-int v2, v3

    iput v2, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->j:I

    :cond_1
    :goto_1
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 92
    :cond_2
    iget p1, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->j:I

    return p1
.end method

.method private b()J
    .locals 2

    .line 52
    :try_start_0
    new-instance v0, Ljava/io/File;

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

    move-result-object v1

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

    .line 53
    invoke-direct {p0, v0}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(Ljava/io/File;)J

    move-result-wide v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    goto :goto_0

    :catch_0
    move-exception v0

    const-string v1, "MemorySizeTask"

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

    const-wide/16 v0, 0x0

    :goto_0
    return-wide v0
.end method


# virtual methods
.method protected varargs a([Ljava/lang/Void;)Ljava/lang/Long;
    .locals 2

    .line 46
    invoke-direct {p0}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->b()J

    move-result-wide v0

    invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object p1

    return-object p1
.end method

.method protected bridge synthetic a([Ljava/lang/Object;)Ljava/lang/Object;
    .locals 0

    .line 16
    check-cast p1, [Ljava/lang/Void;

    invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a([Ljava/lang/Void;)Ljava/lang/Long;

    move-result-object p1

    return-object p1
.end method

.method protected a(Ljava/lang/Long;)V
    .locals 3

    .line 40
    invoke-super {p0, p1}, Lcom/moji/tool/thread/task/MJAsyncTask;->a(Ljava/lang/Object;)V

    .line 41
    iget-object v0, p0, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a:Lcom/moji/mjweather/setting/task/callback/MemoryCallBack;

    invoke-virtual {p1}, Ljava/lang/Long;->longValue()J

    move-result-wide v1

    invoke-direct {p0, v1, v2}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(J)Ljava/lang/String;

    move-result-object p1

    invoke-interface {v0, p1}, Lcom/moji/mjweather/setting/task/callback/MemoryCallBack;->a(Ljava/lang/String;)V

    return-void
.end method

.method protected bridge synthetic a(Ljava/lang/Object;)V
    .locals 0

    .line 16
    check-cast p1, Ljava/lang/Long;

    invoke-virtual {p0, p1}, Lcom/moji/mjweather/setting/task/MemorySizeTask;->a(Ljava/lang/Long;)V

    return-void
.end method
