apkfuckery/com.discord/smali/androidx/lifecycle/ViewModelProvider$AndroidViewModelFactory.smali

211 lines
6.1 KiB
Smali
Raw Normal View History

2019-02-04 20:08:30 +00:00
.class public Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
.super Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;
2019-02-04 20:29:01 +00:00
.source "ViewModelProvider.java"
2019-02-04 20:08:30 +00:00
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Landroidx/lifecycle/ViewModelProvider;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x9
name = "AndroidViewModelFactory"
.end annotation
# static fields
.field private static sInstance:Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
# instance fields
.field private mApplication:Landroid/app/Application;
# direct methods
.method public constructor <init>(Landroid/app/Application;)V
.locals 0
.param p1 # Landroid/app/Application;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
invoke-direct {p0}, Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;-><init>()V
iput-object p1, p0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->mApplication:Landroid/app/Application;
return-void
.end method
.method public static getInstance(Landroid/app/Application;)Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
.locals 1
.param p0 # Landroid/app/Application;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/NonNull;
.end annotation
sget-object v0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->sInstance:Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
if-nez v0, :cond_0
new-instance v0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
invoke-direct {v0, p0}, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;-><init>(Landroid/app/Application;)V
sput-object v0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->sInstance:Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
:cond_0
sget-object p0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->sInstance:Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;
return-object p0
.end method
# virtual methods
.method public create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
.locals 4
.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
const-class v0, Landroidx/lifecycle/AndroidViewModel;
invoke-virtual {v0, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
move-result v0
if-eqz v0, :cond_0
const/4 v0, 0x1
:try_start_0
new-array v1, v0, [Ljava/lang/Class;
const-class v2, Landroid/app/Application;
const/4 v3, 0x0
aput-object v2, v1, v3
invoke-virtual {p1, v1}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
move-result-object v1
new-array v0, v0, [Ljava/lang/Object;
iget-object v2, p0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->mApplication:Landroid/app/Application;
aput-object v2, v0, v3
invoke-virtual {v1, v0}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroidx/lifecycle/ViewModel;
:try_end_0
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_3
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_2
.catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_1
.catch Ljava/lang/reflect/InvocationTargetException; {: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
:catch_2
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_3
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
:cond_0
invoke-super {p0, p1}, Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;->create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
move-result-object p1
return-object p1
.end method