apkfuckery/com.discord/smali/androidx/lifecycle/ViewModelProvider$NewInstanceFactory.smali
2019-02-04 21:29:01 +01:00

99 lines
2.5 KiB
Smali

.class public Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;
.super Ljava/lang/Object;
.source "ViewModelProvider.java"
# interfaces
.implements Landroidx/lifecycle/ViewModelProvider$Factory;
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/lifecycle/ViewModelProvider;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "NewInstanceFactory"
.end annotation
# direct methods
.method public constructor <init>()V
.locals 0
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
.locals 3
.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/lifecycle/ViewModel;",
">(",
"Ljava/lang/Class<",
"TT;>;)TT;"
}
.end annotation
:try_start_0
invoke-virtual {p1}, Ljava/lang/Class;->newInstance()Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/lifecycle/ViewModel;
:try_end_0
.catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_0
return-object v0
:catch_0
move-exception v0
new-instance v1, Ljava/lang/RuntimeException;
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
const-string v2, "Cannot create an instance of "
invoke-virtual {v2, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {v1, p1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v1
:catch_1
move-exception v0
new-instance v1, Ljava/lang/RuntimeException;
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object p1
const-string v2, "Cannot create an instance of "
invoke-virtual {v2, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
move-result-object p1
invoke-direct {v1, p1, v0}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
throw v1
.end method