.class public Lcom/moji/callup/db/CallUpDBBiz;
.super Ljava/lang/Object;
.source "CallUpDBBiz.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/moji/callup/db/CallUpDBBiz$InstanceHolder;
    }
.end annotation


# instance fields
.field private a:Landroid/database/sqlite/SQLiteDatabase;

.field private final b:Ljava/lang/Object;


# direct methods
.method private constructor <init>()V
    .locals 1

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

    .line 27
    new-instance v0, Ljava/lang/Object;

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

    iput-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    return-void
.end method

.method synthetic constructor <init>(Lcom/moji/callup/db/CallUpDBBiz$1;)V
    .locals 0

    .line 20
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;-><init>()V

    return-void
.end method

.method public static a()Lcom/moji/callup/db/CallUpDBBiz;
    .locals 1

    .line 35
    invoke-static {}, Lcom/moji/callup/db/CallUpDBBiz$InstanceHolder;->a()Lcom/moji/callup/db/CallUpDBBiz;

    move-result-object v0

    return-object v0
.end method

.method private f()V
    .locals 9

    .line 311
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 312
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 313
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v1, :cond_0

    .line 314
    monitor-exit v0

    return-void

    :cond_0
    const-string v1, "CallUpDBBiz"

    const-string v2, "deleteOtherConfig"

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

    .line 317
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    const/4 v1, 0x0

    .line 319
    :try_start_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v2

    const-wide/32 v4, 0xea60

    sub-long/2addr v2, v4

    .line 320
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v5, "callconfig"

    const-string v6, "updateTime<?"

    const/4 v7, 0x1

    new-array v7, v7, [Ljava/lang/String;

    const/4 v8, 0x0

    .line 321
    invoke-static {v2, v3}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v7, v8

    .line 320
    invoke-virtual {v4, v5, v6, v7}, Landroid/database/sqlite/SQLiteDatabase;->delete(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v2

    const-string v3, "CallUpDBBiz"

    .line 322
    new-instance v4, Ljava/lang/StringBuilder;

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

    const-string v5, "deleteOtherConfig affected:"

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

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

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

    move-result-object v2

    invoke-static {v3, v2}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 323
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 327
    :try_start_2
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 328
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 329
    :goto_0
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    goto :goto_1

    :catchall_0
    move-exception v2

    goto :goto_2

    :catch_0
    move-exception v2

    :try_start_3
    const-string v3, "CallUpDBBiz"

    .line 325
    invoke-static {v3, v2}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 327
    :try_start_4
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 328
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    goto :goto_0

    .line 331
    :goto_1
    monitor-exit v0

    return-void

    .line 327
    :goto_2
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 328
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 329
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 330
    throw v2

    :catchall_1
    move-exception v1

    .line 331
    monitor-exit v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    throw v1
.end method

.method private g()V
    .locals 3

    .line 335
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 337
    :try_start_0
    new-instance v1, Lcom/moji/callup/db/CallUpDbHelper;

    invoke-static {}, Lcom/moji/tool/AppDelegate;->a()Landroid/content/Context;

    move-result-object v2

    invoke-direct {v1, v2}, Lcom/moji/callup/db/CallUpDbHelper;-><init>(Landroid/content/Context;)V

    .line 338
    invoke-virtual {v1}, Lcom/moji/callup/db/CallUpDbHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v1

    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    goto :goto_0

    :catchall_0
    move-exception v1

    goto :goto_1

    :catch_0
    move-exception v1

    :try_start_1
    const-string v2, "CallUpDBBiz"

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

    .line 342
    :goto_0
    monitor-exit v0

    return-void

    :goto_1
    monitor-exit v0
    :try_end_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    throw v1
.end method


# virtual methods
.method public a(Ljava/util/List;)V
    .locals 13
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/callup/entity/CallUpConfig;",
            ">;)V"
        }
    .end annotation

    .line 39
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 40
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 41
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v1, :cond_0

    .line 42
    monitor-exit v0

    return-void

    :cond_0
    const/4 v1, 0x0

    if-eqz p1, :cond_b

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

    move-result v2

    if-nez v2, :cond_b

    .line 48
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_3

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

    move-result-object p1
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2
    .catchall {:try_start_1 .. :try_end_1} :catchall_1

    const/4 v2, 0x0

    move-object v4, v1

    const/4 v3, 0x0

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

    move-result v5

    if-eqz v5, :cond_7

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

    move-result-object v5

    check-cast v5, Lcom/moji/callup/entity/CallUpConfig;

    .line 52
    iget-object v6, v5, Lcom/moji/callup/entity/CallUpConfig;->a:Ljava/lang/String;

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

    move-result v6

    const/4 v7, 0x2

    const/4 v8, 0x1

    if-nez v6, :cond_2

    iget-object v6, v5, Lcom/moji/callup/entity/CallUpConfig;->b:Ljava/lang/String;

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

    move-result v6

    if-nez v6, :cond_2

    .line 53
    iget-object v6, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v9, "SELECT * FROM callconfig WHERE packageName =? AND className =?;"

    new-array v7, v7, [Ljava/lang/String;

    iget-object v10, v5, Lcom/moji/callup/entity/CallUpConfig;->a:Ljava/lang/String;

    aput-object v10, v7, v2

    iget-object v10, v5, Lcom/moji/callup/entity/CallUpConfig;->b:Ljava/lang/String;

    aput-object v10, v7, v8

    invoke-virtual {v6, v9, v7}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6

    goto :goto_1

    .line 57
    :cond_2
    iget-object v6, v5, Lcom/moji/callup/entity/CallUpConfig;->c:Ljava/lang/String;

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

    move-result v6

    if-nez v6, :cond_1

    iget-object v6, v5, Lcom/moji/callup/entity/CallUpConfig;->a:Ljava/lang/String;

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

    move-result v6

    if-nez v6, :cond_1

    .line 58
    iget-object v6, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v9, "SELECT * FROM callconfig WHERE packageName =? AND actionName =?;"

    new-array v7, v7, [Ljava/lang/String;

    iget-object v10, v5, Lcom/moji/callup/entity/CallUpConfig;->a:Ljava/lang/String;

    aput-object v10, v7, v2

    iget-object v10, v5, Lcom/moji/callup/entity/CallUpConfig;->c:Ljava/lang/String;

    aput-object v10, v7, v8

    invoke-virtual {v6, v9, v7}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v6
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_1
    .catchall {:try_start_2 .. :try_end_2} :catchall_2

    .line 66
    :goto_1
    :try_start_3
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v9

    iput-wide v9, v5, Lcom/moji/callup/entity/CallUpConfig;->n:J

    if-eqz v6, :cond_4

    .line 67
    invoke-interface {v6}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v4

    if-nez v4, :cond_3

    goto :goto_2

    .line 71
    :cond_3
    new-instance v4, Lcom/moji/callup/entity/CallUpConfig;

    invoke-direct {v4, v6}, Lcom/moji/callup/entity/CallUpConfig;-><init>(Landroid/database/Cursor;)V

    .line 72
    iget-wide v9, v4, Lcom/moji/callup/entity/CallUpConfig;->l:J

    iput-wide v9, v5, Lcom/moji/callup/entity/CallUpConfig;->l:J

    .line 73
    iget-wide v9, v4, Lcom/moji/callup/entity/CallUpConfig;->m:J

    iput-wide v9, v5, Lcom/moji/callup/entity/CallUpConfig;->m:J

    .line 74
    invoke-virtual {v5, v8}, Lcom/moji/callup/entity/CallUpConfig;->a(Z)Landroid/content/ContentValues;

    move-result-object v4

    .line 75
    iget-object v7, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v9, "callconfig"

    const-string v10, "_id=?"

    new-array v8, v8, [Ljava/lang/String;

    iget-wide v11, v5, Lcom/moji/callup/entity/CallUpConfig;->m:J

    .line 76
    invoke-static {v11, v12}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v5

    aput-object v5, v8, v2

    .line 75
    invoke-virtual {v7, v9, v4, v10, v8}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    move-result v4

    int-to-long v4, v4

    goto :goto_3

    .line 68
    :cond_4
    :goto_2
    invoke-virtual {v5, v2}, Lcom/moji/callup/entity/CallUpConfig;->a(Z)Landroid/content/ContentValues;

    move-result-object v4

    .line 69
    iget-object v5, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v7, "callconfig"

    invoke-virtual {v5, v7, v1, v4}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v4

    :goto_3
    const-wide/16 v7, 0x0

    cmp-long v9, v4, v7

    if-ltz v9, :cond_5

    add-int/lit8 v3, v3, 0x1

    :cond_5
    if-eqz v6, :cond_6

    .line 82
    invoke-interface {v6}, Landroid/database/Cursor;->close()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_0
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    move-object v4, v1

    goto/16 :goto_0

    :cond_6
    move-object v4, v6

    goto/16 :goto_0

    :catchall_0
    move-exception p1

    move-object v4, v6

    goto :goto_7

    :catch_0
    move-exception p1

    move-object v4, v6

    goto :goto_5

    :cond_7
    if-lez v3, :cond_8

    .line 87
    :try_start_4
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_4
    .catch Ljava/lang/Exception; {:try_start_4 .. :try_end_4} :catch_1
    .catchall {:try_start_4 .. :try_end_4} :catchall_2

    .line 92
    :cond_8
    :try_start_5
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 93
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 94
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v4, :cond_9

    .line 96
    :goto_4
    invoke-interface {v4}, Landroid/database/Cursor;->close()V
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_3

    goto :goto_6

    :catch_1
    move-exception p1

    goto :goto_5

    :catchall_1
    move-exception p1

    move-object v4, v1

    goto :goto_7

    :catch_2
    move-exception p1

    move-object v4, v1

    :goto_5
    :try_start_6
    const-string v2, "CallUpDBBiz"

    .line 90
    invoke-static {v2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_6
    .catchall {:try_start_6 .. :try_end_6} :catchall_2

    .line 92
    :try_start_7
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 93
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 94
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v4, :cond_9

    goto :goto_4

    .line 99
    :cond_9
    :goto_6
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->f()V

    goto :goto_8

    :catchall_2
    move-exception p1

    .line 92
    :goto_7
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 93
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 94
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v4, :cond_a

    .line 96
    invoke-interface {v4}, Landroid/database/Cursor;->close()V

    .line 98
    :cond_a
    throw p1

    :cond_b
    const-string p1, "CallUpDBBiz"

    const-string v2, "updateConfig delete all call up config"

    .line 101
    invoke-static {p1, v2}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 102
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {p1}, Lcom/moji/callup/db/CallUpDbHelper;->a(Landroid/database/sqlite/SQLiteDatabase;)V

    .line 103
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 104
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 106
    :goto_8
    monitor-exit v0

    return-void

    :catchall_3
    move-exception p1

    monitor-exit v0
    :try_end_7
    .catchall {:try_start_7 .. :try_end_7} :catchall_3

    throw p1
.end method

.method public b()Ljava/util/List;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Lcom/moji/callup/entity/BlackDevice;",
            ">;"
        }
    .end annotation

    const-string v0, "SELECT * FROM callblkconfig ;"

    .line 191
    new-instance v1, Ljava/util/ArrayList;

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

    .line 192
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v2

    .line 193
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 194
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v3, :cond_0

    .line 195
    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_2

    return-object v1

    :cond_0
    const/4 v3, 0x0

    .line 199
    :try_start_1
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-eqz v0, :cond_2

    .line 200
    :try_start_2
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 202
    :cond_1
    new-instance v4, Lcom/moji/callup/entity/BlackDevice;

    invoke-direct {v4, v0}, Lcom/moji/callup/entity/BlackDevice;-><init>(Landroid/database/Cursor;)V

    .line 203
    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 204
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v4
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    if-nez v4, :cond_1

    goto :goto_0

    :catch_0
    move-exception v4

    goto :goto_2

    .line 209
    :cond_2
    :goto_0
    :try_start_3
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 210
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_3

    .line 212
    :goto_1
    invoke-interface {v0}, Landroid/database/Cursor;->close()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    goto :goto_3

    :catchall_0
    move-exception v1

    move-object v0, v3

    goto :goto_4

    :catch_1
    move-exception v4

    move-object v0, v3

    :goto_2
    :try_start_4
    const-string v5, "CallUpDBBiz"

    .line 207
    invoke-static {v5, v4}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    .line 209
    :try_start_5
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 210
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_3

    goto :goto_1

    .line 215
    :cond_3
    :goto_3
    monitor-exit v2

    return-object v1

    :catchall_1
    move-exception v1

    .line 209
    :goto_4
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 210
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_4

    .line 212
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 214
    :cond_4
    throw v1

    :catchall_2
    move-exception v0

    .line 215
    monitor-exit v2
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_2

    throw v0
.end method

.method public b(Ljava/util/List;)V
    .locals 10
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/callup/entity/BlackDevice;",
            ">;)V"
        }
    .end annotation

    .line 110
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 111
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 112
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v1, :cond_0

    .line 113
    monitor-exit v0

    return-void

    .line 115
    :cond_0
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {v1}, Lcom/moji/callup/db/CallUpDbHelper;->b(Landroid/database/sqlite/SQLiteDatabase;)V

    const/4 v1, 0x0

    if-eqz p1, :cond_4

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

    move-result v2

    if-nez v2, :cond_4

    const/4 v2, 0x0

    .line 120
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 122
    :try_start_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

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

    move-result-object p1

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

    move-result v5

    if-eqz v5, :cond_2

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

    move-result-object v5

    check-cast v5, Lcom/moji/callup/entity/BlackDevice;

    .line 124
    invoke-virtual {v5, v3, v4}, Lcom/moji/callup/entity/BlackDevice;->a(J)Landroid/content/ContentValues;

    move-result-object v5

    .line 125
    iget-object v6, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v7, "callblkconfig"

    invoke-virtual {v6, v7, v1, v5}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v5

    const-wide/16 v7, 0x0

    cmp-long v9, v5, v7

    if-ltz v9, :cond_1

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_2
    if-lez v2, :cond_3

    .line 131
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 136
    :cond_3
    :try_start_2
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 137
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 138
    :goto_1
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    goto :goto_3

    :catchall_0
    move-exception p1

    goto :goto_2

    :catch_0
    move-exception p1

    :try_start_3
    const-string v2, "CallUpDBBiz"

    .line 134
    invoke-static {v2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 136
    :try_start_4
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 137
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    goto :goto_1

    .line 136
    :goto_2
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 137
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 138
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 139
    throw p1

    :cond_4
    const-string p1, "CallUpDBBiz"

    const-string v2, "updateBlackList delete all blacklist config"

    .line 141
    invoke-static {p1, v2}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 142
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 143
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 145
    :goto_3
    monitor-exit v0

    return-void

    :catchall_1
    move-exception p1

    monitor-exit v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    throw p1
.end method

.method public c()Ljava/util/List;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Lcom/moji/callup/entity/CallUpConfig;",
            ">;"
        }
    .end annotation

    const-string v0, "SELECT * FROM callconfig ;"

    .line 221
    new-instance v1, Ljava/util/ArrayList;

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

    .line 222
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v2

    .line 223
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 224
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v3, :cond_0

    .line 225
    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_2

    return-object v1

    :cond_0
    const/4 v3, 0x0

    .line 229
    :try_start_1
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-eqz v0, :cond_2

    .line 230
    :try_start_2
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v4

    if-eqz v4, :cond_2

    .line 232
    :cond_1
    new-instance v4, Lcom/moji/callup/entity/CallUpConfig;

    invoke-direct {v4, v0}, Lcom/moji/callup/entity/CallUpConfig;-><init>(Landroid/database/Cursor;)V

    .line 233
    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 234
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v4
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    if-nez v4, :cond_1

    goto :goto_0

    :catch_0
    move-exception v4

    goto :goto_2

    .line 239
    :cond_2
    :goto_0
    :try_start_3
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 240
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_3

    .line 242
    :goto_1
    invoke-interface {v0}, Landroid/database/Cursor;->close()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    goto :goto_3

    :catchall_0
    move-exception v1

    move-object v0, v3

    goto :goto_4

    :catch_1
    move-exception v4

    move-object v0, v3

    :goto_2
    :try_start_4
    const-string v5, "CallUpDBBiz"

    .line 237
    invoke-static {v5, v4}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    .line 239
    :try_start_5
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 240
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_3

    goto :goto_1

    .line 245
    :cond_3
    :goto_3
    monitor-exit v2

    return-object v1

    :catchall_1
    move-exception v1

    .line 239
    :goto_4
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 240
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_4

    .line 242
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 244
    :cond_4
    throw v1

    :catchall_2
    move-exception v0

    .line 245
    monitor-exit v2
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_2

    throw v0
.end method

.method public c(Ljava/util/List;)V
    .locals 10
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .line 149
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 150
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 151
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v1, :cond_0

    .line 152
    monitor-exit v0

    return-void

    .line 154
    :cond_0
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-static {v1}, Lcom/moji/callup/db/CallUpDbHelper;->c(Landroid/database/sqlite/SQLiteDatabase;)V

    const/4 v1, 0x0

    if-eqz p1, :cond_4

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

    move-result v2

    if-nez v2, :cond_4

    const/4 v2, 0x0

    .line 159
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v3}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    .line 161
    :try_start_1
    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v3

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

    move-result-object p1

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

    move-result v5

    if-eqz v5, :cond_2

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

    move-result-object v5

    check-cast v5, Ljava/lang/String;

    .line 163
    new-instance v6, Landroid/content/ContentValues;

    const/4 v7, 0x2

    invoke-direct {v6, v7}, Landroid/content/ContentValues;-><init>(I)V

    const-string v7, "source"

    .line 164
    invoke-virtual {v6, v7, v5}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    const-string v5, "updateTime"

    .line 165
    invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;

    move-result-object v7

    invoke-virtual {v6, v5, v7}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Long;)V

    .line 166
    iget-object v5, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v7, "srcconfig"

    invoke-virtual {v5, v7, v1, v6}, Landroid/database/sqlite/SQLiteDatabase;->insert(Ljava/lang/String;Ljava/lang/String;Landroid/content/ContentValues;)J

    move-result-wide v5

    const-wide/16 v7, 0x0

    cmp-long v9, v5, v7

    if-ltz v9, :cond_1

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    :cond_2
    if-lez v2, :cond_3

    .line 172
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 177
    :cond_3
    :try_start_2
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 178
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 179
    :goto_1
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    goto :goto_3

    :catchall_0
    move-exception p1

    goto :goto_2

    :catch_0
    move-exception p1

    :try_start_3
    const-string v2, "CallUpDBBiz"

    .line 175
    invoke-static {v2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 177
    :try_start_4
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 178
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    goto :goto_1

    .line 177
    :goto_2
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 178
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 179
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 180
    throw p1

    :cond_4
    const-string p1, "CallUpDBBiz"

    const-string v2, "updateSourceList delete all sourceList config"

    .line 182
    invoke-static {p1, v2}, Lcom/moji/tool/log/MJLogger;->c(Ljava/lang/String;Ljava/lang/String;)V

    .line 183
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 184
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 186
    :goto_3
    monitor-exit v0

    return-void

    :catchall_1
    move-exception p1

    monitor-exit v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    throw p1
.end method

.method public d()Ljava/util/List;
    .locals 6
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation

    const-string v0, "SELECT * FROM srcconfig ;"

    .line 251
    new-instance v1, Ljava/util/ArrayList;

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

    .line 252
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v2

    .line 253
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 254
    iget-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v3, :cond_0

    .line 255
    monitor-exit v2
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_2

    return-object v1

    :cond_0
    const/4 v3, 0x0

    .line 259
    :try_start_1
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4, v0, v3}, Landroid/database/sqlite/SQLiteDatabase;->rawQuery(Ljava/lang/String;[Ljava/lang/String;)Landroid/database/Cursor;

    move-result-object v0
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    if-eqz v0, :cond_2

    .line 260
    :try_start_2
    invoke-interface {v0}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v4

    if-eqz v4, :cond_2

    :cond_1
    const-string v4, "source"

    .line 262
    invoke-interface {v0, v4}, Landroid/database/Cursor;->getColumnIndexOrThrow(Ljava/lang/String;)I

    move-result v4

    invoke-interface {v0, v4}, Landroid/database/Cursor;->getString(I)Ljava/lang/String;

    move-result-object v4

    .line 263
    invoke-interface {v1, v4}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    .line 264
    invoke-interface {v0}, Landroid/database/Cursor;->moveToNext()Z

    move-result v4
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    if-nez v4, :cond_1

    goto :goto_0

    :catch_0
    move-exception v4

    goto :goto_2

    .line 269
    :cond_2
    :goto_0
    :try_start_3
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 270
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_3

    .line 272
    :goto_1
    invoke-interface {v0}, Landroid/database/Cursor;->close()V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_2

    goto :goto_3

    :catchall_0
    move-exception v1

    move-object v0, v3

    goto :goto_4

    :catch_1
    move-exception v4

    move-object v0, v3

    :goto_2
    :try_start_4
    const-string v5, "CallUpDBBiz"

    .line 267
    invoke-static {v5, v4}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    .line 269
    :try_start_5
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 270
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_3

    goto :goto_1

    .line 275
    :cond_3
    :goto_3
    monitor-exit v2

    return-object v1

    :catchall_1
    move-exception v1

    .line 269
    :goto_4
    iget-object v4, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v4}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 270
    iput-object v3, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v0, :cond_4

    .line 272
    invoke-interface {v0}, Landroid/database/Cursor;->close()V

    .line 274
    :cond_4
    throw v1

    :catchall_2
    move-exception v0

    .line 275
    monitor-exit v2
    :try_end_5
    .catchall {:try_start_5 .. :try_end_5} :catchall_2

    throw v0
.end method

.method public d(Ljava/util/List;)V
    .locals 11
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Lcom/moji/callup/entity/CallUpConfig;",
            ">;)V"
        }
    .end annotation

    if-eqz p1, :cond_4

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

    move-result v0

    if-eqz v0, :cond_0

    goto/16 :goto_4

    .line 283
    :cond_0
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 284
    :try_start_0
    invoke-direct {p0}, Lcom/moji/callup/db/CallUpDBBiz;->g()V

    .line 285
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-nez v1, :cond_1

    .line 286
    monitor-exit v0

    return-void

    .line 288
    :cond_1
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->beginTransaction()V
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_1

    const/4 v1, 0x0

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

    move-result-object p1

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

    move-result v2

    if-eqz v2, :cond_3

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

    move-result-object v2

    check-cast v2, Lcom/moji/callup/entity/CallUpConfig;

    .line 291
    iget-wide v3, v2, Lcom/moji/callup/entity/CallUpConfig;->m:J

    const-wide/16 v5, 0x0

    cmp-long v7, v3, v5

    if-ltz v7, :cond_2

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

    move-result-wide v3

    iput-wide v3, v2, Lcom/moji/callup/entity/CallUpConfig;->l:J

    const/4 v3, 0x1

    .line 293
    invoke-virtual {v2, v3}, Lcom/moji/callup/entity/CallUpConfig;->a(Z)Landroid/content/ContentValues;

    move-result-object v4

    .line 294
    iget-object v5, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    const-string v6, "callconfig"

    const-string v7, "_id=?"

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

    const/4 v8, 0x0

    iget-wide v9, v2, Lcom/moji/callup/entity/CallUpConfig;->m:J

    .line 295
    invoke-static {v9, v10}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;

    move-result-object v2

    aput-object v2, v3, v8

    .line 294
    invoke-virtual {v5, v6, v4, v7, v3}, Landroid/database/sqlite/SQLiteDatabase;->update(Ljava/lang/String;Landroid/content/ContentValues;Ljava/lang/String;[Ljava/lang/String;)I

    goto :goto_0

    .line 298
    :cond_3
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->setTransactionSuccessful()V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0
    .catchall {:try_start_1 .. :try_end_1} :catchall_0

    .line 302
    :try_start_2
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 303
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 304
    :goto_1
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;
    :try_end_2
    .catchall {:try_start_2 .. :try_end_2} :catchall_1

    goto :goto_2

    :catchall_0
    move-exception p1

    goto :goto_3

    :catch_0
    move-exception p1

    :try_start_3
    const-string v2, "CallUpDBBiz"

    .line 300
    invoke-static {v2, p1}, Lcom/moji/tool/log/MJLogger;->a(Ljava/lang/String;Ljava/lang/Throwable;)V
    :try_end_3
    .catchall {:try_start_3 .. :try_end_3} :catchall_0

    .line 302
    :try_start_4
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 303
    iget-object p1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {p1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    goto :goto_1

    .line 307
    :goto_2
    monitor-exit v0

    return-void

    .line 302
    :goto_3
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->endTransaction()V

    .line 303
    iget-object v2, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v2}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    .line 304
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 305
    throw p1

    :catchall_1
    move-exception p1

    .line 307
    monitor-exit v0
    :try_end_4
    .catchall {:try_start_4 .. :try_end_4} :catchall_1

    throw p1

    :cond_4
    :goto_4
    return-void
.end method

.method public e()V
    .locals 2

    .line 346
    iget-object v0, p0, Lcom/moji/callup/db/CallUpDBBiz;->b:Ljava/lang/Object;

    monitor-enter v0

    .line 347
    :try_start_0
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    if-eqz v1, :cond_0

    .line 348
    iget-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v1}, Landroid/database/sqlite/SQLiteDatabase;->close()V

    const/4 v1, 0x0

    .line 349
    iput-object v1, p0, Lcom/moji/callup/db/CallUpDBBiz;->a:Landroid/database/sqlite/SQLiteDatabase;

    .line 351
    :cond_0
    monitor-exit v0

    return-void

    :catchall_0
    move-exception v1

    monitor-exit v0
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    throw v1
.end method
