2020-05-17 12:40:10 +00:00
.class public L androidx/room/RoomOpenHelper ;
.super L androidx/sqlite/db/SupportSQLiteOpenHelper$Callback ;
.source "RoomOpenHelper.java"
# annotations
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP_PREFIX : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
.annotation system L dalvik/annotation/MemberClasses ;
value = {
2020-07-08 16:44:49 +00:00
L androidx/room/RoomOpenHelper$ValidationResult ;,
2020-05-17 12:40:10 +00:00
L androidx/room/RoomOpenHelper$Delegate ;
}
.end annotation
# instance fields
.field public mConfiguration : L androidx/room/DatabaseConfiguration ;
.annotation build L androidx/annotation/Nullable ;
.end annotation
.end field
.field public final mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
.field public final mIdentityHash : L java/lang/String ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
.field public final mLegacyHash : L java/lang/String ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
# direct methods
.method public constructor <init> ( L androidx/room/DatabaseConfiguration ;L androidx/room/RoomOpenHelper$Delegate ;L java/lang/String ;) V
.locals 1
. param p1 # Landroidx/room/DatabaseConfiguration;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p2 # Landroidx/room/RoomOpenHelper$Delegate;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p3 # Ljava/lang/String;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
const-string v0 , ""
invoke-direct { p0 , p1 , p2 , v0 , p3 } , L androidx/room/RoomOpenHelper ;-> <init> ( L androidx/room/DatabaseConfiguration ;L androidx/room/RoomOpenHelper$Delegate ;L java/lang/String ;L java/lang/String ;) V
return-void
.end method
.method public constructor <init> ( L androidx/room/DatabaseConfiguration ;L androidx/room/RoomOpenHelper$Delegate ;L java/lang/String ;L java/lang/String ;) V
.locals 1
. param p1 # Landroidx/room/DatabaseConfiguration;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p2 # Landroidx/room/RoomOpenHelper$Delegate;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p3 # Ljava/lang/String;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
. param p4 # Ljava/lang/String;
.annotation build L androidx/annotation/NonNull ;
.end annotation
. end param
iget v0 , p2 , L androidx/room/RoomOpenHelper$Delegate ;-> version : I
invoke-direct { p0 , v0 } , L androidx/sqlite/db/SupportSQLiteOpenHelper$Callback ;-> <init> ( I ) V
iput-object p1 , p0 , L androidx/room/RoomOpenHelper ;-> mConfiguration : L androidx/room/DatabaseConfiguration ;
iput-object p2 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
iput-object p3 , p0 , L androidx/room/RoomOpenHelper ;-> mIdentityHash : L java/lang/String ;
iput-object p4 , p0 , L androidx/room/RoomOpenHelper ;-> mLegacyHash : L java/lang/String ;
return-void
.end method
.method private checkIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 3
invoke-static { p1 } , L androidx/room/RoomOpenHelper ;-> hasRoomMasterTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;) Z
move-result v0
2020-07-08 16:44:49 +00:00
if-eqz v0 , :cond_2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v0 , 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
new-instance v1 , L androidx/sqlite/db/SimpleSQLiteQuery ;
2020-05-17 12:40:10 +00:00
const-string v2 , "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1"
2020-07-08 16:44:49 +00:00
invoke-direct { v1 , v2 } , L androidx/sqlite/db/SimpleSQLiteQuery ;-> <init> ( L java/lang/String ;) V
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-interface { p1 , v1 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> query ( L androidx/sqlite/db/SupportSQLiteQuery ;) L android/database/Cursor ;
2020-05-17 12:40:10 +00:00
move-result-object p1
:try_start_0
invoke-interface { p1 } , L android/database/Cursor ;-> moveToFirst ( ) Z
2020-07-08 16:44:49 +00:00
move-result v1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-eqz v1 , :cond_0
2020-05-17 12:40:10 +00:00
const/4 v0 , 0x0
invoke-interface { p1 , v0 } , L android/database/Cursor ;-> getString ( I ) L java/lang/String ;
move-result-object v0
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_0
:cond_0
invoke-interface { p1 } , L android/database/Cursor ;-> close ( ) V
iget-object p1 , p0 , L androidx/room/RoomOpenHelper ;-> mIdentityHash : L java/lang/String ;
2020-07-08 16:44:49 +00:00
invoke-virtual { p1 , v0 } , L java/lang/String ;-> equals ( L java/lang/Object ;) Z
2020-05-17 12:40:10 +00:00
move-result p1
if-nez p1 , :cond_3
iget-object p1 , p0 , L androidx/room/RoomOpenHelper ;-> mLegacyHash : L java/lang/String ;
2020-07-08 16:44:49 +00:00
invoke-virtual { p1 , v0 } , L java/lang/String ;-> equals ( L java/lang/Object ;) Z
2020-05-17 12:40:10 +00:00
move-result p1
2020-07-08 16:44:49 +00:00
if-eqz p1 , :cond_1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
goto :goto_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_1
2020-05-17 12:40:10 +00:00
new-instance p1 , L java/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 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p1
2020-07-08 16:44:49 +00:00
:catchall_0
move-exception v0
invoke-interface { p1 } , L android/database/Cursor ;-> close ( ) V
throw v0
:cond_2
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onValidateSchema ( L androidx/sqlite/db/SupportSQLiteDatabase ;) L androidx/room/RoomOpenHelper$ValidationResult ;
move-result-object v0
iget-boolean v1 , v0 , L androidx/room/RoomOpenHelper$ValidationResult ;-> isValid : Z
if-eqz v1 , :cond_4
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onPostMigrate ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> updateIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
2020-05-17 12:40:10 +00:00
:cond_3
2020-07-08 16:44:49 +00:00
:goto_0
2020-05-17 12:40:10 +00:00
return-void
2020-07-08 16:44:49 +00:00
:cond_4
new-instance p1 , L java/lang/IllegalStateException ;
const-string v1 , "Pre-packaged database has an invalid schema: "
2020-09-23 03:12:49 +00:00
invoke-static { v1 } , L f/e/c/a/a ;-> F ( L java/lang/String ;) L java/lang/StringBuilder ;
2020-07-08 16:44:49 +00:00
move-result-object v1
iget-object v0 , v0 , L androidx/room/RoomOpenHelper$ValidationResult ;-> expectedFoundMsg : L java/lang/String ;
invoke-virtual { v1 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object v0
invoke-direct { p1 , v0 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p1
2020-05-17 12:40:10 +00:00
.end method
.method private createMasterTableIfNotExists ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 1
const-string v0 , "CREATE TABLE IF NOT EXISTS room_master_table (id INTEGER PRIMARY KEY,identity_hash TEXT)"
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
return-void
.end method
2020-07-08 16:44:49 +00:00
.method public static hasEmptySchema ( L androidx/sqlite/db/SupportSQLiteDatabase ;) Z
.locals 2
const-string v0 , "SELECT count(*) FROM sqlite_master WHERE name != \'android_metadata\'"
invoke-interface { p0 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> query ( L java/lang/String ;) L android/database/Cursor ;
move-result-object p0
:try_start_0
invoke-interface { p0 } , L android/database/Cursor ;-> moveToFirst ( ) Z
move-result v0
const/4 v1 , 0x0
if-eqz v0 , :cond_0
invoke-interface { p0 , v1 } , L android/database/Cursor ;-> getInt ( I ) I
move-result v0
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_0
if-nez v0 , :cond_0
const/4 v1 , 0x1
:cond_0
invoke-interface { p0 } , L android/database/Cursor ;-> close ( ) V
return v1
:catchall_0
move-exception v0
invoke-interface { p0 } , L android/database/Cursor ;-> close ( ) V
throw v0
.end method
2020-05-17 12:40:10 +00:00
.method public static hasRoomMasterTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;) Z
.locals 2
const-string v0 , "SELECT 1 FROM sqlite_master WHERE type = \'table\' AND name=\'room_master_table\'"
invoke-interface { p0 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> query ( L java/lang/String ;) L android/database/Cursor ;
move-result-object p0
:try_start_0
invoke-interface { p0 } , L android/database/Cursor ;-> moveToFirst ( ) Z
move-result v0
const/4 v1 , 0x0
if-eqz v0 , :cond_0
invoke-interface { p0 , v1 } , L android/database/Cursor ;-> getInt ( I ) I
move-result v0
:try_end_0
.catchall { :try_start_0 . . :try_end_0 } :catchall_0
if-eqz v0 , :cond_0
const/4 v1 , 0x1
:cond_0
invoke-interface { p0 } , L android/database/Cursor ;-> close ( ) V
return v1
:catchall_0
move-exception v0
invoke-interface { p0 } , L android/database/Cursor ;-> close ( ) V
throw v0
.end method
.method private updateIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 1
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> createMasterTableIfNotExists ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mIdentityHash : L java/lang/String ;
invoke-static { v0 } , L androidx/room/RoomMasterTable ;-> createInsertQuery ( L java/lang/String ;) L java/lang/String ;
move-result-object v0
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> execSQL ( L java/lang/String ;) V
return-void
.end method
# virtual methods
.method public onConfigure ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 0
invoke-super { p0 , p1 } , L androidx/sqlite/db/SupportSQLiteOpenHelper$Callback ;-> onConfigure ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
return-void
.end method
.method public onCreate ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
2020-07-08 16:44:49 +00:00
.locals 2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-static { p1 } , L androidx/room/RoomOpenHelper ;-> hasEmptySchema ( L androidx/sqlite/db/SupportSQLiteDatabase ;) Z
move-result v0
iget-object v1 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v1 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> createAllTables ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
if-nez v0 , :cond_1
2020-05-17 12:40:10 +00:00
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
2020-07-08 16:44:49 +00:00
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onValidateSchema ( L androidx/sqlite/db/SupportSQLiteDatabase ;) L androidx/room/RoomOpenHelper$ValidationResult ;
move-result-object v0
iget-boolean v1 , v0 , L androidx/room/RoomOpenHelper$ValidationResult ;-> isValid : Z
if-eqz v1 , :cond_0
goto :goto_0
:cond_0
new-instance p1 , L java/lang/IllegalStateException ;
const-string v1 , "Pre-packaged database has an invalid schema: "
2020-09-23 03:12:49 +00:00
invoke-static { v1 } , L f/e/c/a/a ;-> F ( L java/lang/String ;) L java/lang/StringBuilder ;
2020-07-08 16:44:49 +00:00
move-result-object v1
iget-object v0 , v0 , L androidx/room/RoomOpenHelper$ValidationResult ;-> expectedFoundMsg : L java/lang/String ;
invoke-virtual { v1 , v0 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v1 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object v0
invoke-direct { p1 , v0 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p1
:cond_1
:goto_0
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> updateIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
2020-05-17 12:40:10 +00:00
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onCreate ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
return-void
.end method
.method public onDowngrade ( L androidx/sqlite/db/SupportSQLiteDatabase ;II ) V
.locals 0
invoke-virtual { p0 , p1 , p2 , p3 } , L androidx/room/RoomOpenHelper ;-> onUpgrade ( L androidx/sqlite/db/SupportSQLiteDatabase ;II ) V
return-void
.end method
.method public onOpen ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
.locals 1
invoke-super { p0 , p1 } , L androidx/sqlite/db/SupportSQLiteOpenHelper$Callback ;-> onOpen ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> checkIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onOpen ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
const/4 p1 , 0x0
iput-object p1 , p0 , L androidx/room/RoomOpenHelper ;-> mConfiguration : L androidx/room/DatabaseConfiguration ;
return-void
.end method
.method public onUpgrade ( L androidx/sqlite/db/SupportSQLiteDatabase ;II ) V
.locals 3
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mConfiguration : L androidx/room/DatabaseConfiguration ;
2020-07-08 16:44:49 +00:00
if-eqz v0 , :cond_2
2020-05-17 12:40:10 +00:00
iget-object v0 , v0 , L androidx/room/DatabaseConfiguration ;-> migrationContainer : L androidx/room/RoomDatabase$MigrationContainer ;
invoke-virtual { v0 , p2 , p3 } , L androidx/room/RoomDatabase$MigrationContainer ;-> findMigrationPath ( II ) L java/util/List ;
move-result-object v0
2020-07-08 16:44:49 +00:00
if-eqz v0 , :cond_2
2020-05-17 12:40:10 +00:00
iget-object v1 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v1 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onPreMigrate ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
invoke-interface { v0 } , L java/util/List ;-> iterator ( ) L java/util/Iterator ;
move-result-object v0
:goto_0
invoke-interface { v0 } , L java/util/Iterator ;-> hasNext ( ) Z
move-result v1
if-eqz v1 , :cond_0
invoke-interface { v0 } , L java/util/Iterator ;-> next ( ) L java/lang/Object ;
move-result-object v1
check-cast v1 , L androidx/room/migration/Migration ;
invoke-virtual { v1 , p1 } , L androidx/room/migration/Migration ;-> migrate ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
goto :goto_0
:cond_0
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
2020-07-08 16:44:49 +00:00
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onValidateSchema ( L androidx/sqlite/db/SupportSQLiteDatabase ;) L androidx/room/RoomOpenHelper$ValidationResult ;
move-result-object v0
iget-boolean v1 , v0 , L androidx/room/RoomOpenHelper$ValidationResult ;-> isValid : Z
if-eqz v1 , :cond_1
2020-05-17 12:40:10 +00:00
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> onPostMigrate ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> updateIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
const/4 v0 , 0x1
goto :goto_1
:cond_1
2020-07-08 16:44:49 +00:00
new-instance p1 , L java/lang/IllegalStateException ;
const-string p2 , "Migration didn\'t properly handle: "
2020-09-23 03:12:49 +00:00
invoke-static { p2 } , L f/e/c/a/a ;-> F ( L java/lang/String ;) L java/lang/StringBuilder ;
2020-07-08 16:44:49 +00:00
move-result-object p2
iget-object p3 , v0 , L androidx/room/RoomOpenHelper$ValidationResult ;-> expectedFoundMsg : L java/lang/String ;
invoke-virtual { p2 , p3 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { p2 } , L java/lang/StringBuilder ;-> toString ( ) L java/lang/String ;
move-result-object p2
invoke-direct { p1 , p2 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p1
:cond_2
2020-05-17 12:40:10 +00:00
const/4 v0 , 0x0
:goto_1
2020-07-08 16:44:49 +00:00
if-nez v0 , :cond_4
2020-05-17 12:40:10 +00:00
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mConfiguration : L androidx/room/DatabaseConfiguration ;
2020-07-08 16:44:49 +00:00
if-eqz v0 , :cond_3
2020-05-17 12:40:10 +00:00
invoke-virtual { v0 , p2 , p3 } , L androidx/room/DatabaseConfiguration ;-> isMigrationRequired ( II ) Z
move-result v0
2020-07-08 16:44:49 +00:00
if-nez v0 , :cond_3
2020-05-17 12:40:10 +00:00
iget-object p2 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { p2 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> dropAllTables ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
iget-object p2 , p0 , L androidx/room/RoomOpenHelper ;-> mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
invoke-virtual { p2 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> createAllTables ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
goto :goto_2
2020-07-08 16:44:49 +00:00
:cond_3
2020-05-17 12:40:10 +00:00
new-instance p1 , L java/lang/IllegalStateException ;
const-string v0 , "A migration from "
const-string v1 , " to "
const-string v2 , " was required but not found. Please provide the necessary Migration path via RoomDatabase.Builder.addMigration(Migration ...) or allow for destructive migrations via one of the RoomDatabase.Builder.fallbackToDestructiveMigration* methods."
2020-09-23 03:12:49 +00:00
invoke-static { v0 , p2 , v1 , p3 , v2 } , L f/e/c/a/a ;-> l ( L java/lang/String ;I L java/lang/String ;I L java/lang/String ;) L java/lang/String ;
2020-05-17 12:40:10 +00:00
move-result-object p2
invoke-direct { p1 , p2 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p1
2020-07-08 16:44:49 +00:00
:cond_4
2020-05-17 12:40:10 +00:00
:goto_2
return-void
.end method