2019-07-24 11:27:29 +00:00
.class public L androidx/room/RoomOpenHelper ;
.super L androidx/sqlite/db/SupportSQLiteOpenHelper$Callback ;
.source "RoomOpenHelper.java"
# annotations
2019-12-06 03:29:40 +00:00
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP_PREFIX : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
2019-07-24 11:27:29 +00:00
.annotation system L dalvik/annotation/MemberClasses ;
value = {
L androidx/room/RoomOpenHelper$Delegate ;
}
.end annotation
# instance fields
2019-12-06 03:29:40 +00:00
.field public mConfiguration : L androidx/room/DatabaseConfiguration ;
.annotation build L androidx/annotation/Nullable ;
.end annotation
.end field
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mIdentityHash : L java/lang/String ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mLegacyHash : L java/lang/String ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
2019-07-24 11:27:29 +00:00
# direct methods
.method public constructor <init> ( L androidx/room/DatabaseConfiguration ;L androidx/room/RoomOpenHelper$Delegate ;L java/lang/String ;) V
.locals 1
2019-12-06 03:29:40 +00:00
. 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
2019-07-24 11:27:29 +00:00
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
2019-12-06 03:29:40 +00:00
. 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
2019-07-24 11:27:29 +00:00
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
const/4 v1 , 0x0
if-eqz v0 , :cond_1
new-instance v0 , L androidx/sqlite/db/SimpleSQLiteQuery ;
const-string v2 , "SELECT identity_hash FROM room_master_table WHERE id = 42 LIMIT 1"
invoke-direct { v0 , v2 } , L androidx/sqlite/db/SimpleSQLiteQuery ;-> <init> ( L java/lang/String ;) V
invoke-interface { p1 , v0 } , L androidx/sqlite/db/SupportSQLiteDatabase ;-> query ( L androidx/sqlite/db/SupportSQLiteQuery ;) L android/database/Cursor ;
move-result-object p1
:try_start_0
invoke-interface { p1 } , L android/database/Cursor ;-> moveToFirst ( ) Z
move-result v0
if-eqz v0 , :cond_0
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
move-object v1 , v0
:cond_0
invoke-interface { p1 } , L android/database/Cursor ;-> close ( ) V
goto :goto_0
:catchall_0
move-exception v0
invoke-interface { p1 } , L android/database/Cursor ;-> close ( ) V
throw v0
:cond_1
:goto_0
iget-object p1 , p0 , L androidx/room/RoomOpenHelper ;-> mIdentityHash : L java/lang/String ;
invoke-virtual { p1 , v1 } , L java/lang/String ;-> equals ( L java/lang/Object ;) Z
move-result p1
if-nez p1 , :cond_3
iget-object p1 , p0 , L androidx/room/RoomOpenHelper ;-> mLegacyHash : L java/lang/String ;
invoke-virtual { p1 , v1 } , L java/lang/String ;-> equals ( L java/lang/Object ;) Z
move-result p1
if-eqz p1 , :cond_2
goto :goto_1
:cond_2
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
:cond_3
:goto_1
return-void
.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
2019-12-06 03:29:40 +00:00
.method public static hasRoomMasterTable ( L androidx/sqlite/db/SupportSQLiteDatabase ;) Z
2019-07-24 11:27:29 +00:00
.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
.locals 1
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> updateIdentity ( 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 ;-> createAllTables ( 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 ;-> 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
2019-12-06 03:29:40 +00:00
.locals 3
2019-07-24 11:27:29 +00:00
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mConfiguration : L androidx/room/DatabaseConfiguration ;
if-eqz v0 , :cond_1
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
if-eqz v0 , :cond_1
2019-10-07 23:23:22 +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
2019-07-24 11:27:29 +00:00
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 ;
invoke-virtual { v0 , p1 } , L androidx/room/RoomOpenHelper$Delegate ;-> validateMigration ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
2019-10-07 23:23:22 +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
2019-07-24 11:27:29 +00:00
invoke-direct { p0 , p1 } , L androidx/room/RoomOpenHelper ;-> updateIdentity ( L androidx/sqlite/db/SupportSQLiteDatabase ;) V
const/4 v0 , 0x1
goto :goto_1
:cond_1
const/4 v0 , 0x0
:goto_1
if-nez v0 , :cond_3
iget-object v0 , p0 , L androidx/room/RoomOpenHelper ;-> mConfiguration : L androidx/room/DatabaseConfiguration ;
if-eqz v0 , :cond_2
2019-10-07 23:23:22 +00:00
invoke-virtual { v0 , p2 , p3 } , L androidx/room/DatabaseConfiguration ;-> isMigrationRequired ( II ) Z
2019-07-24 11:27:29 +00:00
move-result v0
if-nez v0 , :cond_2
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
2019-12-06 03:29:40 +00:00
goto :goto_2
2019-07-24 11:27:29 +00:00
:cond_2
new-instance p1 , L java/lang/IllegalStateException ;
2019-12-06 03:29:40 +00:00
const-string v0 , "A migration from "
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
const-string v1 , " to "
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
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."
2019-07-24 11:27:29 +00:00
2020-04-17 16:36:30 +00:00
invoke-static { v0 , p2 , v1 , p3 , v2 } , L e/e/b/a/a ;-> a ( L java/lang/String ;I L java/lang/String ;I L java/lang/String ;) L java/lang/String ;
2019-07-24 11:27:29 +00:00
move-result-object p2
invoke-direct { p1 , p2 } , L java/lang/IllegalStateException ;-> <init> ( L java/lang/String ;) V
throw p1
:cond_3
2019-12-06 03:29:40 +00:00
:goto_2
2019-07-24 11:27:29 +00:00
return-void
.end method