Rabbit-R1/original r1/smali/smali_classes2/androidx/room/SQLiteCopyOpenHelper.smali
2024-05-21 17:08:36 -04:00

971 lines
30 KiB
Smali

.class public final Landroidx/room/SQLiteCopyOpenHelper;
.super Ljava/lang/Object;
.source "SQLiteCopyOpenHelper.kt"
# interfaces
.implements Landroidx/sqlite/db/SupportSQLiteOpenHelper;
.implements Landroidx/room/DelegatingOpenHelper;
# annotations
.annotation runtime Lkotlin/Metadata;
d1 = {
"\u0000R\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000e\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0008\n\u0002\u0008\u0003\n\u0002\u0018\u0002\n\u0002\u0008\u0006\n\u0002\u0018\u0002\n\u0002\u0008\u0003\n\u0002\u0010\u000b\n\u0002\u0008\u0003\n\u0002\u0010\u0002\n\u0002\u0008\u000b\u0008\u0000\u0018\u00002\u00020\u00012\u00020\u0002BA\u0012\u0006\u0010\u0003\u001a\u00020\u0004\u0012\u0008\u0010\u0005\u001a\u0004\u0018\u00010\u0006\u0012\u0008\u0010\u0007\u001a\u0004\u0018\u00010\u0008\u0012\u000e\u0010\t\u001a\n\u0012\u0004\u0012\u00020\u000b\u0018\u00010\n\u0012\u0006\u0010\u000c\u001a\u00020\r\u0012\u0006\u0010\u000e\u001a\u00020\u0001\u00a2\u0006\u0002\u0010\u000fJ\u0008\u0010\u001f\u001a\u00020 H\u0016J\u0018\u0010!\u001a\u00020 2\u0006\u0010\"\u001a\u00020\u00082\u0006\u0010#\u001a\u00020\u001cH\u0002J\u0010\u0010$\u001a\u00020\u00012\u0006\u0010%\u001a\u00020\u0008H\u0002J\u0018\u0010&\u001a\u00020 2\u0006\u0010%\u001a\u00020\u00082\u0006\u0010#\u001a\u00020\u001cH\u0002J\u000e\u0010\'\u001a\u00020 2\u0006\u0010\u0010\u001a\u00020\u0011J\u0010\u0010(\u001a\u00020 2\u0006\u0010)\u001a\u00020\u001cH\u0017J\u0010\u0010*\u001a\u00020 2\u0006\u0010#\u001a\u00020\u001cH\u0002R\u000e\u0010\u0003\u001a\u00020\u0004X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u0004\u0018\u00010\u0006X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u0004\u0018\u00010\u0008X\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0016\u0010\t\u001a\n\u0012\u0004\u0012\u00020\u000b\u0018\u00010\nX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0010\u001a\u00020\u0011X\u0082.\u00a2\u0006\u0002\n\u0000R\u0016\u0010\u0012\u001a\u0004\u0018\u00010\u00068VX\u0096\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\u0013\u0010\u0014R\u000e\u0010\u000c\u001a\u00020\rX\u0082\u0004\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u000e\u001a\u00020\u0001X\u0096\u0004\u00a2\u0006\u0008\n\u0000\u001a\u0004\u0008\u0015\u0010\u0016R\u0014\u0010\u0017\u001a\u00020\u00188VX\u0096\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\u0019\u0010\u001aR\u000e\u0010\u001b\u001a\u00020\u001cX\u0082\u000e\u00a2\u0006\u0002\n\u0000R\u0014\u0010\u001d\u001a\u00020\u00188VX\u0096\u0004\u00a2\u0006\u0006\u001a\u0004\u0008\u001e\u0010\u001a\u00a8\u0006+"
}
d2 = {
"Landroidx/room/SQLiteCopyOpenHelper;",
"Landroidx/sqlite/db/SupportSQLiteOpenHelper;",
"Landroidx/room/DelegatingOpenHelper;",
"context",
"Landroid/content/Context;",
"copyFromAssetPath",
"",
"copyFromFile",
"Ljava/io/File;",
"copyFromInputStream",
"Ljava/util/concurrent/Callable;",
"Ljava/io/InputStream;",
"databaseVersion",
"",
"delegate",
"(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;Ljava/util/concurrent/Callable;ILandroidx/sqlite/db/SupportSQLiteOpenHelper;)V",
"databaseConfiguration",
"Landroidx/room/DatabaseConfiguration;",
"databaseName",
"getDatabaseName",
"()Ljava/lang/String;",
"getDelegate",
"()Landroidx/sqlite/db/SupportSQLiteOpenHelper;",
"readableDatabase",
"Landroidx/sqlite/db/SupportSQLiteDatabase;",
"getReadableDatabase",
"()Landroidx/sqlite/db/SupportSQLiteDatabase;",
"verified",
"",
"writableDatabase",
"getWritableDatabase",
"close",
"",
"copyDatabaseFile",
"destinationFile",
"writable",
"createFrameworkOpenHelper",
"databaseFile",
"dispatchOnOpenPrepackagedDatabase",
"setDatabaseConfiguration",
"setWriteAheadLoggingEnabled",
"enabled",
"verifyDatabaseFile",
"room-runtime_release"
}
k = 0x1
mv = {
0x1,
0x7,
0x1
}
xi = 0x30
.end annotation
# instance fields
.field private final context:Landroid/content/Context;
.field private final copyFromAssetPath:Ljava/lang/String;
.field private final copyFromFile:Ljava/io/File;
.field private final copyFromInputStream:Ljava/util/concurrent/Callable;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/concurrent/Callable<",
"Ljava/io/InputStream;",
">;"
}
.end annotation
.end field
.field private databaseConfiguration:Landroidx/room/DatabaseConfiguration;
.field private final databaseVersion:I
.field private final delegate:Landroidx/sqlite/db/SupportSQLiteOpenHelper;
.field private verified:Z
# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/lang/String;Ljava/io/File;Ljava/util/concurrent/Callable;ILandroidx/sqlite/db/SupportSQLiteOpenHelper;)V
.locals 1
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Landroid/content/Context;",
"Ljava/lang/String;",
"Ljava/io/File;",
"Ljava/util/concurrent/Callable<",
"Ljava/io/InputStream;",
">;I",
"Landroidx/sqlite/db/SupportSQLiteOpenHelper;",
")V"
}
.end annotation
const-string v0, "context"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string v0, "delegate"
invoke-static {p6, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 45
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p1, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
iput-object p2, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromAssetPath:Ljava/lang/String;
iput-object p3, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromFile:Ljava/io/File;
iput-object p4, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromInputStream:Ljava/util/concurrent/Callable;
iput p5, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseVersion:I
iput-object p6, p0, Landroidx/room/SQLiteCopyOpenHelper;->delegate:Landroidx/sqlite/db/SupportSQLiteOpenHelper;
return-void
.end method
.method private final copyDatabaseFile(Ljava/io/File;Z)V
.locals 4
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
iget-object v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromAssetPath:Ljava/lang/String;
if-eqz v0, :cond_0
iget-object v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
.line 156
invoke-virtual {v0}, Landroid/content/Context;->getAssets()Landroid/content/res/AssetManager;
move-result-object v0
iget-object v1, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromAssetPath:Ljava/lang/String;
invoke-virtual {v0, v1}, Landroid/content/res/AssetManager;->open(Ljava/lang/String;)Ljava/io/InputStream;
move-result-object v0
invoke-static {v0}, Ljava/nio/channels/Channels;->newChannel(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;
move-result-object v0
const-string v1, "newChannel(context.assets.open(copyFromAssetPath))"
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
goto :goto_0
:cond_0
iget-object v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromFile:Ljava/io/File;
if-eqz v0, :cond_1
.line 158
new-instance v0, Ljava/io/FileInputStream;
iget-object v1, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromFile:Ljava/io/File;
invoke-direct {v0, v1}, Ljava/io/FileInputStream;-><init>(Ljava/io/File;)V
invoke-virtual {v0}, Ljava/io/FileInputStream;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object v0
const-string v1, "FileInputStream(copyFromFile).channel"
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
check-cast v0, Ljava/nio/channels/ReadableByteChannel;
goto :goto_0
:cond_1
iget-object v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->copyFromInputStream:Ljava/util/concurrent/Callable;
if-eqz v0, :cond_5
.line 161
:try_start_0
invoke-interface {v0}, Ljava/util/concurrent/Callable;->call()Ljava/lang/Object;
move-result-object v0
check-cast v0, Ljava/io/InputStream;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 165
invoke-static {v0}, Ljava/nio/channels/Channels;->newChannel(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;
move-result-object v0
const-string v1, "newChannel(inputStream)"
invoke-static {v0, v1}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
:goto_0
iget-object v1, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
.line 175
invoke-virtual {v1}, Landroid/content/Context;->getCacheDir()Ljava/io/File;
move-result-object v1
const-string v2, "room-copy-helper"
const-string v3, ".tmp"
.line 174
invoke-static {v2, v3, v1}, Ljava/io/File;->createTempFile(Ljava/lang/String;Ljava/lang/String;Ljava/io/File;)Ljava/io/File;
move-result-object v1
.line 177
invoke-virtual {v1}, Ljava/io/File;->deleteOnExit()V
.line 178
new-instance v2, Ljava/io/FileOutputStream;
invoke-direct {v2, v1}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;)V
invoke-virtual {v2}, Ljava/io/FileOutputStream;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object v2
const-string v3, "output"
.line 179
invoke-static {v2, v3}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {v0, v2}, Landroidx/room/util/FileUtil;->copy(Ljava/nio/channels/ReadableByteChannel;Ljava/nio/channels/FileChannel;)V
.line 180
invoke-virtual {p1}, Ljava/io/File;->getParentFile()Ljava/io/File;
move-result-object v0
if-eqz v0, :cond_3
.line 181
invoke-virtual {v0}, Ljava/io/File;->exists()Z
move-result v2
if-nez v2, :cond_3
invoke-virtual {v0}, Ljava/io/File;->mkdirs()Z
move-result v0
if-eqz v0, :cond_2
goto :goto_1
.line 182
:cond_2
new-instance p0, Ljava/io/IOException;
.line 183
new-instance p2, Ljava/lang/StringBuilder;
const-string v0, "Failed to create directories for "
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object p1
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
.line 182
invoke-direct {p0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p0
:cond_3
:goto_1
const-string v0, "intermediateFile"
.line 190
invoke-static {v1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0, v1, p2}, Landroidx/room/SQLiteCopyOpenHelper;->dispatchOnOpenPrepackagedDatabase(Ljava/io/File;Z)V
.line 191
invoke-virtual {v1, p1}, Ljava/io/File;->renameTo(Ljava/io/File;)Z
move-result p0
if-eqz p0, :cond_4
return-void
.line 192
:cond_4
new-instance p0, Ljava/io/IOException;
.line 193
new-instance p2, Ljava/lang/StringBuilder;
const-string v0, "Failed to move intermediate file ("
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {v1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object v0
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
const-string v0, ") to destination ("
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p2
.line 194
invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object p1
.line 193
invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p1
const-string p2, ")."
invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p1
invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
.line 192
invoke-direct {p0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
throw p0
:catch_0
move-exception p0
.line 163
new-instance p1, Ljava/io/IOException;
const-string p2, "inputStreamCallable exception on call"
check-cast p0, Ljava/lang/Throwable;
invoke-direct {p1, p2, p0}, Ljava/io/IOException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p1
.line 167
:cond_5
new-instance p0, Ljava/lang/IllegalStateException;
const-string p1, "copyFromAssetPath, copyFromFile and copyFromInputStream are all null!"
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method private final createFrameworkOpenHelper(Ljava/io/File;)Landroidx/sqlite/db/SupportSQLiteOpenHelper;
.locals 3
.line 212
:try_start_0
invoke-static {p1}, Landroidx/room/util/DBUtil;->readVersion(Ljava/io/File;)I
move-result v0
:try_end_0
.catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_0
.line 216
new-instance v1, Landroidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory;
invoke-direct {v1}, Landroidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory;-><init>()V
.line 217
sget-object v2, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration;->Companion:Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Companion;
iget-object p0, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
invoke-virtual {v2, p0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Companion;->builder(Landroid/content/Context;)Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Builder;
move-result-object p0
.line 218
invoke-virtual {p1}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;
move-result-object p1
invoke-virtual {p0, p1}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Builder;->name(Ljava/lang/String;)Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Builder;
move-result-object p0
const/4 p1, 0x1
.line 219
invoke-static {v0, p1}, Lkotlin/ranges/RangesKt;->coerceAtLeast(II)I
move-result p1
new-instance v2, Landroidx/room/SQLiteCopyOpenHelper$createFrameworkOpenHelper$configuration$1;
invoke-direct {v2, v0, p1}, Landroidx/room/SQLiteCopyOpenHelper$createFrameworkOpenHelper$configuration$1;-><init>(II)V
check-cast v2, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;
invoke-virtual {p0, v2}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Builder;->callback(Landroidx/sqlite/db/SupportSQLiteOpenHelper$Callback;)Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Builder;
move-result-object p0
.line 239
invoke-virtual {p0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration$Builder;->build()Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration;
move-result-object p0
.line 240
invoke-virtual {v1, p0}, Landroidx/sqlite/db/framework/FrameworkSQLiteOpenHelperFactory;->create(Landroidx/sqlite/db/SupportSQLiteOpenHelper$Configuration;)Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object p0
return-object p0
:catch_0
move-exception p0
.line 214
new-instance p1, Ljava/lang/RuntimeException;
const-string v0, "Malformed database file, unable to read version."
check-cast p0, Ljava/lang/Throwable;
invoke-direct {p1, v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p1
.end method
.method private final dispatchOnOpenPrepackagedDatabase(Ljava/io/File;Z)V
.locals 3
iget-object v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseConfiguration:Landroidx/room/DatabaseConfiguration;
const-string v1, "databaseConfiguration"
const/4 v2, 0x0
if-nez v0, :cond_0
.line 200
invoke-static {v1}, Lkotlin/jvm/internal/Intrinsics;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
move-object v0, v2
:cond_0
iget-object v0, v0, Landroidx/room/DatabaseConfiguration;->prepackagedDatabaseCallback:Landroidx/room/RoomDatabase$PrepackagedDatabaseCallback;
if-nez v0, :cond_1
return-void
.line 204
:cond_1
invoke-direct {p0, p1}, Landroidx/room/SQLiteCopyOpenHelper;->createFrameworkOpenHelper(Ljava/io/File;)Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object p1
check-cast p1, Ljava/io/Closeable;
:try_start_0
move-object v0, p1
check-cast v0, Landroidx/sqlite/db/SupportSQLiteOpenHelper;
if-eqz p2, :cond_2
.line 205
invoke-interface {v0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getWritableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
move-result-object p2
goto :goto_0
:cond_2
invoke-interface {v0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getReadableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
move-result-object p2
:goto_0
iget-object p0, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseConfiguration:Landroidx/room/DatabaseConfiguration;
if-nez p0, :cond_3
.line 206
invoke-static {v1}, Lkotlin/jvm/internal/Intrinsics;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
move-object p0, v2
:cond_3
iget-object p0, p0, Landroidx/room/DatabaseConfiguration;->prepackagedDatabaseCallback:Landroidx/room/RoomDatabase$PrepackagedDatabaseCallback;
invoke-static {p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNull(Ljava/lang/Object;)V
invoke-virtual {p0, p2}, Landroidx/room/RoomDatabase$PrepackagedDatabaseCallback;->onOpenPrepackagedDatabase(Landroidx/sqlite/db/SupportSQLiteDatabase;)V
.line 207
sget-object p0, Lkotlin/Unit;->INSTANCE:Lkotlin/Unit;
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 204
invoke-static {p1, v2}, Lkotlin/io/CloseableKt;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
return-void
:catchall_0
move-exception p0
:try_start_1
throw p0
:try_end_1
.catchall {:try_start_1 .. :try_end_1} :catchall_1
:catchall_1
move-exception p2
invoke-static {p1, p0}, Lkotlin/io/CloseableKt;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
throw p2
.end method
.method private final verifyDatabaseFile(Z)V
.locals 10
const-string v0, "ROOM"
const-string v1, "Failed to delete database file ("
.line 96
invoke-virtual {p0}, Landroidx/room/SQLiteCopyOpenHelper;->getDatabaseName()Ljava/lang/String;
move-result-object v2
if-eqz v2, :cond_6
iget-object v3, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
.line 97
invoke-virtual {v3, v2}, Landroid/content/Context;->getDatabasePath(Ljava/lang/String;)Ljava/io/File;
move-result-object v3
iget-object v4, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseConfiguration:Landroidx/room/DatabaseConfiguration;
const-string v5, "databaseConfiguration"
const/4 v6, 0x0
if-nez v4, :cond_0
.line 98
invoke-static {v5}, Lkotlin/jvm/internal/Intrinsics;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
move-object v4, v6
:cond_0
iget-boolean v4, v4, Landroidx/room/DatabaseConfiguration;->multiInstanceInvalidation:Z
.line 99
new-instance v7, Landroidx/sqlite/util/ProcessLock;
iget-object v8, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
.line 101
invoke-virtual {v8}, Landroid/content/Context;->getFilesDir()Ljava/io/File;
move-result-object v8
const-string v9, "context.filesDir"
invoke-static {v8, v9}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
.line 99
invoke-direct {v7, v2, v8, v4}, Landroidx/sqlite/util/ProcessLock;-><init>(Ljava/lang/String;Ljava/io/File;Z)V
const/4 v4, 0x0
const/4 v8, 0x1
.line 107
:try_start_0
invoke-static {v7, v4, v8, v6}, Landroidx/sqlite/util/ProcessLock;->lock$default(Landroidx/sqlite/util/ProcessLock;ZILjava/lang/Object;)V
.line 108
invoke-virtual {v3}, Ljava/io/File;->exists()Z
move-result v4
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
const-string v8, "Unable to copy database file."
const-string v9, "databaseFile"
if-nez v4, :cond_1
.line 111
:try_start_1
invoke-static {v3, v9}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0, v3, p1}, Landroidx/room/SQLiteCopyOpenHelper;->copyDatabaseFile(Ljava/io/File;Z)V
:try_end_1
.catch Ljava/io/IOException; {:try_start_1 .. :try_end_1} :catch_0
.catchall {:try_start_1 .. :try_end_1} :catchall_0
.line 148
invoke-virtual {v7}, Landroidx/sqlite/util/ProcessLock;->unlock()V
return-void
:catch_0
move-exception p0
.line 114
:try_start_2
new-instance p1, Ljava/lang/RuntimeException;
check-cast p0, Ljava/lang/Throwable;
invoke-direct {p1, v8, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw p1
:try_end_2
.catchall {:try_start_2 .. :try_end_2} :catchall_0
.line 120
:cond_1
:try_start_3
invoke-static {v3, v9}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-static {v3}, Landroidx/room/util/DBUtil;->readVersion(Ljava/io/File;)I
move-result v4
:try_end_3
.catch Ljava/io/IOException; {:try_start_3 .. :try_end_3} :catch_2
.catchall {:try_start_3 .. :try_end_3} :catchall_0
:try_start_4
iget v9, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseVersion:I
:try_end_4
.catchall {:try_start_4 .. :try_end_4} :catchall_0
if-ne v4, v9, :cond_2
.line 148
invoke-virtual {v7}, Landroidx/sqlite/util/ProcessLock;->unlock()V
return-void
:cond_2
:try_start_5
iget-object v9, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseConfiguration:Landroidx/room/DatabaseConfiguration;
if-nez v9, :cond_3
.line 128
invoke-static {v5}, Lkotlin/jvm/internal/Intrinsics;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
goto :goto_0
:cond_3
move-object v6, v9
:goto_0
iget v5, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseVersion:I
invoke-virtual {v6, v4, v5}, Landroidx/room/DatabaseConfiguration;->isMigrationRequired(II)Z
move-result v4
:try_end_5
.catchall {:try_start_5 .. :try_end_5} :catchall_0
if-eqz v4, :cond_4
.line 148
invoke-virtual {v7}, Landroidx/sqlite/util/ProcessLock;->unlock()V
return-void
:cond_4
:try_start_6
iget-object v4, p0, Landroidx/room/SQLiteCopyOpenHelper;->context:Landroid/content/Context;
.line 133
invoke-virtual {v4, v2}, Landroid/content/Context;->deleteDatabase(Ljava/lang/String;)Z
move-result v4
:try_end_6
.catchall {:try_start_6 .. :try_end_6} :catchall_0
if-eqz v4, :cond_5
.line 135
:try_start_7
invoke-direct {p0, v3, p1}, Landroidx/room/SQLiteCopyOpenHelper;->copyDatabaseFile(Ljava/io/File;Z)V
:try_end_7
.catch Ljava/io/IOException; {:try_start_7 .. :try_end_7} :catch_1
.catchall {:try_start_7 .. :try_end_7} :catchall_0
goto :goto_1
:catch_1
move-exception p0
.line 139
:try_start_8
check-cast p0, Ljava/lang/Throwable;
invoke-static {v0, v8, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto :goto_1
.line 143
:cond_5
new-instance p0, Ljava/lang/StringBuilder;
invoke-direct {p0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
const-string p1, ") for a copy destructive migration."
invoke-virtual {p0, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object p0
invoke-virtual {p0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
.line 142
invoke-static {v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:try_end_8
.catchall {:try_start_8 .. :try_end_8} :catchall_0
.line 148
:goto_1
invoke-virtual {v7}, Landroidx/sqlite/util/ProcessLock;->unlock()V
return-void
:catch_2
move-exception p0
:try_start_9
const-string p1, "Unable to read database version."
.line 122
check-cast p0, Ljava/lang/Throwable;
invoke-static {v0, p1, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
:try_end_9
.catchall {:try_start_9 .. :try_end_9} :catchall_0
.line 148
invoke-virtual {v7}, Landroidx/sqlite/util/ProcessLock;->unlock()V
return-void
:catchall_0
move-exception p0
invoke-virtual {v7}, Landroidx/sqlite/util/ProcessLock;->unlock()V
throw p0
.line 96
:cond_6
new-instance p0, Ljava/lang/IllegalStateException;
const-string p1, "Required value was null."
invoke-virtual {p1}, Ljava/lang/Object;->toString()Ljava/lang/String;
move-result-object p1
invoke-direct {p0, p1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
throw p0
.end method
# virtual methods
.method public declared-synchronized close()V
.locals 1
monitor-enter p0
.line 85
:try_start_0
invoke-virtual {p0}, Landroidx/room/SQLiteCopyOpenHelper;->getDelegate()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object v0
invoke-interface {v0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->close()V
const/4 v0, 0x0
iput-boolean v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->verified:Z
:try_end_0
.catchall {:try_start_0 .. :try_end_0} :catchall_0
.line 87
monitor-exit p0
return-void
:catchall_0
move-exception v0
monitor-exit p0
throw v0
.end method
.method public getDatabaseName()Ljava/lang/String;
.locals 0
.line 58
invoke-virtual {p0}, Landroidx/room/SQLiteCopyOpenHelper;->getDelegate()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object p0
invoke-interface {p0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getDatabaseName()Ljava/lang/String;
move-result-object p0
return-object p0
.end method
.method public getDelegate()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
.locals 0
iget-object p0, p0, Landroidx/room/SQLiteCopyOpenHelper;->delegate:Landroidx/sqlite/db/SupportSQLiteOpenHelper;
return-object p0
.end method
.method public getReadableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
.locals 1
iget-boolean v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->verified:Z
if-nez v0, :cond_0
const/4 v0, 0x0
.line 77
invoke-direct {p0, v0}, Landroidx/room/SQLiteCopyOpenHelper;->verifyDatabaseFile(Z)V
const/4 v0, 0x1
iput-boolean v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->verified:Z
.line 80
:cond_0
invoke-virtual {p0}, Landroidx/room/SQLiteCopyOpenHelper;->getDelegate()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object p0
invoke-interface {p0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getReadableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
move-result-object p0
return-object p0
.end method
.method public getWritableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
.locals 1
iget-boolean v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->verified:Z
if-nez v0, :cond_0
const/4 v0, 0x1
.line 68
invoke-direct {p0, v0}, Landroidx/room/SQLiteCopyOpenHelper;->verifyDatabaseFile(Z)V
iput-boolean v0, p0, Landroidx/room/SQLiteCopyOpenHelper;->verified:Z
.line 71
:cond_0
invoke-virtual {p0}, Landroidx/room/SQLiteCopyOpenHelper;->getDelegate()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object p0
invoke-interface {p0}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->getWritableDatabase()Landroidx/sqlite/db/SupportSQLiteDatabase;
move-result-object p0
return-object p0
.end method
.method public final setDatabaseConfiguration(Landroidx/room/DatabaseConfiguration;)V
.locals 1
const-string v0, "databaseConfiguration"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iput-object p1, p0, Landroidx/room/SQLiteCopyOpenHelper;->databaseConfiguration:Landroidx/room/DatabaseConfiguration;
return-void
.end method
.method public setWriteAheadLoggingEnabled(Z)V
.locals 0
.line 62
invoke-virtual {p0}, Landroidx/room/SQLiteCopyOpenHelper;->getDelegate()Landroidx/sqlite/db/SupportSQLiteOpenHelper;
move-result-object p0
invoke-interface {p0, p1}, Landroidx/sqlite/db/SupportSQLiteOpenHelper;->setWriteAheadLoggingEnabled(Z)V
return-void
.end method