apkfuckery/com.discord/smali/androidx/room/RoomDatabase$MigrationContainer.smali

329 lines
7.4 KiB
Smali
Raw Normal View History

2020-05-17 12:40:10 +00:00
.class public Landroidx/room/RoomDatabase$MigrationContainer;
.super Ljava/lang/Object;
.source "RoomDatabase.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/room/RoomDatabase;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "MigrationContainer"
.end annotation
# instance fields
2020-07-08 16:44:49 +00:00
.field public mMigrations:Ljava/util/HashMap;
2020-05-17 12:40:10 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
2020-07-08 16:44:49 +00:00
"Ljava/util/HashMap<",
"Ljava/lang/Integer;",
"Ljava/util/TreeMap<",
"Ljava/lang/Integer;",
2020-05-17 12:40:10 +00:00
"Landroidx/room/migration/Migration;",
">;>;"
}
.end annotation
.end field
# direct methods
.method public constructor <init>()V
.locals 1
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
2020-07-08 16:44:49 +00:00
new-instance v0, Ljava/util/HashMap;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
iput-object v0, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Ljava/util/HashMap;
2020-05-17 12:40:10 +00:00
return-void
.end method
.method private addMigration(Landroidx/room/migration/Migration;)V
.locals 5
iget v0, p1, Landroidx/room/migration/Migration;->startVersion:I
iget v1, p1, Landroidx/room/migration/Migration;->endVersion:I
2020-07-08 16:44:49 +00:00
iget-object v2, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Ljava/util/HashMap;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
invoke-virtual {v2, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
move-result-object v2
2020-07-08 16:44:49 +00:00
check-cast v2, Ljava/util/TreeMap;
2020-05-17 12:40:10 +00:00
if-nez v2, :cond_0
2020-07-08 16:44:49 +00:00
new-instance v2, Ljava/util/TreeMap;
invoke-direct {v2}, Ljava/util/TreeMap;-><init>()V
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
iget-object v3, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Ljava/util/HashMap;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
invoke-virtual {v3, v0, v2}, Ljava/util/HashMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
:cond_0
2020-07-08 16:44:49 +00:00
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v2, v0}, Ljava/util/TreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
move-result-object v0
check-cast v0, Landroidx/room/migration/Migration;
if-eqz v0, :cond_1
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Overriding migration "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
const-string v0, " with "
invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
const-string v3, "ROOM"
invoke-static {v3, v0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
:cond_1
2020-07-08 16:44:49 +00:00
invoke-static {v1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
invoke-virtual {v2, v0, p1}, Ljava/util/TreeMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
return-void
.end method
.method private findUpMigrationPath(Ljava/util/List;ZII)Ljava/util/List;
2020-07-08 16:44:49 +00:00
.locals 6
2020-05-17 12:40:10 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/room/migration/Migration;",
">;ZII)",
"Ljava/util/List<",
"Landroidx/room/migration/Migration;",
">;"
}
.end annotation
2020-07-08 16:44:49 +00:00
:cond_0
if-eqz p2, :cond_1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-ge p3, p4, :cond_8
2020-05-17 12:40:10 +00:00
goto :goto_0
:cond_1
2020-07-08 16:44:49 +00:00
if-le p3, p4, :cond_8
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:goto_0
iget-object v0, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Ljava/util/HashMap;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-static {p3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {v0, v1}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
check-cast v0, Ljava/util/TreeMap;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
const/4 v1, 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-nez v0, :cond_2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
return-object v1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_2
if-eqz p2, :cond_3
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {v0}, Ljava/util/TreeMap;->descendingKeySet()Ljava/util/NavigableSet;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
goto :goto_1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_3
invoke-virtual {v0}, Ljava/util/TreeMap;->keySet()Ljava/util/Set;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:goto_1
invoke-interface {v2}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v2
2020-05-17 12:40:10 +00:00
:cond_4
2020-07-08 16:44:49 +00:00
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
move-result v3
const/4 v4, 0x1
2020-05-17 12:40:10 +00:00
const/4 v5, 0x0
2020-07-08 16:44:49 +00:00
if-eqz v3, :cond_7
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object v3
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
check-cast v3, Ljava/lang/Integer;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {v3}, Ljava/lang/Integer;->intValue()I
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result v3
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-eqz p2, :cond_5
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-gt v3, p4, :cond_6
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-le v3, p3, :cond_6
:goto_2
const/4 v5, 0x1
goto :goto_3
2020-05-17 12:40:10 +00:00
:cond_5
2020-07-08 16:44:49 +00:00
if-lt v3, p4, :cond_6
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
if-ge v3, p3, :cond_6
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
goto :goto_2
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_6
:goto_3
if-eqz v5, :cond_4
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
move-result-object p3
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
invoke-virtual {v0, p3}, Ljava/util/TreeMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
2020-05-17 12:40:10 +00:00
move-result-object p3
invoke-interface {p1, p3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
2020-07-08 16:44:49 +00:00
move p3, v3
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
goto :goto_4
2020-05-17 12:40:10 +00:00
:cond_7
2020-07-08 16:44:49 +00:00
const/4 v4, 0x0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:goto_4
if-nez v4, :cond_0
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
return-object v1
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
:cond_8
2020-05-17 12:40:10 +00:00
return-object p1
.end method
# virtual methods
.method public varargs addMigrations([Landroidx/room/migration/Migration;)V
.locals 3
.param p1 # [Landroidx/room/migration/Migration;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
array-length v0, p1
const/4 v1, 0x0
:goto_0
if-ge v1, v0, :cond_0
aget-object v2, p1, v1
invoke-direct {p0, v2}, Landroidx/room/RoomDatabase$MigrationContainer;->addMigration(Landroidx/room/migration/Migration;)V
add-int/lit8 v1, v1, 0x1
goto :goto_0
:cond_0
return-void
.end method
.method public findMigrationPath(II)Ljava/util/List;
.locals 2
.annotation build Landroidx/annotation/Nullable;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"(II)",
"Ljava/util/List<",
"Landroidx/room/migration/Migration;",
">;"
}
.end annotation
if-ne p1, p2, :cond_0
invoke-static {}, Ljava/util/Collections;->emptyList()Ljava/util/List;
move-result-object p1
return-object p1
:cond_0
if-le p2, p1, :cond_1
const/4 v0, 0x1
goto :goto_0
:cond_1
const/4 v0, 0x0
:goto_0
new-instance v1, Ljava/util/ArrayList;
invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V
invoke-direct {p0, v1, v0, p1, p2}, Landroidx/room/RoomDatabase$MigrationContainer;->findUpMigrationPath(Ljava/util/List;ZII)Ljava/util/List;
move-result-object p1
return-object p1
.end method