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;
|
2019-05-03 18:53:54 +00:00
|
|
|
.locals 5
|
2019-02-04 20:08:30 +00:00
|
|
|
.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
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-string v0, "Cannot create an instance of "
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-class v1, Landroidx/lifecycle/AndroidViewModel;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v1, p1}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
move-result v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
if-eqz v1, :cond_0
|
|
|
|
|
|
|
|
const/4 v1, 0x1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:try_start_0
|
2019-05-03 18:53:54 +00:00
|
|
|
new-array v2, v1, [Ljava/lang/Class;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const-class v3, Landroid/app/Application;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
const/4 v4, 0x0
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
aput-object v3, v2, v4
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {p1, v2}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
move-result-object v2
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-array v1, v1, [Ljava/lang/Object;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
iget-object v3, p0, Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;->mApplication:Landroid/app/Application;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
aput-object v3, v1, v4
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
move-result-object v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
check-cast v1, Landroidx/lifecycle/ViewModel;
|
2019-02-04 20:08:30 +00:00
|
|
|
: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
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
return-object v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:catch_0
|
2019-05-03 18:53:54 +00:00
|
|
|
move-exception v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance v2, Ljava/lang/RuntimeException;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {v2, p1, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
throw v2
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:catch_1
|
2019-05-03 18:53:54 +00:00
|
|
|
move-exception v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance v2, Ljava/lang/RuntimeException;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {v2, p1, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
throw v2
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:catch_2
|
2019-05-03 18:53:54 +00:00
|
|
|
move-exception v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance v2, Ljava/lang/RuntimeException;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {v2, p1, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
throw v2
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
:catch_3
|
2019-05-03 18:53:54 +00:00
|
|
|
move-exception v1
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
new-instance v2, Ljava/lang/RuntimeException;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
invoke-static {p1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
invoke-direct {v2, p1, v1}, Ljava/lang/RuntimeException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
|
2019-02-04 20:08:30 +00:00
|
|
|
|
2019-05-03 18:53:54 +00:00
|
|
|
throw v2
|
2019-02-04 20:08:30 +00:00
|
|
|
|
|
|
|
: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
|