c.smali

.class public Lcom/sdk/plus/h/c;
.super Ljava/lang/Object;

# interfaces
.implements Ljava/lang/Runnable;


# static fields
.field private static d:Lcom/sdk/plus/h/c;


# instance fields
.field private a:Ljava/util/ArrayList;

.field private b:Ljava/util/ArrayList;

.field private c:J


# direct methods
.method private constructor <init>()V
    .registers 3

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

    new-instance v0, Ljava/util/ArrayList;

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

    iput-object v0, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    new-instance v0, Ljava/util/ArrayList;

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

    iput-object v0, p0, Lcom/sdk/plus/h/c;->b:Ljava/util/ArrayList;

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

    move-result-wide v0

    iput-wide v0, p0, Lcom/sdk/plus/h/c;->c:J

    return-void
.end method

.method public static a()Lcom/sdk/plus/h/c;
    .registers 3

    sget-object v0, Lcom/sdk/plus/h/c;->d:Lcom/sdk/plus/h/c;

    if-nez v0, :cond_1c

    const-class v1, Lcom/sdk/plus/h/c;

    monitor-enter v1

    :try_start_7
    sget-object v0, Lcom/sdk/plus/h/c;->d:Lcom/sdk/plus/h/c;

    if-nez v0, :cond_1b

    new-instance v0, Lcom/sdk/plus/h/c;

    invoke-direct {v0}, Lcom/sdk/plus/h/c;-><init>()V

    sput-object v0, Lcom/sdk/plus/h/c;->d:Lcom/sdk/plus/h/c;

    invoke-static {}, Lcom/sdk/plus/k/b;->a()Lcom/sdk/plus/k/a;

    move-result-object v0

    sget-object v2, Lcom/sdk/plus/h/c;->d:Lcom/sdk/plus/h/c;

    invoke-virtual {v0, v2}, Lcom/sdk/plus/k/a;->a(Ljava/lang/Runnable;)Z

    :cond_1b
    monitor-exit v1
    :try_end_1c
    .catchall {:try_start_7 .. :try_end_1c} :catchall_1f

    :cond_1c
    sget-object v0, Lcom/sdk/plus/h/c;->d:Lcom/sdk/plus/h/c;

    return-object v0

    :catchall_1f
    move-exception v0

    :try_start_20
    monitor-exit v1
    :try_end_21
    .catchall {:try_start_20 .. :try_end_21} :catchall_1f

    throw v0
.end method

.method private b()V
    .registers 8

    sget-object v0, Lcom/sdk/plus/c/b;->e:Ljava/lang/String;

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

    move-result v0

    if-eqz v0, :cond_9

    :cond_8
    :goto_8
    return-void

    :cond_9
    monitor-enter p0

    :try_start_a
    iget-object v0, p0, Lcom/sdk/plus/h/c;->b:Ljava/util/ArrayList;

    iget-object v1, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->addAll(Ljava/util/Collection;)Z

    iget-object v0, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    monitor-exit p0
    :try_end_17
    .catchall {:try_start_a .. :try_end_17} :catchall_f0

    new-instance v0, Ljava/text/SimpleDateFormat;

    const-string/jumbo v1, "yyyy-MM-dd"

    invoke-static {}, Ljava/util/Locale;->getDefault()Ljava/util/Locale;

    move-result-object v2

    invoke-direct {v0, v1, v2}, Ljava/text/SimpleDateFormat;-><init>(Ljava/lang/String;Ljava/util/Locale;)V

    new-instance v1, Ljava/util/Date;

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

    invoke-virtual {v0, v1}, Ljava/text/SimpleDateFormat;->format(Ljava/util/Date;)Ljava/lang/String;

    move-result-object v1

    sget-object v2, Lcom/sdk/plus/c/b;->b:Ljava/lang/String;

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

    move-result v0

    if-nez v0, :cond_8

    invoke-static {}, Landroid/os/Environment;->getExternalStorageState()Ljava/lang/String;

    move-result-object v0

    const-string v3, "mounted"

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

    move-result v0

    if-eqz v0, :cond_e3

    sget-object v0, Lcom/sdk/plus/c/d;->y:Ljava/lang/String;

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

    move-result v3

    if-nez v3, :cond_8

    new-instance v3, Ljava/lang/StringBuilder;

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

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

    move-result-object v0

    const-string v3, "/"

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

    new-instance v0, Ljava/io/File;

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

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

    move-result v4

    if-nez v4, :cond_6c

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

    move-result v0

    if-eqz v0, :cond_8

    :cond_6c
    const/4 v0, 0x0

    :try_start_6d
    new-instance v4, Ljava/io/File;

    new-instance v5, Ljava/lang/StringBuilder;

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

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

    move-result-object v3

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

    move-result-object v2

    const-string v3, "."

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

    move-result-object v2

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

    move-result-object v1

    const-string v2, ".log"

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

    move-result-object v1

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

    move-result-object v1

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

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

    move-result v1

    if-nez v1, :cond_a2

    invoke-virtual {v4}, Ljava/io/File;->createNewFile()Z

    move-result v1

    if-eqz v1, :cond_8

    invoke-static {}, Lcom/sdk/plus/h/a;->a()V

    :cond_a2
    invoke-static {}, Lcom/sdk/plus/h/a;->b()[B

    move-result-object v1

    if-nez v1, :cond_ae

    invoke-static {}, Lcom/sdk/plus/h/a;->a()V

    invoke-virtual {v4}, Ljava/io/File;->delete()Z
    :try_end_ae
    .catch Ljava/lang/Exception; {:try_start_6d .. :try_end_ae} :catch_fb
    .catchall {:try_start_6d .. :try_end_ae} :catchall_116

    :cond_ae
    :try_start_ae
    new-instance v1, Ljavax/crypto/spec/SecretKeySpec;

    sget-object v2, Lcom/sdk/plus/c/b;->f:[B

    const-string v3, "AES"

    invoke-direct {v1, v2, v3}, Ljavax/crypto/spec/SecretKeySpec;-><init>([BLjava/lang/String;)V

    invoke-static {v4, v1}, Lcom/sdk/plus/h/a;->a(Ljava/io/File;Ljavax/crypto/spec/SecretKeySpec;)Ljavax/crypto/CipherOutputStream;
    :try_end_ba
    .catch Ljava/lang/Throwable; {:try_start_ae .. :try_end_ba} :catch_f3
    .catch Ljava/lang/Exception; {:try_start_ae .. :try_end_ba} :catch_fb
    .catchall {:try_start_ae .. :try_end_ba} :catchall_116

    move-result-object v1

    :goto_bb
    :try_start_bb
    new-instance v2, Ljava/lang/StringBuilder;

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

    iget-object v0, p0, Lcom/sdk/plus/h/c;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;

    move-result-object v3

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

    move-result v0

    if-eqz v0, :cond_fd

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

    move-result-object v0

    check-cast v0, Ljava/lang/String;

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

    move-result-object v0

    const-string v4, "\r\n"

    invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
    :try_end_db
    .catch Ljava/lang/Exception; {:try_start_bb .. :try_end_db} :catch_dc
    .catchall {:try_start_bb .. :try_end_db} :catchall_124

    goto :goto_c6

    :catch_dc
    move-exception v0

    move-object v0, v1

    :goto_de
    if-eqz v0, :cond_e3

    :try_start_e0
    invoke-virtual {v0}, Ljava/io/OutputStream;->close()V
    :try_end_e3
    .catch Ljava/io/IOException; {:try_start_e0 .. :try_end_e3} :catch_120

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

    move-result-wide v0

    iput-wide v0, p0, Lcom/sdk/plus/h/c;->c:J

    iget-object v0, p0, Lcom/sdk/plus/h/c;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    goto/16 :goto_8

    :catchall_f0
    move-exception v0

    :try_start_f1
    monitor-exit p0
    :try_end_f2
    .catchall {:try_start_f1 .. :try_end_f2} :catchall_f0

    throw v0

    :catch_f3
    move-exception v1

    :try_start_f4
    new-instance v1, Ljava/io/FileOutputStream;

    const/4 v2, 0x1

    invoke-direct {v1, v4, v2}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V
    :try_end_fa
    .catch Ljava/lang/Exception; {:try_start_f4 .. :try_end_fa} :catch_fb
    .catchall {:try_start_f4 .. :try_end_fa} :catchall_116

    goto :goto_bb

    :catch_fb
    move-exception v1

    goto :goto_de

    :cond_fd
    :try_start_fd
    invoke-virtual {v2}, Ljava/lang/StringBuilder;->length()I

    move-result v0

    if-lez v0, :cond_110

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

    move-result-object v0

    const-string v2, "UTF-8"

    invoke-virtual {v0, v2}, Ljava/lang/String;->getBytes(Ljava/lang/String;)[B

    move-result-object v0

    invoke-virtual {v1, v0}, Ljava/io/OutputStream;->write([B)V
    :try_end_110
    .catch Ljava/lang/Exception; {:try_start_fd .. :try_end_110} :catch_dc
    .catchall {:try_start_fd .. :try_end_110} :catchall_124

    :cond_110
    :try_start_110
    invoke-virtual {v1}, Ljava/io/OutputStream;->close()V
    :try_end_113
    .catch Ljava/io/IOException; {:try_start_110 .. :try_end_113} :catch_114

    goto :goto_e3

    :catch_114
    move-exception v0

    goto :goto_e3

    :catchall_116
    move-exception v1

    move-object v6, v1

    move-object v1, v0

    move-object v0, v6

    :goto_11a
    if-eqz v1, :cond_11f

    :try_start_11c
    invoke-virtual {v1}, Ljava/io/OutputStream;->close()V
    :try_end_11f
    .catch Ljava/io/IOException; {:try_start_11c .. :try_end_11f} :catch_122

    :cond_11f
    :goto_11f
    throw v0

    :catch_120
    move-exception v0

    goto :goto_e3

    :catch_122
    move-exception v1

    goto :goto_11f

    :catchall_124
    move-exception v0

    goto :goto_11a
.end method


# virtual methods
.method public final declared-synchronized a(Ljava/lang/String;)V
    .registers 4

    monitor-enter p0

    :try_start_1
    iget-object v0, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v0, p1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
    :try_end_6
    .catchall {:try_start_1 .. :try_end_6} :catchall_1e

    :try_start_6
    iget-object v0, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/4 v1, 0x1

    if-le v0, v1, :cond_19

    iget-object v0, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    const/16 v1, 0xa

    if-lt v0, v1, :cond_1c

    :cond_19
    invoke-virtual {p0}, Ljava/lang/Object;->notify()V
    :try_end_1c
    .catch Ljava/lang/Throwable; {:try_start_6 .. :try_end_1c} :catch_21
    .catchall {:try_start_6 .. :try_end_1c} :catchall_1e

    :cond_1c
    :goto_1c
    monitor-exit p0

    return-void

    :catchall_1e
    move-exception v0

    monitor-exit p0

    throw v0

    :catch_21
    move-exception v0

    goto :goto_1c
.end method

.method public run()V
    .registers 9

    const-wide/32 v6, 0xea60

    const-wide/16 v2, 0x0

    invoke-static {}, Ljava/lang/Thread;->currentThread()Ljava/lang/Thread;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/Thread;->getName()Ljava/lang/String;

    :goto_c
    :try_start_c
    monitor-enter p0
    :try_end_d
    .catch Ljava/lang/Throwable; {:try_start_c .. :try_end_d} :catch_2c
    .catchall {:try_start_c .. :try_end_d} :catchall_53

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

    move-result-wide v0

    iget-wide v4, p0, Lcom/sdk/plus/h/c;->c:J

    sub-long/2addr v0, v4

    cmp-long v4, v0, v6

    if-ltz v4, :cond_31

    iget-object v4, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    if-lez v4, :cond_31

    move-wide v0, v2

    :goto_21
    cmp-long v4, v0, v2

    if-eqz v4, :cond_4e

    invoke-virtual {p0, v0, v1}, Ljava/lang/Object;->wait(J)V

    goto :goto_d

    :catchall_29
    move-exception v0

    monitor-exit p0
    :try_end_2b
    .catchall {:try_start_d .. :try_end_2b} :catchall_29

    :try_start_2b
    throw v0
    :try_end_2c
    .catch Ljava/lang/Throwable; {:try_start_2b .. :try_end_2c} :catch_2c
    .catchall {:try_start_2b .. :try_end_2c} :catchall_53

    :catch_2c
    move-exception v0

    invoke-direct {p0}, Lcom/sdk/plus/h/c;->b()V

    return-void

    :cond_31
    :try_start_31
    iget-object v4, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    const/16 v5, 0xa

    if-lt v4, v5, :cond_3d

    move-wide v0, v2

    goto :goto_21

    :cond_3d
    iget-object v4, p0, Lcom/sdk/plus/h/c;->a:Ljava/util/ArrayList;

    invoke-virtual {v4}, Ljava/util/ArrayList;->size()I

    move-result v4

    if-gtz v4, :cond_4b

    const-wide v0, 0x7fffffffffffffffL

    goto :goto_21

    :cond_4b
    sub-long v0, v6, v0

    goto :goto_21

    :cond_4e
    monitor-exit p0
    :try_end_4f
    .catchall {:try_start_31 .. :try_end_4f} :catchall_29

    :try_start_4f
    invoke-direct {p0}, Lcom/sdk/plus/h/c;->b()V
    :try_end_52
    .catch Ljava/lang/Throwable; {:try_start_4f .. :try_end_52} :catch_2c
    .catchall {:try_start_4f .. :try_end_52} :catchall_53

    goto :goto_c

    :catchall_53
    move-exception v0

    invoke-direct {p0}, Lcom/sdk/plus/h/c;->b()V

    throw v0
.end method