.class public Lf1/c$a;
.super Landroid/database/sqlite/SQLiteOpenHelper;
.source ""


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lf1/c;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "a"
.end annotation


# instance fields
.field public final r:[Lf1/a;

.field public final s:Le1/b$a;

.field public t:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;[Lf1/a;Le1/b$a;)V
    .registers 11

    iget v4, p4, Le1/b$a;->a:I

    new-instance v5, Lf1/c$a$a;

    invoke-direct {v5, p4, p3}, Lf1/c$a$a;-><init>(Le1/b$a;[Lf1/a;)V

    const/4 v3, 0x0

    move-object v0, p0

    move-object v1, p1

    move-object v2, p2

    invoke-direct/range {v0 .. v5}, Landroid/database/sqlite/SQLiteOpenHelper;-><init>(Landroid/content/Context;Ljava/lang/String;Landroid/database/sqlite/SQLiteDatabase$CursorFactory;ILandroid/database/DatabaseErrorHandler;)V

    iput-object p4, p0, Lf1/c$a;->s:Le1/b$a;

    iput-object p3, p0, Lf1/c$a;->r:[Lf1/a;

    return-void
.end method

.method public static e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;
    .registers 4

    const/4 v0, 0x0

    aget-object v1, p0, v0

    if-eqz v1, :cond_e

    .line 1
    iget-object v1, v1, Lf1/a;->r:Landroid/database/sqlite/SQLiteDatabase;

    if-ne v1, p1, :cond_b

    const/4 v1, 0x1

    goto :goto_c

    :cond_b
    move v1, v0

    :goto_c
    if-nez v1, :cond_15

    .line 2
    :cond_e
    new-instance v1, Lf1/a;

    invoke-direct {v1, p1}, Lf1/a;-><init>(Landroid/database/sqlite/SQLiteDatabase;)V

    aput-object v1, p0, v0

    :cond_15
    aget-object p0, p0, v0

    return-object p0
.end method


# virtual methods
.method public b(Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;
    .registers 3

    iget-object v0, p0, Lf1/c$a;->r:[Lf1/a;

    invoke-static {v0, p1}, Lf1/c$a;->e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    move-result-object p1

    return-object p1
.end method

.method public declared-synchronized close()V
    .registers 4

    monitor-enter p0

    :try_start_1
    invoke-super {p0}, Landroid/database/sqlite/SQLiteOpenHelper;->close()V

    iget-object v0, p0, Lf1/c$a;->r:[Lf1/a;

    const/4 v1, 0x0

    const/4 v2, 0x0

    aput-object v2, v0, v1
    :try_end_a
    .catchall {:try_start_1 .. :try_end_a} :catchall_c

    monitor-exit p0

    return-void

    :catchall_c
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public declared-synchronized g()Le1/a;
    .registers 3

    monitor-enter p0

    const/4 v0, 0x0

    :try_start_2
    iput-boolean v0, p0, Lf1/c$a;->t:Z

    invoke-virtual {p0}, Landroid/database/sqlite/SQLiteOpenHelper;->getWritableDatabase()Landroid/database/sqlite/SQLiteDatabase;

    move-result-object v0

    iget-boolean v1, p0, Lf1/c$a;->t:Z

    if-eqz v1, :cond_15

    invoke-virtual {p0}, Lf1/c$a;->close()V

    invoke-virtual {p0}, Lf1/c$a;->g()Le1/a;

    move-result-object v0
    :try_end_13
    .catchall {:try_start_2 .. :try_end_13} :catchall_1b

    monitor-exit p0

    return-object v0

    :cond_15
    :try_start_15
    invoke-virtual {p0, v0}, Lf1/c$a;->b(Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    move-result-object v0
    :try_end_19
    .catchall {:try_start_15 .. :try_end_19} :catchall_1b

    monitor-exit p0

    return-object v0

    :catchall_1b
    move-exception v0

    monitor-exit p0

    throw v0
.end method

.method public onConfigure(Landroid/database/sqlite/SQLiteDatabase;)V
    .registers 4

    iget-object v0, p0, Lf1/c$a;->s:Le1/b$a;

    .line 1
    iget-object v1, p0, Lf1/c$a;->r:[Lf1/a;

    invoke-static {v1, p1}, Lf1/c$a;->e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    .line 2
    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    return-void
.end method

.method public onCreate(Landroid/database/sqlite/SQLiteDatabase;)V
    .registers 6

    iget-object v0, p0, Lf1/c$a;->s:Le1/b$a;

    .line 1
    iget-object v1, p0, Lf1/c$a;->r:[Lf1/a;

    invoke-static {v1, p1}, Lf1/c$a;->e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    move-result-object p1

    .line 2
    check-cast v0, Lb1/i;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 3
    new-instance v1, Landroidx/appcompat/widget/d0;

    const/4 v2, 0x0

    const-string v3, "SELECT count(*) FROM sqlite_master WHERE name != \'android_metadata\'"

    .line 4
    invoke-direct {v1, v3, v2}, Landroidx/appcompat/widget/d0;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 5
    invoke-virtual {p1, v1}, Lf1/a;->e(Le1/d;)Landroid/database/Cursor;

    move-result-object v1

    .line 6
    :try_start_19
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    const/4 v3, 0x0

    if-eqz v2, :cond_28

    invoke-interface {v1, v3}, Landroid/database/Cursor;->getInt(I)I

    move-result v2
    :try_end_24
    .catchall {:try_start_19 .. :try_end_24} :catchall_79

    if-nez v2, :cond_28

    const/4 v2, 0x1

    goto :goto_29

    :cond_28
    move v2, v3

    :goto_29
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    .line 7
    iget-object v1, v0, Lb1/i;->c:Lb1/i$a;

    invoke-virtual {v1, p1}, Lb1/i$a;->a(Le1/a;)V

    if-nez v2, :cond_53

    iget-object v1, v0, Lb1/i;->c:Lb1/i$a;

    invoke-virtual {v1, p1}, Lb1/i$a;->b(Le1/a;)Lb1/i$b;

    move-result-object v1

    iget-boolean v2, v1, Lb1/i$b;->a:Z

    if-eqz v2, :cond_3e

    goto :goto_53

    :cond_3e
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string v0, "Pre-packaged database has an invalid schema: "

    invoke-static {v0}, Landroidx/activity/c;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, v1, Lb1/i$b;->b:Ljava/lang/String;

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

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

    move-result-object v0

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

    throw p1

    :cond_53
    :goto_53
    invoke-virtual {v0, p1}, Lb1/i;->c(Le1/a;)V

    iget-object p1, v0, Lb1/i;->c:Lb1/i$a;

    check-cast p1, Landroidx/work/impl/WorkDatabase_Impl$a;

    .line 8
    iget-object v0, p1, Landroidx/work/impl/WorkDatabase_Impl$a;->b:Landroidx/work/impl/WorkDatabase_Impl;

    sget v1, Landroidx/work/impl/WorkDatabase_Impl;->s:I

    .line 9
    iget-object v0, v0, Lb1/h;->g:Ljava/util/List;

    if-eqz v0, :cond_78

    .line 10
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    :goto_66
    if-ge v3, v0, :cond_78

    iget-object v1, p1, Landroidx/work/impl/WorkDatabase_Impl$a;->b:Landroidx/work/impl/WorkDatabase_Impl;

    .line 11
    iget-object v1, v1, Lb1/h;->g:Ljava/util/List;

    .line 12
    invoke-interface {v1, v3}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lb1/h$b;

    invoke-static {v1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    add-int/lit8 v3, v3, 0x1

    goto :goto_66

    :cond_78
    return-void

    :catchall_79
    move-exception p1

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

    throw p1
.end method

.method public onDowngrade(Landroid/database/sqlite/SQLiteDatabase;II)V
    .registers 6

    const/4 v0, 0x1

    iput-boolean v0, p0, Lf1/c$a;->t:Z

    iget-object v0, p0, Lf1/c$a;->s:Le1/b$a;

    .line 1
    iget-object v1, p0, Lf1/c$a;->r:[Lf1/a;

    invoke-static {v1, p1}, Lf1/c$a;->e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    move-result-object p1

    .line 2
    check-cast v0, Lb1/i;

    .line 3
    invoke-virtual {v0, p1, p2, p3}, Lb1/i;->b(Le1/a;II)V

    return-void
.end method

.method public onOpen(Landroid/database/sqlite/SQLiteDatabase;)V
    .registers 11

    iget-boolean v0, p0, Lf1/c$a;->t:Z

    if-nez v0, :cond_105

    iget-object v0, p0, Lf1/c$a;->s:Le1/b$a;

    .line 1
    iget-object v1, p0, Lf1/c$a;->r:[Lf1/a;

    invoke-static {v1, p1}, Lf1/c$a;->e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    move-result-object p1

    .line 2
    check-cast v0, Lb1/i;

    invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    .line 3
    new-instance v1, Landroidx/appcompat/widget/d0;

    const-string v2, "SELECT 1 FROM sqlite_master WHERE type = \'table\' AND name=\'room_master_table\'"

    const/4 v3, 0x0

    .line 4
    invoke-direct {v1, v2, v3}, Landroidx/appcompat/widget/d0;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 5
    invoke-virtual {p1, v1}, Lf1/a;->e(Le1/d;)Landroid/database/Cursor;

    move-result-object v1

    .line 6
    :try_start_1d
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    const/4 v4, 0x0

    const/4 v5, 0x1

    if-eqz v2, :cond_2d

    invoke-interface {v1, v4}, Landroid/database/Cursor;->getInt(I)I

    move-result v2
    :try_end_29
    .catchall {:try_start_1d .. :try_end_29} :catchall_100

    if-eqz v2, :cond_2d

    move v2, v5

    goto :goto_2e

    :cond_2d
    move v2, v4

    :goto_2e
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    if-eqz v2, :cond_6b

    .line 7
    new-instance v1, Landroidx/appcompat/widget/d0;

    const-string v2, "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1"

    .line 8
    invoke-direct {v1, v2, v3}, Landroidx/appcompat/widget/d0;-><init>(Ljava/lang/String;[Ljava/lang/Object;)V

    .line 9
    invoke-virtual {p1, v1}, Lf1/a;->e(Le1/d;)Landroid/database/Cursor;

    move-result-object v1

    :try_start_3e
    invoke-interface {v1}, Landroid/database/Cursor;->moveToFirst()Z

    move-result v2

    if-eqz v2, :cond_49

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

    move-result-object v2
    :try_end_48
    .catchall {:try_start_3e .. :try_end_48} :catchall_66

    goto :goto_4a

    :cond_49
    move-object v2, v3

    :goto_4a
    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    const-string v1, "c103703e120ae8cc73c9248622f3cd1e"

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

    move-result v1

    if-nez v1, :cond_7d

    const-string v1, "49f946663a8deb7054212b8adda248c6"

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

    move-result v1

    if-eqz v1, :cond_5e

    goto :goto_7d

    :cond_5e
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string v0, "Room cannot verify the data integrity. Looks like you\'ve changed schema but forgot to update the version number. You can simply fix this by increasing the version number."

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

    throw p1

    :catchall_66
    move-exception p1

    invoke-interface {v1}, Landroid/database/Cursor;->close()V

    throw p1

    :cond_6b
    iget-object v1, v0, Lb1/i;->c:Lb1/i$a;

    invoke-virtual {v1, p1}, Lb1/i$a;->b(Le1/a;)Lb1/i$b;

    move-result-object v1

    iget-boolean v2, v1, Lb1/i$b;->a:Z

    if-eqz v2, :cond_eb

    iget-object v1, v0, Lb1/i;->c:Lb1/i$a;

    invoke-static {v1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;

    invoke-virtual {v0, p1}, Lb1/i;->c(Le1/a;)V

    .line 10
    :cond_7d
    :goto_7d
    iget-object v1, v0, Lb1/i;->c:Lb1/i$a;

    check-cast v1, Landroidx/work/impl/WorkDatabase_Impl$a;

    .line 11
    iget-object v2, v1, Landroidx/work/impl/WorkDatabase_Impl$a;->b:Landroidx/work/impl/WorkDatabase_Impl;

    sget v6, Landroidx/work/impl/WorkDatabase_Impl;->s:I

    .line 12
    iput-object p1, v2, Lb1/h;->a:Le1/a;

    const-string v2, "PRAGMA foreign_keys = ON"

    .line 13
    iget-object v6, p1, Lf1/a;->r:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v6, v2}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 14
    iget-object v2, v1, Landroidx/work/impl/WorkDatabase_Impl$a;->b:Landroidx/work/impl/WorkDatabase_Impl;

    .line 15
    iget-object v2, v2, Lb1/h;->d:Lb1/g;

    .line 16
    monitor-enter v2

    :try_start_93
    iget-boolean v6, v2, Lb1/g;->f:Z

    if-eqz v6, :cond_9f

    const-string v5, "ROOM"

    const-string v6, "Invalidation tracker is initialized twice :/."

    invoke-static {v5, v6}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;)I

    goto :goto_c8

    :cond_9f
    const-string v6, "PRAGMA temp_store = MEMORY;"

    .line 17
    iget-object v7, p1, Lf1/a;->r:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v7, v6}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string v6, "PRAGMA recursive_triggers=\'ON\';"

    iget-object v7, p1, Lf1/a;->r:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v7, v6}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    const-string v6, "CREATE TEMP TABLE room_table_modification_log(table_id INTEGER PRIMARY KEY, invalidated INTEGER NOT NULL DEFAULT 0)"

    iget-object v7, p1, Lf1/a;->r:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v7, v6}, Landroid/database/sqlite/SQLiteDatabase;->execSQL(Ljava/lang/String;)V

    .line 18
    invoke-virtual {v2, p1}, Lb1/g;->d(Le1/a;)V

    const-string v6, "UPDATE room_table_modification_log SET invalidated = 0 WHERE invalidated = 1 "

    .line 19
    new-instance v7, Lf1/f;

    iget-object v8, p1, Lf1/a;->r:Landroid/database/sqlite/SQLiteDatabase;

    invoke-virtual {v8, v6}, Landroid/database/sqlite/SQLiteDatabase;->compileStatement(Ljava/lang/String;)Landroid/database/sqlite/SQLiteStatement;

    move-result-object v6

    invoke-direct {v7, v6}, Lf1/f;-><init>(Landroid/database/sqlite/SQLiteStatement;)V

    .line 20
    iput-object v7, v2, Lb1/g;->g:Lf1/f;

    iput-boolean v5, v2, Lb1/g;->f:Z

    :goto_c8
    monitor-exit v2
    :try_end_c9
    .catchall {:try_start_93 .. :try_end_c9} :catchall_e8

    .line 21
    iget-object v2, v1, Landroidx/work/impl/WorkDatabase_Impl$a;->b:Landroidx/work/impl/WorkDatabase_Impl;

    .line 22
    iget-object v2, v2, Lb1/h;->g:Ljava/util/List;

    if-eqz v2, :cond_e5

    .line 23
    invoke-interface {v2}, Ljava/util/List;->size()I

    move-result v2

    :goto_d3
    if-ge v4, v2, :cond_e5

    iget-object v5, v1, Landroidx/work/impl/WorkDatabase_Impl$a;->b:Landroidx/work/impl/WorkDatabase_Impl;

    .line 24
    iget-object v5, v5, Lb1/h;->g:Ljava/util/List;

    .line 25
    invoke-interface {v5, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v5

    check-cast v5, Lb1/h$b;

    invoke-virtual {v5, p1}, Lb1/h$b;->a(Le1/a;)V

    add-int/lit8 v4, v4, 0x1

    goto :goto_d3

    .line 26
    :cond_e5
    iput-object v3, v0, Lb1/i;->b:Lb1/a;

    goto :goto_105

    :catchall_e8
    move-exception p1

    .line 27
    :try_start_e9
    monitor-exit v2
    :try_end_ea
    .catchall {:try_start_e9 .. :try_end_ea} :catchall_e8

    throw p1

    .line 28
    :cond_eb
    new-instance p1, Ljava/lang/IllegalStateException;

    const-string v0, "Pre-packaged database has an invalid schema: "

    invoke-static {v0}, Landroidx/activity/c;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    iget-object v1, v1, Lb1/i$b;->b:Ljava/lang/String;

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

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

    move-result-object v0

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

    throw p1

    :catchall_100
    move-exception p1

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

    throw p1

    :cond_105
    :goto_105
    return-void
.end method

.method public onUpgrade(Landroid/database/sqlite/SQLiteDatabase;II)V
    .registers 6

    const/4 v0, 0x1

    iput-boolean v0, p0, Lf1/c$a;->t:Z

    iget-object v0, p0, Lf1/c$a;->s:Le1/b$a;

    .line 1
    iget-object v1, p0, Lf1/c$a;->r:[Lf1/a;

    invoke-static {v1, p1}, Lf1/c$a;->e([Lf1/a;Landroid/database/sqlite/SQLiteDatabase;)Lf1/a;

    move-result-object p1

    .line 2
    invoke-virtual {v0, p1, p2, p3}, Le1/b$a;->b(Le1/a;II)V

    return-void
.end method
