granularity level: instruction

		.class public final Lcom/google/firebase/components/ComponentDiscovery;
.super Ljava/lang/Object;
.source "ComponentDiscovery.java"

.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/google/firebase/components/ComponentDiscovery$MetadataRegistrarNameRetriever;,
Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;
}
.end annotation
.annotation system Ldalvik/annotation/Signature;
value = {
"<T:",
"Ljava/lang/Object;",
">",
"Ljava/lang/Object;"
}
.end annotation

.field private static final COMPONENT_KEY_PREFIX:Ljava/lang/String; = "com.google.firebase.components:"
.field private static final COMPONENT_SENTINEL_VALUE:Ljava/lang/String; = "com.google.firebase.components.ComponentRegistrar"
.field static final TAG:Ljava/lang/String; = "ComponentDiscovery"
.field private final context:Ljava/lang/Object;
.annotation system Ldalvik/annotation/Signature;
value = {
"TT;"
}
.end annotation
.end field
.field private final retriever:Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;
.annotation system Ldalvik/annotation/Signature;
value = {
"Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever<",
"TT;>;"
}
.end annotation
.end field


.method constructor <init>(Ljava/lang/Object;Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;)V
	.locals 0
	.annotation system Ldalvik/annotation/Signature;
	value = {
	"(TT;",
	"Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever<",
	"TT;>;)V"
	}
	.end annotation

	invoke-direct {p0}, Ljava/lang/Object;-><init>()V
	iput-object p1, p0, Lcom/google/firebase/components/ComponentDiscovery;->context:Ljava/lang/Object;
	iput-object p2, p0, Lcom/google/firebase/components/ComponentDiscovery;->retriever:Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;
	return-void
.end method

.method public static forContext(Landroid/content/Context;Ljava/lang/Class;)Lcom/google/firebase/components/ComponentDiscovery;
	.locals 3
	.annotation system Ldalvik/annotation/Signature;
	value = {
	"(",
	"Landroid/content/Context;",
	"Ljava/lang/Class<",
	"+",
	"Landroid/app/Service;",
	">;)",
	"Lcom/google/firebase/components/ComponentDiscovery<",
	"Landroid/content/Context;",
	">;"
	}
	.end annotation

	new-instance v0, Lcom/google/firebase/components/ComponentDiscovery;
	new-instance v1, Lcom/google/firebase/components/ComponentDiscovery$MetadataRegistrarNameRetriever;
	const/4 v2, 0x0
	invoke-direct {v1, p1, v2}, Lcom/google/firebase/components/ComponentDiscovery$MetadataRegistrarNameRetriever;-><init>(Ljava/lang/Class;Lcom/google/firebase/components/ComponentDiscovery$1;)V
	invoke-direct {v0, p0, v1}, Lcom/google/firebase/components/ComponentDiscovery;-><init>(Ljava/lang/Object;Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;)V
	return-object v0
.end method

.method private static instantiate(Ljava/lang/String;)Lcom/google/firebase/components/ComponentRegistrar;
	.locals 8

	const-string v0, "Could not instantiate %s"
	const-string v1, "Could not instantiate %s."
	const/4 v2, 0x1
	const/4 v3, 0x0
	:try_start_0
	invoke-static {p0}, Ljava/lang/Class;->forName(Ljava/lang/String;)Ljava/lang/Class;
	move-result-object v4
	const-class v5, Lcom/google/firebase/components/ComponentRegistrar;
	invoke-virtual {v5, v4}, Ljava/lang/Class;->isAssignableFrom(Ljava/lang/Class;)Z
	move-result v5
	if-eqz v5, :cond_0
	new-array v5, v3, [Ljava/lang/Class;
	invoke-virtual {v4, v5}, Ljava/lang/Class;->getDeclaredConstructor([Ljava/lang/Class;)Ljava/lang/reflect/Constructor;
	move-result-object v4
	new-array v5, v3, [Ljava/lang/Object;
	invoke-virtual {v4, v5}, Ljava/lang/reflect/Constructor;->newInstance([Ljava/lang/Object;)Ljava/lang/Object;
	move-result-object v4
	check-cast v4, Lcom/google/firebase/components/ComponentRegistrar;
	return-object v4
	:cond_0
	new-instance v4, Lcom/google/firebase/components/InvalidRegistrarException;
	const-string v5, "Class %s is not an instance of %s"
	const/4 v6, 0x2
	new-array v6, v6, [Ljava/lang/Object;
	aput-object p0, v6, v3
	const-string v7, "com.google.firebase.components.ComponentRegistrar"
	aput-object v7, v6, v2
	invoke-static {v5, v6}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
	move-result-object v5
	invoke-direct {v4, v5}, Lcom/google/firebase/components/InvalidRegistrarException;-><init>(Ljava/lang/String;)V
	throw v4
	:try_end_0
	.catch Ljava/lang/ClassNotFoundException; {:try_start_0 .. :try_end_0} :catch_4
	.catch Ljava/lang/IllegalAccessException; {:try_start_0 .. :try_end_0} :catch_3
	.catch Ljava/lang/InstantiationException; {: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
	:catch_0
	move-exception v1
	new-instance v4, Lcom/google/firebase/components/InvalidRegistrarException;
	new-array v2, v2, [Ljava/lang/Object;
	aput-object p0, v2, v3
	invoke-static {v0, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
	move-result-object p0
	invoke-direct {v4, p0, v1}, Lcom/google/firebase/components/InvalidRegistrarException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
	throw v4
	:catch_1
	move-exception v1
	new-instance v4, Lcom/google/firebase/components/InvalidRegistrarException;
	new-array v2, v2, [Ljava/lang/Object;
	aput-object p0, v2, v3
	invoke-static {v0, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
	move-result-object p0
	invoke-direct {v4, p0, v1}, Lcom/google/firebase/components/InvalidRegistrarException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
	throw v4
	:catch_2
	move-exception v0
	new-instance v4, Lcom/google/firebase/components/InvalidRegistrarException;
	new-array v2, v2, [Ljava/lang/Object;
	aput-object p0, v2, v3
	invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
	move-result-object p0
	invoke-direct {v4, p0, v0}, Lcom/google/firebase/components/InvalidRegistrarException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
	throw v4
	:catch_3
	move-exception v0
	new-instance v4, Lcom/google/firebase/components/InvalidRegistrarException;
	new-array v2, v2, [Ljava/lang/Object;
	aput-object p0, v2, v3
	invoke-static {v1, v2}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
	move-result-object p0
	invoke-direct {v4, p0, v0}, Lcom/google/firebase/components/InvalidRegistrarException;-><init>(Ljava/lang/String;Ljava/lang/Throwable;)V
	throw v4
	:catch_4
	new-array v0, v2, [Ljava/lang/Object;
	aput-object p0, v0, v3
	const-string p0, "Class %s is not an found."
	invoke-static {p0, v0}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
	move-result-object p0
	const-string v0, "ComponentDiscovery"
	invoke-static {v0, p0}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;)I
	const/4 p0, 0x0
	return-object p0
.end method

.method static synthetic lambda$discoverLazy$0(Ljava/lang/String;)Lcom/google/firebase/components/ComponentRegistrar;
	.locals 0

	invoke-static {p0}, Lcom/google/firebase/components/ComponentDiscovery;->instantiate(Ljava/lang/String;)Lcom/google/firebase/components/ComponentRegistrar;
	move-result-object p0
	return-object p0
.end method

.method public discover()Ljava/util/List;
	.locals 5
	.annotation runtime Ljava/lang/Deprecated;
	.end annotation
	.annotation system Ldalvik/annotation/Signature;
	value = {
	"()",
	"Ljava/util/List<",
	"Lcom/google/firebase/components/ComponentRegistrar;",
	">;"
	}
	.end annotation

	new-instance v0, Ljava/util/ArrayList;
	invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
	iget-object v1, p0, Lcom/google/firebase/components/ComponentDiscovery;->retriever:Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;
	iget-object v2, p0, Lcom/google/firebase/components/ComponentDiscovery;->context:Ljava/lang/Object;
	invoke-interface {v1, v2}, Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;->retrieve(Ljava/lang/Object;)Ljava/util/List;
	move-result-object v1
	invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
	move-result-object v1
	:goto_0
	:cond_0
	invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
	move-result v2
	if-eqz v2, :cond_1
	invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
	move-result-object v2
	check-cast v2, Ljava/lang/String;
	:try_start_0
	invoke-static {v2}, Lcom/google/firebase/components/ComponentDiscovery;->instantiate(Ljava/lang/String;)Lcom/google/firebase/components/ComponentRegistrar;
	move-result-object v2
	if-eqz v2, :cond_0
	invoke-interface {v0, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z
	:try_end_0
	.catch Lcom/google/firebase/components/InvalidRegistrarException; {:try_start_0 .. :try_end_0} :catch_0
	goto :goto_0
	:catch_0
	move-exception v2
	const-string v3, "ComponentDiscovery"
	const-string v4, "Invalid component registrar."
	invoke-static {v3, v4, v2}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
	goto :goto_0
	:cond_1
	return-object v0
.end method

.method public discoverLazy()Ljava/util/List;
	.locals 4
	.annotation system Ldalvik/annotation/Signature;
	value = {
	"()",
	"Ljava/util/List<",
	"Lcom/google/firebase/inject/Provider<",
	"Lcom/google/firebase/components/ComponentRegistrar;",
	">;>;"
	}
	.end annotation

	new-instance v0, Ljava/util/ArrayList;
	invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
	iget-object v1, p0, Lcom/google/firebase/components/ComponentDiscovery;->retriever:Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;
	iget-object v2, p0, Lcom/google/firebase/components/ComponentDiscovery;->context:Ljava/lang/Object;
	invoke-interface {v1, v2}, Lcom/google/firebase/components/ComponentDiscovery$RegistrarNameRetriever;->retrieve(Ljava/lang/Object;)Ljava/util/List;
	move-result-object v1
	invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
	move-result-object v1
	:goto_0
	invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
	move-result v2
	if-eqz v2, :cond_0
	invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
	move-result-object v2
	check-cast v2, Ljava/lang/String;
	new-instance v3, Lcom/google/firebase/components/ComponentDiscovery$$ExternalSyntheticLambda0;
	invoke-direct {v3, v2}, Lcom/google/firebase/components/ComponentDiscovery$$ExternalSyntheticLambda0;-><init>(Ljava/lang/String;)V
	invoke-interface {v0, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
	goto :goto_0
	:cond_0
	return-object v0
.end method