2019-02-04 20:08:30 +00:00
.class public L androidx/room/RoomOpenHelper ;
.super L androidx/sqlite/db/SupportSQLiteOpenHelper$Callback ;
2019-02-04 20:29:01 +00:00
.source "RoomOpenHelper.java"
2019-02-04 20:08:30 +00:00
# annotations
.annotation build L androidx/annotation/RestrictTo ;
value = {
.enum L androidx/annotation/RestrictTo$Scope ;-> LIBRARY_GROUP : L androidx/annotation/RestrictTo$Scope ;
}
.end annotation
.annotation system L dalvik/annotation/MemberClasses ;
value = {
L androidx/room/RoomOpenHelper$Delegate ;
}
.end annotation
# instance fields
.field private mConfiguration : L androidx/room/DatabaseConfiguration ;
.annotation build L androidx/annotation/Nullable ;
.end annotation
.end field
.field private final mDelegate : L androidx/room/RoomOpenHelper$Delegate ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
.field private final mIdentityHash : L java/lang/String ;
.annotation build L androidx/annotation/NonNull ;
.end annotation
.end field
.field private 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
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
.method private 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
.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
.locals 2
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
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
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
invoke-virtual { v0 , p2 } , L androidx/room/DatabaseConfiguration ;-> isMigrationRequiredFrom ( I ) Z
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
return-void
:cond_2
new-instance p1 , L java/lang/IllegalStateException ;
new-instance v0 , L java/lang/StringBuilder ;
const-string v1 , "A migration from "
invoke-direct { v0 , v1 } , L java/lang/StringBuilder ;-> <init> ( L java/lang/String ;) V
invoke-virtual { v0 , p2 } , L java/lang/StringBuilder ;-> append ( I ) L java/lang/StringBuilder ;
const-string p2 , " to "
invoke-virtual { v0 , p2 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v0 , p3 } , L java/lang/StringBuilder ;-> append ( I ) L java/lang/StringBuilder ;
const-string p2 , " 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 "
invoke-virtual { v0 , p2 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
const-string p2 , "RoomDatabase.Builder.fallbackToDestructiveMigration* methods."
invoke-virtual { v0 , p2 } , L java/lang/StringBuilder ;-> append ( L java/lang/String ;) L java/lang/StringBuilder ;
invoke-virtual { v0 } , 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_3
return-void
.end method