apkfuckery/com.discord/smali/androidx/room/Room.smali

313 lines
8.8 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class public Landroidx/room/Room;
.super Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
.source "Room.java"
2019-02-04 20:08:30 +00:00
# static fields
.field private static final CURSOR_CONV_SUFFIX:Ljava/lang/String; = "_CursorConverter"
.field static final LOG_TAG:Ljava/lang/String; = "ROOM"
.field public static final MASTER_TABLE_NAME:Ljava/lang/String; = "room_master_table"
# direct methods
.method public constructor <init>()V
.locals 0
.annotation runtime Ljava/lang/Deprecated;
.end annotation
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public static databaseBuilder(Landroid/content/Context;Ljava/lang/Class;Ljava/lang/String;)Landroidx/room/RoomDatabase$Builder;
.locals 1
.param p0 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/Class;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Landroidx/room/RoomDatabase;",
">(",
"Landroid/content/Context;",
"Ljava/lang/Class<",
"TT;>;",
"Ljava/lang/String;",
")",
"Landroidx/room/RoomDatabase$Builder<",
"TT;>;"
}
.end annotation
if-eqz p2, :cond_0
invoke-virtual {p2}, Ljava/lang/String;->trim()Ljava/lang/String;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v0
if-eqz v0, :cond_0
new-instance v0, Landroidx/room/RoomDatabase$Builder;
invoke-direct {v0, p0, p1, p2}, Landroidx/room/RoomDatabase$Builder;-><init>(Landroid/content/Context;Ljava/lang/Class;Ljava/lang/String;)V
return-object v0
:cond_0
new-instance p0, Ljava/lang/IllegalArgumentException;
const-string p1, "Cannot build a database with null or empty name. If you are trying to create an in memory database, use Room.inMemoryDatabaseBuilder"
invoke-direct {p0, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p0
.end method
.method static getGeneratedImplementation(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Object;
.locals 5
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
"C:",
"Ljava/lang/Object;",
">(",
"Ljava/lang/Class<",
"TC;>;",
"Ljava/lang/String;",
")TT;"
}
.end annotation
invoke-virtual {p0}, Ljava/lang/Class;->getPackage()Ljava/lang/Package;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Package;->getName()Ljava/lang/String;
move-result-object v0
invoke-virtual {p0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
move-result-object v1
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v2
if-eqz v2, :cond_0
goto :goto_0
:cond_0
invoke-virtual {v0}, Ljava/lang/String;->length()I
move-result v2
add-int/lit8 v2, v2, 0x1
invoke-virtual {v1, v2}, Ljava/lang/String;->substring(I)Ljava/lang/String;
move-result-object v1
:goto_0
new-instance v2, Ljava/lang/StringBuilder;
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
const/16 v3, 0x2e
const/16 v4, 0x5f
invoke-virtual {v1, v3, v4}, Ljava/lang/String;->replace(CC)Ljava/lang/String;
move-result-object v1
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p1
:try_start_0
invoke-virtual {v0}, Ljava/lang/String;->isEmpty()Z
move-result v1
if-eqz v1, :cond_1
move-object v0, p1
goto :goto_1
:cond_1
new-instance v1, Ljava/lang/StringBuilder;
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string v0, "."
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v0
:goto_1
invoke-static {v0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
move-result-object v0
invoke-virtual {v0}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;
2019-02-04 20:29:01 +00:00
move-result-object p0
2019-02-04 20:08:30 +00:00
:try_end_0
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_0
2019-02-04 20:29:01 +00:00
return-object p0
2019-02-04 20:08:30 +00:00
:catch_0
new-instance p1, Ljava/lang/RuntimeException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Failed to create an instance of "
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
move-result-object p0
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw p1
:catch_1
new-instance p1, Ljava/lang/RuntimeException;
new-instance v0, Ljava/lang/StringBuilder;
const-string v1, "Cannot access the constructor"
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
move-result-object p0
invoke-virtual {v0, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {p1, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw p1
:catch_2
new-instance v0, Ljava/lang/RuntimeException;
new-instance v1, Ljava/lang/StringBuilder;
const-string v2, "cannot find implementation for "
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
invoke-virtual {p0}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
move-result-object p0
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, ". "
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
const-string p0, " does not exist"
invoke-virtual {v1, p0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object p0
invoke-direct {v0, p0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;)V
throw v0
.end method
.method public static inMemoryDatabaseBuilder(Landroid/content/Context;Ljava/lang/Class;)Landroidx/room/RoomDatabase$Builder;
.locals 2
.param p0 # Landroid/content/Context;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p1 # Ljava/lang/Class;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Landroidx/room/RoomDatabase;",
">(",
"Landroid/content/Context;",
"Ljava/lang/Class<",
"TT;>;)",
"Landroidx/room/RoomDatabase$Builder<",
"TT;>;"
}
.end annotation
new-instance v0, Landroidx/room/RoomDatabase$Builder;
const/4 v1, 0x0
invoke-direct {v0, p0, p1, v1}, Landroidx/room/RoomDatabase$Builder;-><init>(Landroid/content/Context;Ljava/lang/Class;Ljava/lang/String;)V
return-object v0
.end method