apkfuckery/com.discord/smali/androidx/room/RoomDatabase$MigrationContainer.smali
2019-07-24 13:27:29 +02:00

310 lines
6.8 KiB
Smali

.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
.field private mMigrations:Landroidx/collection/SparseArrayCompat;
.annotation system Ldalvik/annotation/Signature;
value = {
"Landroidx/collection/SparseArrayCompat<",
"Landroidx/collection/SparseArrayCompat<",
"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
new-instance v0, Landroidx/collection/SparseArrayCompat;
invoke-direct {v0}, Landroidx/collection/SparseArrayCompat;-><init>()V
iput-object v0, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Landroidx/collection/SparseArrayCompat;
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
iget-object v2, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Landroidx/collection/SparseArrayCompat;
invoke-virtual {v2, v0}, Landroidx/collection/SparseArrayCompat;->get(I)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroidx/collection/SparseArrayCompat;
if-nez v2, :cond_0
new-instance v2, Landroidx/collection/SparseArrayCompat;
invoke-direct {v2}, Landroidx/collection/SparseArrayCompat;-><init>()V
iget-object v3, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Landroidx/collection/SparseArrayCompat;
invoke-virtual {v3, v0, v2}, Landroidx/collection/SparseArrayCompat;->put(ILjava/lang/Object;)V
:cond_0
invoke-virtual {v2, v1}, Landroidx/collection/SparseArrayCompat;->get(I)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/room/migration/Migration;
if-eqz v0, :cond_1
new-instance v3, Ljava/lang/StringBuilder;
const-string v4, "Overriding migration "
invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
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
invoke-virtual {v2, v1, p1}, Landroidx/collection/SparseArrayCompat;->append(ILjava/lang/Object;)V
return-void
.end method
.method private findUpMigrationPath(Ljava/util/List;ZII)Ljava/util/List;
.locals 10
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Ljava/util/List<",
"Landroidx/room/migration/Migration;",
">;ZII)",
"Ljava/util/List<",
"Landroidx/room/migration/Migration;",
">;"
}
.end annotation
const/4 v0, -0x1
const/4 v1, 0x1
if-eqz p2, :cond_0
const/4 v2, -0x1
goto :goto_0
:cond_0
const/4 v2, 0x1
:cond_1
:goto_0
if-eqz p2, :cond_2
if-ge p3, p4, :cond_9
goto :goto_1
:cond_2
if-le p3, p4, :cond_9
:goto_1
iget-object v3, p0, Landroidx/room/RoomDatabase$MigrationContainer;->mMigrations:Landroidx/collection/SparseArrayCompat;
invoke-virtual {v3, p3}, Landroidx/collection/SparseArrayCompat;->get(I)Ljava/lang/Object;
move-result-object v3
check-cast v3, Landroidx/collection/SparseArrayCompat;
const/4 v4, 0x0
if-nez v3, :cond_3
return-object v4
:cond_3
invoke-virtual {v3}, Landroidx/collection/SparseArrayCompat;->size()I
move-result v5
const/4 v6, 0x0
if-eqz p2, :cond_4
add-int/lit8 v5, v5, -0x1
const/4 v7, -0x1
goto :goto_2
:cond_4
move v7, v5
const/4 v5, 0x0
:goto_2
if-eq v5, v7, :cond_8
invoke-virtual {v3, v5}, Landroidx/collection/SparseArrayCompat;->keyAt(I)I
move-result v8
if-eqz p2, :cond_6
if-gt v8, p4, :cond_5
if-le v8, p3, :cond_5
:goto_3
const/4 v9, 0x1
goto :goto_4
:cond_5
const/4 v9, 0x0
goto :goto_4
:cond_6
if-lt v8, p4, :cond_5
if-ge v8, p3, :cond_5
goto :goto_3
:goto_4
if-eqz v9, :cond_7
invoke-virtual {v3, v5}, Landroidx/collection/SparseArrayCompat;->valueAt(I)Ljava/lang/Object;
move-result-object p3
invoke-interface {p1, p3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
move p3, v8
const/4 v6, 0x1
goto :goto_5
:cond_7
add-int/2addr v5, v2
goto :goto_2
:cond_8
:goto_5
if-nez v6, :cond_1
return-object v4
:cond_9
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