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
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
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
.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
const/4 v0, 0x0
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