CICCacheHelper.smali

.class public Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;
.super Ljava/lang/Object;
.source "CICCacheHelper.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;,
        Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;
    }
.end annotation


# static fields
.field private static a:Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;


# instance fields
.field private b:Landroid/content/Context;


# direct methods
.method static constructor <clinit>()V
    .registers 1

    .prologue
    .line 26
    const/4 v0, 0x0

    sput-object v0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->a:Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;

    return-void
.end method

.method private constructor <init>()V
    .registers 2

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

    .line 27
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->b:Landroid/content/Context;

    .line 48
    invoke-static {}, Lcom/keniu/security/m;->d()Landroid/content/Context;

    move-result-object v0

    iput-object v0, p0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->b:Landroid/content/Context;

    .line 49
    invoke-direct {p0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->b()V

    .line 50
    return-void
.end method

.method public static declared-synchronized a()Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;
    .registers 2

    .prologue
    .line 53
    const-class v1, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;

    monitor-enter v1

    :try_start_3
    sget-object v0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->a:Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;

    if-nez v0, :cond_e

    .line 54
    new-instance v0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;

    invoke-direct {v0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;-><init>()V

    sput-object v0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->a:Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;

    .line 56
    :cond_e
    sget-object v0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->a:Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;
    :try_end_10
    .catchall {:try_start_3 .. :try_end_10} :catchall_12

    monitor-exit v1

    return-object v0

    .line 53
    :catchall_12
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method private static a(I)Ljava/lang/String;
    .registers 3

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

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

    const-string/jumbo v1, "t_"

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

    move-result-object v0

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

    move-result-object v0

    const-string v1, "_"

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

    move-result-object v0

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

    move-result-object v0

    return-object v0
.end method

.method private static a(Ljava/lang/Object;Ljava/lang/String;)Z
    .registers 7

    .prologue
    const/4 v0, 0x0

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

    move-result v1

    if-nez v1, :cond_9

    if-nez p0, :cond_a

    .line 74
    :cond_9
    :goto_9
    return v0

    .line 63
    :cond_a
    new-instance v1, Ljava/io/File;

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

    .line 65
    const/4 v3, 0x0

    .line 67
    :try_start_10
    new-instance v4, Ljava/io/FileOutputStream;

    const/4 v2, 0x0

    invoke-direct {v4, v1, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V

    .line 68
    new-instance v2, Ljava/io/ObjectOutputStream;

    invoke-direct {v2, v4}, Ljava/io/ObjectOutputStream;-><init>(Ljava/io/OutputStream;)V
    :try_end_1b
    .catch Ljava/io/IOException; {:try_start_10 .. :try_end_1b} :catch_2d
    .catchall {:try_start_10 .. :try_end_1b} :catchall_3d

    .line 69
    :try_start_1b
    invoke-virtual {v2, p0}, Ljava/io/ObjectOutputStream;->writeObject(Ljava/lang/Object;)V

    .line 70
    invoke-virtual {v2}, Ljava/io/ObjectOutputStream;->flush()V
    :try_end_21
    .catch Ljava/io/IOException; {:try_start_1b .. :try_end_21} :catch_4c
    .catchall {:try_start_1b .. :try_end_21} :catchall_49

    .line 71
    const/4 v0, 0x1

    .line 76
    if-eqz v2, :cond_9

    .line 78
    :try_start_24
    invoke-virtual {v2}, Ljava/io/ObjectOutputStream;->close()V
    :try_end_27
    .catch Ljava/io/IOException; {:try_start_24 .. :try_end_27} :catch_28

    goto :goto_9

    .line 79
    :catch_28
    move-exception v1

    .line 80
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_9

    .line 72
    :catch_2d
    move-exception v1

    move-object v2, v3

    .line 73
    :goto_2f
    :try_start_2f
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
    :try_end_32
    .catchall {:try_start_2f .. :try_end_32} :catchall_49

    .line 76
    if-eqz v2, :cond_9

    .line 78
    :try_start_34
    invoke-virtual {v2}, Ljava/io/ObjectOutputStream;->close()V
    :try_end_37
    .catch Ljava/io/IOException; {:try_start_34 .. :try_end_37} :catch_38

    goto :goto_9

    .line 79
    :catch_38
    move-exception v1

    .line 80
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_9

    .line 76
    :catchall_3d
    move-exception v0

    :goto_3e
    if-eqz v3, :cond_43

    .line 78
    :try_start_40
    invoke-virtual {v3}, Ljava/io/ObjectOutputStream;->close()V
    :try_end_43
    .catch Ljava/io/IOException; {:try_start_40 .. :try_end_43} :catch_44

    .line 81
    :cond_43
    :goto_43
    throw v0

    .line 79
    :catch_44
    move-exception v1

    .line 80
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_43

    .line 76
    :catchall_49
    move-exception v0

    move-object v3, v2

    goto :goto_3e

    .line 72
    :catch_4c
    move-exception v1

    goto :goto_2f
.end method

.method private b()V
    .registers 3

    .prologue
    .line 120
    new-instance v0, Ljava/io/File;

    invoke-direct {p0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->c()Ljava/lang/String;

    move-result-object v1

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

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

    .line 122
    return-void
.end method

.method private c()Ljava/lang/String;
    .registers 2

    .prologue
    .line 125
    invoke-static {}, Lcom/keniu/security/update/pushmonitor/cic/b;->a()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method private d(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Ljava/lang/String;
    .registers 6

    .prologue
    .line 129
    invoke-direct {p0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->c()Ljava/lang/String;

    move-result-object v0

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

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

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

    move-result-object v0

    iget v1, p1, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;->mType:I

    invoke-static {v1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->a(I)Ljava/lang/String;

    move-result-object v1

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

    move-result-object v0

    iget-wide v2, p1, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;->mTimeStamp:J

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

    move-result-object v0

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

    move-result-object v0

    return-object v0
.end method

.method private e(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)V
    .registers 4

    .prologue
    .line 139
    new-instance v0, Ljava/io/File;

    invoke-direct {p0, p1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->d(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Ljava/lang/String;

    move-result-object v1

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

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

    move-result v1

    if-eqz v1, :cond_18

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

    move-result v1

    if-eqz v1, :cond_18

    .line 141
    invoke-virtual {v0}, Ljava/io/File;->delete()Z

    .line 143
    :cond_18
    return-void
.end method


# virtual methods
.method public a(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Ljava/lang/Object;
    .registers 5

    .prologue
    const/4 v0, 0x0

    .line 87
    if-nez p1, :cond_4

    .line 106
    :cond_3
    :goto_3
    return-object v0

    .line 90
    :cond_4
    invoke-direct {p0, p1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->d(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Ljava/lang/String;

    move-result-object v1

    .line 91
    new-instance v2, Ljava/io/File;

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

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

    move-result v1

    if-eqz v1, :cond_3

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

    move-result v1

    if-nez v1, :cond_3

    .line 98
    :try_start_19
    new-instance v1, Ljava/io/FileInputStream;

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

    .line 99
    new-instance v2, Ljava/io/ObjectInputStream;

    invoke-direct {v2, v1}, Ljava/io/ObjectInputStream;-><init>(Ljava/io/InputStream;)V
    :try_end_23
    .catch Ljava/io/IOException; {:try_start_19 .. :try_end_23} :catch_32
    .catch Ljava/lang/ClassNotFoundException; {:try_start_19 .. :try_end_23} :catch_42
    .catchall {:try_start_19 .. :try_end_23} :catchall_52

    .line 100
    :try_start_23
    invoke-virtual {v2}, Ljava/io/ObjectInputStream;->readObject()Ljava/lang/Object;
    :try_end_26
    .catch Ljava/io/IOException; {:try_start_23 .. :try_end_26} :catch_64
    .catch Ljava/lang/ClassNotFoundException; {:try_start_23 .. :try_end_26} :catch_62
    .catchall {:try_start_23 .. :try_end_26} :catchall_60

    move-result-object v0

    .line 108
    if-eqz v2, :cond_3

    .line 110
    :try_start_29
    invoke-virtual {v2}, Ljava/io/ObjectInputStream;->close()V
    :try_end_2c
    .catch Ljava/io/IOException; {:try_start_29 .. :try_end_2c} :catch_2d

    goto :goto_3

    .line 111
    :catch_2d
    move-exception v1

    .line 112
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_3

    .line 101
    :catch_32
    move-exception v1

    move-object v2, v0

    .line 102
    :goto_34
    :try_start_34
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V
    :try_end_37
    .catchall {:try_start_34 .. :try_end_37} :catchall_60

    .line 108
    if-eqz v2, :cond_3

    .line 110
    :try_start_39
    invoke-virtual {v2}, Ljava/io/ObjectInputStream;->close()V
    :try_end_3c
    .catch Ljava/io/IOException; {:try_start_39 .. :try_end_3c} :catch_3d

    goto :goto_3

    .line 111
    :catch_3d
    move-exception v1

    .line 112
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_3

    .line 104
    :catch_42
    move-exception v1

    move-object v2, v0

    .line 105
    :goto_44
    :try_start_44
    invoke-virtual {v1}, Ljava/lang/ClassNotFoundException;->printStackTrace()V
    :try_end_47
    .catchall {:try_start_44 .. :try_end_47} :catchall_60

    .line 108
    if-eqz v2, :cond_3

    .line 110
    :try_start_49
    invoke-virtual {v2}, Ljava/io/ObjectInputStream;->close()V
    :try_end_4c
    .catch Ljava/io/IOException; {:try_start_49 .. :try_end_4c} :catch_4d

    goto :goto_3

    .line 111
    :catch_4d
    move-exception v1

    .line 112
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_3

    .line 108
    :catchall_52
    move-exception v1

    move-object v2, v0

    move-object v0, v1

    :goto_55
    if-eqz v2, :cond_5a

    .line 110
    :try_start_57
    invoke-virtual {v2}, Ljava/io/ObjectInputStream;->close()V
    :try_end_5a
    .catch Ljava/io/IOException; {:try_start_57 .. :try_end_5a} :catch_5b

    .line 113
    :cond_5a
    :goto_5a
    throw v0

    .line 111
    :catch_5b
    move-exception v1

    .line 112
    invoke-virtual {v1}, Ljava/io/IOException;->printStackTrace()V

    goto :goto_5a

    .line 108
    :catchall_60
    move-exception v0

    goto :goto_55

    .line 104
    :catch_62
    move-exception v1

    goto :goto_44

    .line 101
    :catch_64
    move-exception v1

    goto :goto_34
.end method

.method public a(II)[Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;
    .registers 6

    .prologue
    .line 157
    new-instance v0, Ljava/util/LinkedList;

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

    .line 158
    iget-object v1, p0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->b:Landroid/content/Context;

    invoke-static {v1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;->a(Landroid/content/Context;)Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;

    move-result-object v1

    invoke-virtual {v1, p1, p2, v0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;->a(IILjava/util/LinkedList;)[Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;

    move-result-object v1

    .line 159
    invoke-virtual {v0}, Ljava/util/LinkedList;->size()I

    move-result v2

    if-lez v2, :cond_29

    .line 160
    invoke-virtual {v0}, Ljava/util/LinkedList;->iterator()Ljava/util/Iterator;

    move-result-object v2

    :goto_19
    invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_29

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

    move-result-object v0

    check-cast v0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;

    .line 161
    invoke-virtual {p0, v0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->c(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)V

    goto :goto_19

    .line 164
    :cond_29
    return-object v1
.end method

.method public b(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Z
    .registers 4

    .prologue
    .line 146
    iget-object v0, p1, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;->mInnerData:Ljava/lang/Object;

    if-eqz v0, :cond_12

    .line 147
    iget-object v0, p1, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;->mInnerData:Ljava/lang/Object;

    invoke-direct {p0, p1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->d(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Ljava/lang/String;

    move-result-object v1

    invoke-static {v0, v1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->a(Ljava/lang/Object;Ljava/lang/String;)Z

    move-result v0

    .line 148
    if-nez v0, :cond_12

    .line 149
    const/4 v0, 0x0

    .line 152
    :goto_11
    return v0

    :cond_12
    iget-object v0, p0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->b:Landroid/content/Context;

    invoke-static {v0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;->a(Landroid/content/Context;)Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;->a(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)Z

    move-result v0

    goto :goto_11
.end method

.method public c(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)V
    .registers 3

    .prologue
    .line 294
    if-nez p1, :cond_3

    .line 299
    :goto_2
    return-void

    .line 297
    :cond_3
    iget-object v0, p0, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->b:Landroid/content/Context;

    invoke-static {v0}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;->a(Landroid/content/Context;)Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$DatabaseHelper;->b(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)V

    .line 298
    invoke-direct {p0, p1}, Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper;->e(Lcom/keniu/security/update/pushmonitor/cic/CICCacheHelper$CICCache;)V

    goto :goto_2
.end method