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

196 lines
6.1 KiB
Smali
Raw Normal View History

2019-07-24 11:27:29 +00:00
.class public Landroidx/lifecycle/ViewModelProvider;
.super Ljava/lang/Object;
.source "ViewModelProvider.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Landroidx/lifecycle/ViewModelProvider$AndroidViewModelFactory;,
Landroidx/lifecycle/ViewModelProvider$NewInstanceFactory;,
2019-10-07 23:23:22 +00:00
Landroidx/lifecycle/ViewModelProvider$KeyedFactory;,
2019-07-24 11:27:29 +00:00
Landroidx/lifecycle/ViewModelProvider$Factory;
}
.end annotation
# static fields
2019-12-06 03:29:40 +00:00
.field public static final DEFAULT_KEY:Ljava/lang/String; = "androidx.lifecycle.ViewModelProvider.DefaultKey"
2019-07-24 11:27:29 +00:00
# instance fields
2019-12-06 03:29:40 +00:00
.field public final mFactory:Landroidx/lifecycle/ViewModelProvider$Factory;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
.field public final mViewModelStore:Landroidx/lifecycle/ViewModelStore;
2019-07-24 11:27:29 +00:00
# direct methods
.method public constructor <init>(Landroidx/lifecycle/ViewModelStore;Landroidx/lifecycle/ViewModelProvider$Factory;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/lifecycle/ViewModelStore;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/lifecycle/ViewModelProvider$Factory;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
iput-object p2, p0, Landroidx/lifecycle/ViewModelProvider;->mFactory:Landroidx/lifecycle/ViewModelProvider$Factory;
iput-object p1, p0, Landroidx/lifecycle/ViewModelProvider;->mViewModelStore:Landroidx/lifecycle/ViewModelStore;
return-void
.end method
.method public constructor <init>(Landroidx/lifecycle/ViewModelStoreOwner;Landroidx/lifecycle/ViewModelProvider$Factory;)V
.locals 0
2019-12-06 03:29:40 +00:00
.param p1 # Landroidx/lifecycle/ViewModelStoreOwner;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Landroidx/lifecycle/ViewModelProvider$Factory;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
2019-07-24 11:27:29 +00:00
invoke-interface {p1}, Landroidx/lifecycle/ViewModelStoreOwner;->getViewModelStore()Landroidx/lifecycle/ViewModelStore;
move-result-object p1
invoke-direct {p0, p1, p2}, Landroidx/lifecycle/ViewModelProvider;-><init>(Landroidx/lifecycle/ViewModelStore;Landroidx/lifecycle/ViewModelProvider$Factory;)V
return-void
.end method
# virtual methods
.method public get(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
2019-12-06 03:29:40 +00:00
.locals 3
.param p1 # Ljava/lang/Class;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation build Landroidx/annotation/NonNull;
.end annotation
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Landroidx/lifecycle/ViewModel;",
">(",
"Ljava/lang/Class<",
"TT;>;)TT;"
}
.end annotation
invoke-virtual {p1}, Ljava/lang/Class;->getCanonicalName()Ljava/lang/String;
move-result-object v0
if-eqz v0, :cond_0
2019-12-06 03:29:40 +00:00
new-instance v1, Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
const-string v2, "androidx.lifecycle.ViewModelProvider.DefaultKey:"
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2019-07-24 11:27:29 +00:00
2019-12-06 03:29:40 +00:00
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2019-07-24 11:27:29 +00:00
move-result-object v0
invoke-virtual {p0, v0, p1}, Landroidx/lifecycle/ViewModelProvider;->get(Ljava/lang/String;Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
move-result-object p1
return-object p1
:cond_0
new-instance p1, Ljava/lang/IllegalArgumentException;
const-string v0, "Local and anonymous classes can not be ViewModels"
invoke-direct {p1, v0}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
throw p1
.end method
.method public get(Ljava/lang/String;Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
.locals 2
2019-12-06 03:29:40 +00:00
.param p1 # Ljava/lang/String;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.param p2 # Ljava/lang/Class;
.annotation build Landroidx/annotation/NonNull;
.end annotation
.end param
.annotation build Landroidx/annotation/MainThread;
.end annotation
.annotation build Landroidx/annotation/NonNull;
.end annotation
2019-07-24 11:27:29 +00:00
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Landroidx/lifecycle/ViewModel;",
">(",
"Ljava/lang/String;",
"Ljava/lang/Class<",
"TT;>;)TT;"
}
.end annotation
iget-object v0, p0, Landroidx/lifecycle/ViewModelProvider;->mViewModelStore:Landroidx/lifecycle/ViewModelStore;
invoke-virtual {v0, p1}, Landroidx/lifecycle/ViewModelStore;->get(Ljava/lang/String;)Landroidx/lifecycle/ViewModel;
move-result-object v0
invoke-virtual {p2, v0}, Ljava/lang/Class;->isInstance(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
return-object v0
:cond_0
iget-object v0, p0, Landroidx/lifecycle/ViewModelProvider;->mFactory:Landroidx/lifecycle/ViewModelProvider$Factory;
2019-10-07 23:23:22 +00:00
instance-of v1, v0, Landroidx/lifecycle/ViewModelProvider$KeyedFactory;
if-eqz v1, :cond_1
check-cast v0, Landroidx/lifecycle/ViewModelProvider$KeyedFactory;
invoke-virtual {v0, p1, p2}, Landroidx/lifecycle/ViewModelProvider$KeyedFactory;->create(Ljava/lang/String;Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
move-result-object p2
goto :goto_0
:cond_1
2019-07-24 11:27:29 +00:00
invoke-interface {v0, p2}, Landroidx/lifecycle/ViewModelProvider$Factory;->create(Ljava/lang/Class;)Landroidx/lifecycle/ViewModel;
move-result-object p2
2019-10-07 23:23:22 +00:00
:goto_0
2019-07-24 11:27:29 +00:00
iget-object v0, p0, Landroidx/lifecycle/ViewModelProvider;->mViewModelStore:Landroidx/lifecycle/ViewModelStore;
invoke-virtual {v0, p1, p2}, Landroidx/lifecycle/ViewModelStore;->put(Ljava/lang/String;Landroidx/lifecycle/ViewModel;)V
return-object p2
.end method