298 lines
8.9 KiB
Smali
298 lines
8.9 KiB
Smali
.class public Landroidx/fragment/app/FragmentFactory;
|
|
.super Ljava/lang/Object;
|
|
.source "FragmentFactory.java"
|
|
|
|
|
|
# static fields
|
|
.field public static final sClassMap:Landroidx/collection/SimpleArrayMap;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Landroidx/collection/SimpleArrayMap<",
|
|
"Ljava/lang/String;",
|
|
"Ljava/lang/Class<",
|
|
"*>;>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
new-instance v0, Landroidx/collection/SimpleArrayMap;
|
|
|
|
invoke-direct {v0}, Landroidx/collection/SimpleArrayMap;-><init>()V
|
|
|
|
sput-object v0, Landroidx/fragment/app/FragmentFactory;->sClassMap:Landroidx/collection/SimpleArrayMap;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static isFragmentClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Z
|
|
.locals 0
|
|
.param p0 # Ljava/lang/ClassLoader;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # Ljava/lang/String;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
|
|
:try_start_0
|
|
invoke-static {p0, p1}, Landroidx/fragment/app/FragmentFactory;->loadClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
|
|
const-class p1, Landroidx/fragment/app/Fragment;
|
|
|
|
invoke-virtual {p1, p0}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
|
|
|
|
move-result p0
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return p0
|
|
|
|
:catch_0
|
|
const/4 p0, 0x0
|
|
|
|
return p0
|
|
.end method
|
|
|
|
.method public static loadClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;
|
|
.locals 1
|
|
.param p0 # Ljava/lang/ClassLoader;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # 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 = {
|
|
"(",
|
|
"Ljava/lang/ClassLoader;",
|
|
"Ljava/lang/String;",
|
|
")",
|
|
"Ljava/lang/Class<",
|
|
"*>;"
|
|
}
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/lang/ClassNotFoundException;
|
|
}
|
|
.end annotation
|
|
|
|
sget-object v0, Landroidx/fragment/app/FragmentFactory;->sClassMap:Landroidx/collection/SimpleArrayMap;
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/collection/SimpleArrayMap;->get(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Ljava/lang/Class;
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-static {p1, v0, p0}, Ljava/lang/Class;->forName(Ljava/lang/String;ZLjava/lang/ClassLoader;)Ljava/lang/Class;
|
|
|
|
move-result-object v0
|
|
|
|
sget-object p0, Landroidx/fragment/app/FragmentFactory;->sClassMap:Landroidx/collection/SimpleArrayMap;
|
|
|
|
invoke-virtual {p0, p1, v0}, Landroidx/collection/SimpleArrayMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static loadFragmentClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;
|
|
.locals 3
|
|
.param p0 # Ljava/lang/ClassLoader;
|
|
.annotation build Landroidx/annotation/NonNull;
|
|
.end annotation
|
|
.end param
|
|
.param p1 # 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 = {
|
|
"(",
|
|
"Ljava/lang/ClassLoader;",
|
|
"Ljava/lang/String;",
|
|
")",
|
|
"Ljava/lang/Class<",
|
|
"+",
|
|
"Landroidx/fragment/app/Fragment;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
|
|
const-string v0, "Unable to instantiate fragment "
|
|
|
|
:try_start_0
|
|
invoke-static {p0, p1}, Landroidx/fragment/app/FragmentFactory;->loadClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object p0
|
|
:try_end_0
|
|
.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/ClassCastException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p0
|
|
|
|
:catch_0
|
|
move-exception p0
|
|
|
|
new-instance v1, Landroidx/fragment/app/Fragment$InstantiationException;
|
|
|
|
const-string v2, ": make sure class is a valid subclass of Fragment"
|
|
|
|
invoke-static {v0, p1, v2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v1, p1, p0}, Landroidx/fragment/app/Fragment$InstantiationException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
throw v1
|
|
|
|
:catch_1
|
|
move-exception p0
|
|
|
|
new-instance v1, Landroidx/fragment/app/Fragment$InstantiationException;
|
|
|
|
const-string v2, ": make sure class name exists"
|
|
|
|
invoke-static {v0, p1, v2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v1, p1, p0}, Landroidx/fragment/app/Fragment$InstantiationException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
throw v1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public instantiate(Ljava/lang/ClassLoader;Ljava/lang/String;)Landroidx/fragment/app/Fragment;
|
|
.locals 4
|
|
.param p1 # Ljava/lang/ClassLoader;
|
|
.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
|
|
|
|
const-string v0, ": make sure class name exists, is public, and has an empty constructor that is public"
|
|
|
|
const-string v1, "Unable to instantiate fragment "
|
|
|
|
:try_start_0
|
|
invoke-static {p1, p2}, Landroidx/fragment/app/FragmentFactory;->loadFragmentClass(Ljava/lang/ClassLoader;Ljava/lang/String;)Ljava/lang/Class;
|
|
|
|
move-result-object p1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
new-array v3, v2, [Ljava/lang/Class;
|
|
|
|
invoke-virtual {p1, v3}, Ljava/lang/Class;->getConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
|
|
|
|
move-result-object p1
|
|
|
|
new-array v2, v2, [Ljava/lang/Object;
|
|
|
|
invoke-virtual {p1, v2}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/fragment/app/Fragment;
|
|
:try_end_0
|
|
.catch Ljava/lang/InstantiationException; {:try_start_0 .. :try_end_0} :catch_3
|
|
.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_2
|
|
.catch Ljava/lang/NoSuchMethodException; {:try_start_0 .. :try_end_0} :catch_1
|
|
.catch Ljava/lang/reflect/InvocationTargetException; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
return-object p1
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
new-instance v0, Landroidx/fragment/app/Fragment$InstantiationException;
|
|
|
|
const-string v2, ": calling Fragment constructor caused an exception"
|
|
|
|
invoke-static {v1, p2, v2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {v0, p2, p1}, Landroidx/fragment/app/Fragment$InstantiationException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
throw v0
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
new-instance v0, Landroidx/fragment/app/Fragment$InstantiationException;
|
|
|
|
const-string v2, ": could not find Fragment constructor"
|
|
|
|
invoke-static {v1, p2, v2}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {v0, p2, p1}, Landroidx/fragment/app/Fragment$InstantiationException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
throw v0
|
|
|
|
:catch_2
|
|
move-exception p1
|
|
|
|
new-instance v2, Landroidx/fragment/app/Fragment$InstantiationException;
|
|
|
|
invoke-static {v1, p2, v0}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {v2, p2, p1}, Landroidx/fragment/app/Fragment$InstantiationException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
throw v2
|
|
|
|
:catch_3
|
|
move-exception p1
|
|
|
|
new-instance v2, Landroidx/fragment/app/Fragment$InstantiationException;
|
|
|
|
invoke-static {v1, p2, v0}, Lf/e/b/a/a;->q(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {v2, p2, p1}, Landroidx/fragment/app/Fragment$InstantiationException;-><init>(Ljava/lang/String;Ljava/lang/Exception;)V
|
|
|
|
throw v2
|
|
.end method
|