Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,204 @@
package com.google.firebase.components;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/* loaded from: classes3.dex */
public final class Component {
public final Set dependencies;
public final ComponentFactory factory;
public final int instantiation;
public final String name;
public final Set providedInterfaces;
public final Set publishedEvents;
public final int type;
public static /* synthetic */ Object lambda$intoSet$3(Object obj, ComponentContainer componentContainer) {
return obj;
}
public static /* synthetic */ Object lambda$of$1(Object obj, ComponentContainer componentContainer) {
return obj;
}
public Set getDependencies() {
return this.dependencies;
}
public ComponentFactory getFactory() {
return this.factory;
}
public String getName() {
return this.name;
}
public Set getProvidedInterfaces() {
return this.providedInterfaces;
}
public Set getPublishedEvents() {
return this.publishedEvents;
}
public boolean isAlwaysEager() {
return this.instantiation == 1;
}
public boolean isEagerInDefaultApp() {
return this.instantiation == 2;
}
public boolean isValue() {
return this.type == 0;
}
public Component(String str, Set set, Set set2, int i, int i2, ComponentFactory componentFactory, Set set3) {
this.name = str;
this.providedInterfaces = Collections.unmodifiableSet(set);
this.dependencies = Collections.unmodifiableSet(set2);
this.instantiation = i;
this.type = i2;
this.factory = componentFactory;
this.publishedEvents = Collections.unmodifiableSet(set3);
}
public Component withFactory(ComponentFactory componentFactory) {
return new Component(this.name, this.providedInterfaces, this.dependencies, this.instantiation, this.type, componentFactory, this.publishedEvents);
}
public String toString() {
return "Component<" + Arrays.toString(this.providedInterfaces.toArray()) + ">{" + this.instantiation + ", type=" + this.type + ", deps=" + Arrays.toString(this.dependencies.toArray()) + "}";
}
public static Builder builder(Class cls) {
return new Builder(cls, new Class[0]);
}
public static Builder builder(Class cls, Class... clsArr) {
return new Builder(cls, clsArr);
}
public static Builder builder(Qualified qualified) {
return new Builder(qualified, new Qualified[0]);
}
public static Builder builder(Qualified qualified, Qualified... qualifiedArr) {
return new Builder(qualified, qualifiedArr);
}
public static Component of(final Object obj, Class cls, Class... clsArr) {
return builder(cls, clsArr).factory(new ComponentFactory() { // from class: com.google.firebase.components.Component$$ExternalSyntheticLambda1
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
Object lambda$of$1;
lambda$of$1 = Component.lambda$of$1(obj, componentContainer);
return lambda$of$1;
}
}).build();
}
public static Builder intoSetBuilder(Class cls) {
return builder(cls).intoSet();
}
public static Component intoSet(final Object obj, Class cls) {
return intoSetBuilder(cls).factory(new ComponentFactory() { // from class: com.google.firebase.components.Component$$ExternalSyntheticLambda0
@Override // com.google.firebase.components.ComponentFactory
public final Object create(ComponentContainer componentContainer) {
Object lambda$intoSet$3;
lambda$intoSet$3 = Component.lambda$intoSet$3(obj, componentContainer);
return lambda$intoSet$3;
}
}).build();
}
public static class Builder {
public final Set dependencies;
public ComponentFactory factory;
public int instantiation;
public String name;
public final Set providedInterfaces;
public final Set publishedEvents;
public int type;
public final Builder intoSet() {
this.type = 1;
return this;
}
public Builder name(String str) {
this.name = str;
return this;
}
public Builder(Class cls, Class... clsArr) {
this.name = null;
HashSet hashSet = new HashSet();
this.providedInterfaces = hashSet;
this.dependencies = new HashSet();
this.instantiation = 0;
this.type = 0;
this.publishedEvents = new HashSet();
Preconditions.checkNotNull(cls, "Null interface");
hashSet.add(Qualified.unqualified(cls));
for (Class cls2 : clsArr) {
Preconditions.checkNotNull(cls2, "Null interface");
this.providedInterfaces.add(Qualified.unqualified(cls2));
}
}
public Builder(Qualified qualified, Qualified... qualifiedArr) {
this.name = null;
HashSet hashSet = new HashSet();
this.providedInterfaces = hashSet;
this.dependencies = new HashSet();
this.instantiation = 0;
this.type = 0;
this.publishedEvents = new HashSet();
Preconditions.checkNotNull(qualified, "Null interface");
hashSet.add(qualified);
for (Qualified qualified2 : qualifiedArr) {
Preconditions.checkNotNull(qualified2, "Null interface");
}
Collections.addAll(this.providedInterfaces, qualifiedArr);
}
public Builder add(Dependency dependency) {
Preconditions.checkNotNull(dependency, "Null dependency");
validateInterface(dependency.getInterface());
this.dependencies.add(dependency);
return this;
}
public Builder alwaysEager() {
return setInstantiation(1);
}
public Builder eagerInDefaultApp() {
return setInstantiation(2);
}
public final Builder setInstantiation(int i) {
Preconditions.checkState(this.instantiation == 0, "Instantiation type has already been set.");
this.instantiation = i;
return this;
}
public final void validateInterface(Qualified qualified) {
Preconditions.checkArgument(!this.providedInterfaces.contains(qualified), "Components are not allowed to depend on interfaces they themselves provide.");
}
public Builder factory(ComponentFactory componentFactory) {
this.factory = (ComponentFactory) Preconditions.checkNotNull(componentFactory, "Null factory");
return this;
}
public Component build() {
Preconditions.checkState(this.factory != null, "Missing required property: factory.");
return new Component(this.name, new HashSet(this.providedInterfaces), new HashSet(this.dependencies), this.instantiation, this.type, this.factory, this.publishedEvents);
}
}
}

View File

@@ -0,0 +1,42 @@
package com.google.firebase.components;
import com.google.firebase.inject.Deferred;
import com.google.firebase.inject.Provider;
import java.util.Set;
/* loaded from: classes3.dex */
public interface ComponentContainer {
Deferred getDeferred(Qualified qualified);
Provider getProvider(Qualified qualified);
Provider setOfProvider(Qualified qualified);
default Object get(Class cls) {
return get(Qualified.unqualified(cls));
}
default Provider getProvider(Class cls) {
return getProvider(Qualified.unqualified(cls));
}
default Deferred getDeferred(Class cls) {
return getDeferred(Qualified.unqualified(cls));
}
default Set setOf(Class cls) {
return setOf(Qualified.unqualified(cls));
}
default Object get(Qualified qualified) {
Provider provider = getProvider(qualified);
if (provider == null) {
return null;
}
return provider.get();
}
default Set setOf(Qualified qualified) {
return (Set) setOfProvider(qualified).get();
}
}

View File

@@ -0,0 +1,111 @@
package com.google.firebase.components;
import android.content.ComponentName;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.ServiceInfo;
import android.os.Bundle;
import android.util.Log;
import com.google.firebase.inject.Provider;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/* loaded from: classes3.dex */
public final class ComponentDiscovery {
public final Object context;
public final RegistrarNameRetriever retriever;
public interface RegistrarNameRetriever {
List retrieve(Object obj);
}
public static ComponentDiscovery forContext(Context context, Class cls) {
return new ComponentDiscovery(context, new MetadataRegistrarNameRetriever(cls));
}
public ComponentDiscovery(Object obj, RegistrarNameRetriever registrarNameRetriever) {
this.context = obj;
this.retriever = registrarNameRetriever;
}
public List discoverLazy() {
ArrayList arrayList = new ArrayList();
for (final String str : this.retriever.retrieve(this.context)) {
arrayList.add(new Provider() { // from class: com.google.firebase.components.ComponentDiscovery$$ExternalSyntheticLambda0
@Override // com.google.firebase.inject.Provider
public final Object get() {
ComponentRegistrar instantiate;
instantiate = ComponentDiscovery.instantiate(str);
return instantiate;
}
});
}
return arrayList;
}
public static ComponentRegistrar instantiate(String str) {
try {
Class<?> cls = Class.forName(str);
if (!ComponentRegistrar.class.isAssignableFrom(cls)) {
throw new InvalidRegistrarException(String.format("Class %s is not an instance of %s", str, "com.google.firebase.components.ComponentRegistrar"));
}
return (ComponentRegistrar) cls.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
} catch (ClassNotFoundException unused) {
Log.w("ComponentDiscovery", String.format("Class %s is not an found.", str));
return null;
} catch (IllegalAccessException e) {
throw new InvalidRegistrarException(String.format("Could not instantiate %s.", str), e);
} catch (InstantiationException e2) {
throw new InvalidRegistrarException(String.format("Could not instantiate %s.", str), e2);
} catch (NoSuchMethodException e3) {
throw new InvalidRegistrarException(String.format("Could not instantiate %s", str), e3);
} catch (InvocationTargetException e4) {
throw new InvalidRegistrarException(String.format("Could not instantiate %s", str), e4);
}
}
public static class MetadataRegistrarNameRetriever implements RegistrarNameRetriever {
public final Class discoveryService;
public MetadataRegistrarNameRetriever(Class cls) {
this.discoveryService = cls;
}
@Override // com.google.firebase.components.ComponentDiscovery.RegistrarNameRetriever
public List retrieve(Context context) {
Bundle metadata = getMetadata(context);
if (metadata == null) {
Log.w("ComponentDiscovery", "Could not retrieve metadata, returning empty list of registrars.");
return Collections.emptyList();
}
ArrayList arrayList = new ArrayList();
for (String str : metadata.keySet()) {
if ("com.google.firebase.components.ComponentRegistrar".equals(metadata.get(str)) && str.startsWith("com.google.firebase.components:")) {
arrayList.add(str.substring(31));
}
}
return arrayList;
}
public final Bundle getMetadata(Context context) {
try {
PackageManager packageManager = context.getPackageManager();
if (packageManager == null) {
Log.w("ComponentDiscovery", "Context has no PackageManager.");
return null;
}
ServiceInfo serviceInfo = packageManager.getServiceInfo(new ComponentName(context, (Class<?>) this.discoveryService), 128);
if (serviceInfo == null) {
Log.w("ComponentDiscovery", this.discoveryService + " has no service info.");
return null;
}
return serviceInfo.metaData;
} catch (PackageManager.NameNotFoundException unused) {
Log.w("ComponentDiscovery", "Application info not found.");
return null;
}
}
}
}

View File

@@ -0,0 +1,13 @@
package com.google.firebase.components;
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
/* loaded from: classes3.dex */
public class ComponentDiscoveryService extends Service {
@Override // android.app.Service
public IBinder onBind(Intent intent) {
return null;
}
}

View File

@@ -0,0 +1,6 @@
package com.google.firebase.components;
/* loaded from: classes3.dex */
public interface ComponentFactory {
Object create(ComponentContainer componentContainer);
}

View File

@@ -0,0 +1,8 @@
package com.google.firebase.components;
import java.util.List;
/* loaded from: classes3.dex */
public interface ComponentRegistrar {
List getComponents();
}

View File

@@ -0,0 +1,15 @@
package com.google.firebase.components;
import java.util.List;
/* loaded from: classes3.dex */
public interface ComponentRegistrarProcessor {
public static final ComponentRegistrarProcessor NOOP = new ComponentRegistrarProcessor() { // from class: com.google.firebase.components.ComponentRegistrarProcessor$$ExternalSyntheticLambda0
@Override // com.google.firebase.components.ComponentRegistrarProcessor
public final List processRegistrar(ComponentRegistrar componentRegistrar) {
return componentRegistrar.getComponents();
}
};
List processRegistrar(ComponentRegistrar componentRegistrar);
}

View File

@@ -0,0 +1,322 @@
package com.google.firebase.components;
import android.util.Log;
import androidx.lifecycle.LifecycleKt$$ExternalSyntheticBackportWithForwarding0;
import com.google.firebase.components.ComponentRuntime;
import com.google.firebase.dynamicloading.ComponentLoader;
import com.google.firebase.events.Publisher;
import com.google.firebase.events.Subscriber;
import com.google.firebase.inject.Deferred;
import com.google.firebase.inject.Provider;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executor;
import java.util.concurrent.atomic.AtomicReference;
/* loaded from: classes3.dex */
public class ComponentRuntime implements ComponentContainer, ComponentLoader {
public static final Provider EMPTY_PROVIDER = new Provider() { // from class: com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda1
@Override // com.google.firebase.inject.Provider
public final Object get() {
return Collections.emptySet();
}
};
public final ComponentRegistrarProcessor componentRegistrarProcessor;
public final Map components;
public final AtomicReference eagerComponentsInitializedWith;
public final EventBus eventBus;
public final Map lazyInstanceMap;
public final Map lazySetMap;
public Set processedCoroutineDispatcherInterfaces;
public final List unprocessedRegistrarProviders;
public static Builder builder(Executor executor) {
return new Builder(executor);
}
public ComponentRuntime(Executor executor, Iterable iterable, Collection collection, ComponentRegistrarProcessor componentRegistrarProcessor) {
this.components = new HashMap();
this.lazyInstanceMap = new HashMap();
this.lazySetMap = new HashMap();
this.processedCoroutineDispatcherInterfaces = new HashSet();
this.eagerComponentsInitializedWith = new AtomicReference();
EventBus eventBus = new EventBus(executor);
this.eventBus = eventBus;
this.componentRegistrarProcessor = componentRegistrarProcessor;
ArrayList arrayList = new ArrayList();
arrayList.add(Component.of(eventBus, EventBus.class, Subscriber.class, Publisher.class));
arrayList.add(Component.of(this, ComponentLoader.class, new Class[0]));
Iterator it = collection.iterator();
while (it.hasNext()) {
Component component = (Component) it.next();
if (component != null) {
arrayList.add(component);
}
}
this.unprocessedRegistrarProviders = iterableToList(iterable);
discoverComponents(arrayList);
}
public final void discoverComponents(List list) {
ArrayList arrayList = new ArrayList();
synchronized (this) {
Iterator it = this.unprocessedRegistrarProviders.iterator();
while (it.hasNext()) {
try {
ComponentRegistrar componentRegistrar = (ComponentRegistrar) ((Provider) it.next()).get();
if (componentRegistrar != null) {
list.addAll(this.componentRegistrarProcessor.processRegistrar(componentRegistrar));
it.remove();
}
} catch (InvalidRegistrarException e) {
it.remove();
Log.w("ComponentDiscovery", "Invalid component registrar.", e);
}
}
Iterator it2 = list.iterator();
while (it2.hasNext()) {
Object[] array = ((Component) it2.next()).getProvidedInterfaces().toArray();
int length = array.length;
int i = 0;
while (true) {
if (i < length) {
Object obj = array[i];
if (obj.toString().contains("kotlinx.coroutines.CoroutineDispatcher")) {
if (this.processedCoroutineDispatcherInterfaces.contains(obj.toString())) {
it2.remove();
break;
}
this.processedCoroutineDispatcherInterfaces.add(obj.toString());
}
i++;
}
}
}
if (this.components.isEmpty()) {
CycleDetector.detect(list);
} else {
ArrayList arrayList2 = new ArrayList(this.components.keySet());
arrayList2.addAll(list);
CycleDetector.detect(arrayList2);
}
Iterator it3 = list.iterator();
while (it3.hasNext()) {
final Component component = (Component) it3.next();
this.components.put(component, new Lazy(new Provider() { // from class: com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda0
@Override // com.google.firebase.inject.Provider
public final Object get() {
Object lambda$discoverComponents$0;
lambda$discoverComponents$0 = ComponentRuntime.this.lambda$discoverComponents$0(component);
return lambda$discoverComponents$0;
}
}));
}
arrayList.addAll(processInstanceComponents(list));
arrayList.addAll(processSetComponents());
processDependencies();
}
Iterator it4 = arrayList.iterator();
while (it4.hasNext()) {
((Runnable) it4.next()).run();
}
maybeInitializeEagerComponents();
}
public final /* synthetic */ Object lambda$discoverComponents$0(Component component) {
return component.getFactory().create(new RestrictedComponentContainer(component, this));
}
public final void maybeInitializeEagerComponents() {
Boolean bool = (Boolean) this.eagerComponentsInitializedWith.get();
if (bool != null) {
doInitializeEagerComponents(this.components, bool.booleanValue());
}
}
public static List iterableToList(Iterable iterable) {
ArrayList arrayList = new ArrayList();
Iterator it = iterable.iterator();
while (it.hasNext()) {
arrayList.add(it.next());
}
return arrayList;
}
public final List processInstanceComponents(List list) {
ArrayList arrayList = new ArrayList();
Iterator it = list.iterator();
while (it.hasNext()) {
Component component = (Component) it.next();
if (component.isValue()) {
final Provider provider = (Provider) this.components.get(component);
for (Qualified qualified : component.getProvidedInterfaces()) {
if (!this.lazyInstanceMap.containsKey(qualified)) {
this.lazyInstanceMap.put(qualified, provider);
} else {
final OptionalProvider optionalProvider = (OptionalProvider) ((Provider) this.lazyInstanceMap.get(qualified));
arrayList.add(new Runnable() { // from class: com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda2
@Override // java.lang.Runnable
public final void run() {
OptionalProvider.this.set(provider);
}
});
}
}
}
}
return arrayList;
}
public final List processSetComponents() {
ArrayList arrayList = new ArrayList();
HashMap hashMap = new HashMap();
for (Map.Entry entry : this.components.entrySet()) {
Component component = (Component) entry.getKey();
if (!component.isValue()) {
Provider provider = (Provider) entry.getValue();
for (Qualified qualified : component.getProvidedInterfaces()) {
if (!hashMap.containsKey(qualified)) {
hashMap.put(qualified, new HashSet());
}
((Set) hashMap.get(qualified)).add(provider);
}
}
}
for (Map.Entry entry2 : hashMap.entrySet()) {
if (!this.lazySetMap.containsKey(entry2.getKey())) {
this.lazySetMap.put((Qualified) entry2.getKey(), LazySet.fromCollection((Collection) entry2.getValue()));
} else {
final LazySet lazySet = (LazySet) this.lazySetMap.get(entry2.getKey());
for (final Provider provider2 : (Set) entry2.getValue()) {
arrayList.add(new Runnable() { // from class: com.google.firebase.components.ComponentRuntime$$ExternalSyntheticLambda3
@Override // java.lang.Runnable
public final void run() {
LazySet.this.add(provider2);
}
});
}
}
}
return arrayList;
}
@Override // com.google.firebase.components.ComponentContainer
public synchronized Provider getProvider(Qualified qualified) {
Preconditions.checkNotNull(qualified, "Null interface requested.");
return (Provider) this.lazyInstanceMap.get(qualified);
}
@Override // com.google.firebase.components.ComponentContainer
public Deferred getDeferred(Qualified qualified) {
Provider provider = getProvider(qualified);
if (provider == null) {
return OptionalProvider.empty();
}
if (provider instanceof OptionalProvider) {
return (OptionalProvider) provider;
}
return OptionalProvider.of(provider);
}
@Override // com.google.firebase.components.ComponentContainer
public synchronized Provider setOfProvider(Qualified qualified) {
LazySet lazySet = (LazySet) this.lazySetMap.get(qualified);
if (lazySet != null) {
return lazySet;
}
return EMPTY_PROVIDER;
}
public void initializeEagerComponents(boolean z) {
HashMap hashMap;
if (LifecycleKt$$ExternalSyntheticBackportWithForwarding0.m(this.eagerComponentsInitializedWith, null, Boolean.valueOf(z))) {
synchronized (this) {
hashMap = new HashMap(this.components);
}
doInitializeEagerComponents(hashMap, z);
}
}
public final void doInitializeEagerComponents(Map map, boolean z) {
for (Map.Entry entry : map.entrySet()) {
Component component = (Component) entry.getKey();
Provider provider = (Provider) entry.getValue();
if (component.isAlwaysEager() || (component.isEagerInDefaultApp() && z)) {
provider.get();
}
}
this.eventBus.enablePublishingAndFlushPending();
}
public final void processDependencies() {
for (Component component : this.components.keySet()) {
for (Dependency dependency : component.getDependencies()) {
if (dependency.isSet() && !this.lazySetMap.containsKey(dependency.getInterface())) {
this.lazySetMap.put(dependency.getInterface(), LazySet.fromCollection(Collections.emptySet()));
} else if (this.lazyInstanceMap.containsKey(dependency.getInterface())) {
continue;
} else {
if (dependency.isRequired()) {
throw new MissingDependencyException(String.format("Unsatisfied dependency for component %s: %s", component, dependency.getInterface()));
}
if (!dependency.isSet()) {
this.lazyInstanceMap.put(dependency.getInterface(), OptionalProvider.empty());
}
}
}
}
}
public static final class Builder {
public final Executor defaultExecutor;
public final List lazyRegistrars = new ArrayList();
public final List additionalComponents = new ArrayList();
public ComponentRegistrarProcessor componentRegistrarProcessor = ComponentRegistrarProcessor.NOOP;
public static /* synthetic */ ComponentRegistrar lambda$addComponentRegistrar$0(ComponentRegistrar componentRegistrar) {
return componentRegistrar;
}
public Builder setProcessor(ComponentRegistrarProcessor componentRegistrarProcessor) {
this.componentRegistrarProcessor = componentRegistrarProcessor;
return this;
}
public Builder(Executor executor) {
this.defaultExecutor = executor;
}
public Builder addLazyComponentRegistrars(Collection collection) {
this.lazyRegistrars.addAll(collection);
return this;
}
public Builder addComponentRegistrar(final ComponentRegistrar componentRegistrar) {
this.lazyRegistrars.add(new Provider() { // from class: com.google.firebase.components.ComponentRuntime$Builder$$ExternalSyntheticLambda0
@Override // com.google.firebase.inject.Provider
public final Object get() {
ComponentRegistrar lambda$addComponentRegistrar$0;
lambda$addComponentRegistrar$0 = ComponentRuntime.Builder.lambda$addComponentRegistrar$0(ComponentRegistrar.this);
return lambda$addComponentRegistrar$0;
}
});
return this;
}
public Builder addComponent(Component component) {
this.additionalComponents.add(component);
return this;
}
public ComponentRuntime build() {
return new ComponentRuntime(this.defaultExecutor, this.lazyRegistrars, this.additionalComponents, this.componentRegistrarProcessor);
}
}
}

View File

@@ -0,0 +1,154 @@
package com.google.firebase.components;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
/* loaded from: classes3.dex */
public abstract class CycleDetector {
public static class Dep {
public final Qualified anInterface;
public final boolean set;
public Dep(Qualified qualified, boolean z) {
this.anInterface = qualified;
this.set = z;
}
public boolean equals(Object obj) {
if (!(obj instanceof Dep)) {
return false;
}
Dep dep = (Dep) obj;
return dep.anInterface.equals(this.anInterface) && dep.set == this.set;
}
public int hashCode() {
return ((this.anInterface.hashCode() ^ 1000003) * 1000003) ^ Boolean.valueOf(this.set).hashCode();
}
}
public static class ComponentNode {
public final Component component;
public final Set dependencies = new HashSet();
public final Set dependents = new HashSet();
public Component getComponent() {
return this.component;
}
public Set getDependencies() {
return this.dependencies;
}
public ComponentNode(Component component) {
this.component = component;
}
public void addDependency(ComponentNode componentNode) {
this.dependencies.add(componentNode);
}
public void addDependent(ComponentNode componentNode) {
this.dependents.add(componentNode);
}
public void removeDependent(ComponentNode componentNode) {
this.dependents.remove(componentNode);
}
public boolean isRoot() {
return this.dependents.isEmpty();
}
public boolean isLeaf() {
return this.dependencies.isEmpty();
}
}
public static void detect(List list) {
Set<ComponentNode> graph = toGraph(list);
Set roots = getRoots(graph);
int i = 0;
while (!roots.isEmpty()) {
ComponentNode componentNode = (ComponentNode) roots.iterator().next();
roots.remove(componentNode);
i++;
for (ComponentNode componentNode2 : componentNode.getDependencies()) {
componentNode2.removeDependent(componentNode);
if (componentNode2.isRoot()) {
roots.add(componentNode2);
}
}
}
if (i == list.size()) {
return;
}
ArrayList arrayList = new ArrayList();
for (ComponentNode componentNode3 : graph) {
if (!componentNode3.isRoot() && !componentNode3.isLeaf()) {
arrayList.add(componentNode3.getComponent());
}
}
throw new DependencyCycleException(arrayList);
}
public static Set toGraph(List list) {
Set<ComponentNode> set;
HashMap hashMap = new HashMap(list.size());
Iterator it = list.iterator();
while (true) {
if (it.hasNext()) {
Component component = (Component) it.next();
ComponentNode componentNode = new ComponentNode(component);
for (Qualified qualified : component.getProvidedInterfaces()) {
Dep dep = new Dep(qualified, !component.isValue());
if (!hashMap.containsKey(dep)) {
hashMap.put(dep, new HashSet());
}
Set set2 = (Set) hashMap.get(dep);
if (!set2.isEmpty() && !dep.set) {
throw new IllegalArgumentException(String.format("Multiple components provide %s.", qualified));
}
set2.add(componentNode);
}
} else {
Iterator it2 = hashMap.values().iterator();
while (it2.hasNext()) {
for (ComponentNode componentNode2 : (Set) it2.next()) {
for (Dependency dependency : componentNode2.getComponent().getDependencies()) {
if (dependency.isDirectInjection() && (set = (Set) hashMap.get(new Dep(dependency.getInterface(), dependency.isSet()))) != null) {
for (ComponentNode componentNode3 : set) {
componentNode2.addDependency(componentNode3);
componentNode3.addDependent(componentNode2);
}
}
}
}
}
HashSet hashSet = new HashSet();
Iterator it3 = hashMap.values().iterator();
while (it3.hasNext()) {
hashSet.addAll((Set) it3.next());
}
return hashSet;
}
}
}
public static Set getRoots(Set set) {
HashSet hashSet = new HashSet();
Iterator it = set.iterator();
while (it.hasNext()) {
ComponentNode componentNode = (ComponentNode) it.next();
if (componentNode.isRoot()) {
hashSet.add(componentNode);
}
}
return hashSet;
}
}

View File

@@ -0,0 +1,114 @@
package com.google.firebase.components;
import com.google.android.gms.fido.fido2.api.common.DevicePublicKeyStringDef;
import com.ironsource.mediationsdk.utils.IronSourceConstants;
/* loaded from: classes3.dex */
public final class Dependency {
public final Qualified anInterface;
public final int injection;
public final int type;
public Qualified getInterface() {
return this.anInterface;
}
public boolean isDeferred() {
return this.injection == 2;
}
public boolean isDirectInjection() {
return this.injection == 0;
}
public boolean isRequired() {
return this.type == 1;
}
public boolean isSet() {
return this.type == 2;
}
public Dependency(Class cls, int i, int i2) {
this(Qualified.unqualified(cls), i, i2);
}
public Dependency(Qualified qualified, int i, int i2) {
this.anInterface = (Qualified) Preconditions.checkNotNull(qualified, "Null dependency anInterface.");
this.type = i;
this.injection = i2;
}
public static Dependency optional(Class cls) {
return new Dependency(cls, 0, 0);
}
public static Dependency deferred(Class cls) {
return new Dependency(cls, 0, 2);
}
public static Dependency required(Class cls) {
return new Dependency(cls, 1, 0);
}
public static Dependency required(Qualified qualified) {
return new Dependency(qualified, 1, 0);
}
public static Dependency setOf(Class cls) {
return new Dependency(cls, 2, 0);
}
public static Dependency optionalProvider(Class cls) {
return new Dependency(cls, 0, 1);
}
public static Dependency optionalProvider(Qualified qualified) {
return new Dependency(qualified, 0, 1);
}
public static Dependency requiredProvider(Class cls) {
return new Dependency(cls, 1, 1);
}
public static Dependency requiredProvider(Qualified qualified) {
return new Dependency(qualified, 1, 1);
}
public boolean equals(Object obj) {
if (!(obj instanceof Dependency)) {
return false;
}
Dependency dependency = (Dependency) obj;
return this.anInterface.equals(dependency.anInterface) && this.type == dependency.type && this.injection == dependency.injection;
}
public int hashCode() {
return ((((this.anInterface.hashCode() ^ 1000003) * 1000003) ^ this.type) * 1000003) ^ this.injection;
}
public String toString() {
StringBuilder sb = new StringBuilder("Dependency{anInterface=");
sb.append(this.anInterface);
sb.append(", type=");
int i = this.type;
sb.append(i == 1 ? "required" : i == 0 ? "optional" : "set");
sb.append(", injection=");
sb.append(describeInjection(this.injection));
sb.append("}");
return sb.toString();
}
public static String describeInjection(int i) {
if (i == 0) {
return DevicePublicKeyStringDef.DIRECT;
}
if (i == 1) {
return IronSourceConstants.EVENTS_PROVIDER;
}
if (i == 2) {
return "deferred";
}
throw new AssertionError("Unsupported injection: " + i);
}
}

View File

@@ -0,0 +1,14 @@
package com.google.firebase.components;
import java.util.Arrays;
import java.util.List;
/* loaded from: classes3.dex */
public class DependencyCycleException extends DependencyException {
public final List componentsInCycle;
public DependencyCycleException(List list) {
super("Dependency cycle detected: " + Arrays.toString(list.toArray()));
this.componentsInCycle = list;
}
}

View File

@@ -0,0 +1,8 @@
package com.google.firebase.components;
/* loaded from: classes3.dex */
public class DependencyException extends RuntimeException {
public DependencyException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,102 @@
package com.google.firebase.components;
import com.amazonaws.handlers.HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0;
import com.google.firebase.events.Event;
import com.google.firebase.events.EventHandler;
import com.google.firebase.events.Publisher;
import com.google.firebase.events.Subscriber;
import java.util.ArrayDeque;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executor;
/* loaded from: classes3.dex */
public class EventBus implements Subscriber, Publisher {
public final Executor defaultExecutor;
public final Map handlerMap = new HashMap();
public Queue pendingEvents = new ArrayDeque();
public EventBus(Executor executor) {
this.defaultExecutor = executor;
}
public void publish(final Event event) {
Preconditions.checkNotNull(event);
synchronized (this) {
try {
Queue queue = this.pendingEvents;
if (queue != null) {
queue.add(event);
return;
}
for (final Map.Entry entry : getHandlers(event)) {
((Executor) entry.getValue()).execute(new Runnable(entry, event) { // from class: com.google.firebase.components.EventBus$$ExternalSyntheticLambda0
public final /* synthetic */ Map.Entry f$0;
@Override // java.lang.Runnable
public final void run() {
EventBus.lambda$publish$0(this.f$0, null);
}
});
}
} catch (Throwable th) {
throw th;
}
}
}
public static /* synthetic */ void lambda$publish$0(Map.Entry entry, Event event) {
((EventHandler) entry.getKey()).handle(event);
}
public final synchronized Set getHandlers(Event event) {
throw null;
}
@Override // com.google.firebase.events.Subscriber
public synchronized void subscribe(Class cls, Executor executor, EventHandler eventHandler) {
try {
Preconditions.checkNotNull(cls);
Preconditions.checkNotNull(eventHandler);
Preconditions.checkNotNull(executor);
if (!this.handlerMap.containsKey(cls)) {
this.handlerMap.put(cls, new ConcurrentHashMap());
}
((ConcurrentHashMap) this.handlerMap.get(cls)).put(eventHandler, executor);
} catch (Throwable th) {
throw th;
}
}
@Override // com.google.firebase.events.Subscriber
public void subscribe(Class cls, EventHandler eventHandler) {
subscribe(cls, this.defaultExecutor, eventHandler);
}
public void enablePublishingAndFlushPending() {
Queue queue;
synchronized (this) {
try {
queue = this.pendingEvents;
if (queue != null) {
this.pendingEvents = null;
} else {
queue = null;
}
} catch (Throwable th) {
throw th;
}
}
if (queue != null) {
Iterator it = queue.iterator();
while (it.hasNext()) {
HandlerChainFactory$$ExternalSyntheticThrowCCEIfNotNull0.m(it.next());
publish(null);
}
}
}
}

View File

@@ -0,0 +1,12 @@
package com.google.firebase.components;
/* loaded from: classes3.dex */
public class InvalidRegistrarException extends RuntimeException {
public InvalidRegistrarException(String str) {
super(str);
}
public InvalidRegistrarException(String str, Throwable th) {
super(str, th);
}
}

View File

@@ -0,0 +1,34 @@
package com.google.firebase.components;
import com.google.firebase.inject.Provider;
/* loaded from: classes3.dex */
public class Lazy implements Provider {
public static final Object UNINITIALIZED = new Object();
public volatile Object instance = UNINITIALIZED;
public volatile Provider provider;
public Lazy(Provider provider) {
this.provider = provider;
}
@Override // com.google.firebase.inject.Provider
public Object get() {
Object obj = this.instance;
Object obj2 = UNINITIALIZED;
if (obj == obj2) {
synchronized (this) {
try {
obj = this.instance;
if (obj == obj2) {
obj = this.provider.get();
this.instance = obj;
this.provider = null;
}
} finally {
}
}
}
return obj;
}
}

View File

@@ -0,0 +1,62 @@
package com.google.firebase.components;
import com.google.firebase.inject.Provider;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
/* loaded from: classes3.dex */
public class LazySet implements Provider {
public volatile Set actualSet = null;
public volatile Set providers = Collections.newSetFromMap(new ConcurrentHashMap());
public LazySet(Collection collection) {
this.providers.addAll(collection);
}
public static LazySet fromCollection(Collection collection) {
return new LazySet((Set) collection);
}
@Override // com.google.firebase.inject.Provider
public Set get() {
if (this.actualSet == null) {
synchronized (this) {
try {
if (this.actualSet == null) {
this.actualSet = Collections.newSetFromMap(new ConcurrentHashMap());
updateSet();
}
} finally {
}
}
}
return Collections.unmodifiableSet(this.actualSet);
}
public synchronized void add(Provider provider) {
try {
if (this.actualSet == null) {
this.providers.add(provider);
} else {
this.actualSet.add(provider.get());
}
} catch (Throwable th) {
throw th;
}
}
public final synchronized void updateSet() {
try {
Iterator it = this.providers.iterator();
while (it.hasNext()) {
this.actualSet.add(((Provider) it.next()).get());
}
this.providers = null;
} catch (Throwable th) {
throw th;
}
}
}

View File

@@ -0,0 +1,8 @@
package com.google.firebase.components;
/* loaded from: classes3.dex */
public class MissingDependencyException extends DependencyException {
public MissingDependencyException(String str) {
super(str);
}
}

View File

@@ -0,0 +1,97 @@
package com.google.firebase.components;
import com.google.firebase.inject.Deferred;
import com.google.firebase.inject.Provider;
/* loaded from: classes3.dex */
public class OptionalProvider implements Provider, Deferred {
public volatile Provider delegate;
public Deferred.DeferredHandler handler;
public static final Deferred.DeferredHandler NOOP_HANDLER = new Deferred.DeferredHandler() { // from class: com.google.firebase.components.OptionalProvider$$ExternalSyntheticLambda0
@Override // com.google.firebase.inject.Deferred.DeferredHandler
public final void handle(Provider provider) {
OptionalProvider.lambda$static$0(provider);
}
};
public static final Provider EMPTY_PROVIDER = new Provider() { // from class: com.google.firebase.components.OptionalProvider$$ExternalSyntheticLambda1
@Override // com.google.firebase.inject.Provider
public final Object get() {
Object lambda$static$1;
lambda$static$1 = OptionalProvider.lambda$static$1();
return lambda$static$1;
}
};
public static /* synthetic */ void lambda$static$0(Provider provider) {
}
public static /* synthetic */ Object lambda$static$1() {
return null;
}
public OptionalProvider(Deferred.DeferredHandler deferredHandler, Provider provider) {
this.handler = deferredHandler;
this.delegate = provider;
}
public static OptionalProvider empty() {
return new OptionalProvider(NOOP_HANDLER, EMPTY_PROVIDER);
}
public static OptionalProvider of(Provider provider) {
return new OptionalProvider(null, provider);
}
@Override // com.google.firebase.inject.Provider
public Object get() {
return this.delegate.get();
}
public void set(Provider provider) {
Deferred.DeferredHandler deferredHandler;
if (this.delegate != EMPTY_PROVIDER) {
throw new IllegalStateException("provide() can be called only once.");
}
synchronized (this) {
deferredHandler = this.handler;
this.handler = null;
this.delegate = provider;
}
deferredHandler.handle(provider);
}
@Override // com.google.firebase.inject.Deferred
public void whenAvailable(final Deferred.DeferredHandler deferredHandler) {
Provider provider;
Provider provider2;
Provider provider3 = this.delegate;
Provider provider4 = EMPTY_PROVIDER;
if (provider3 != provider4) {
deferredHandler.handle(provider3);
return;
}
synchronized (this) {
provider = this.delegate;
if (provider != provider4) {
provider2 = provider;
} else {
final Deferred.DeferredHandler deferredHandler2 = this.handler;
this.handler = new Deferred.DeferredHandler() { // from class: com.google.firebase.components.OptionalProvider$$ExternalSyntheticLambda2
@Override // com.google.firebase.inject.Deferred.DeferredHandler
public final void handle(Provider provider5) {
OptionalProvider.lambda$whenAvailable$2(Deferred.DeferredHandler.this, deferredHandler, provider5);
}
};
provider2 = null;
}
}
if (provider2 != null) {
deferredHandler.handle(provider);
}
}
public static /* synthetic */ void lambda$whenAvailable$2(Deferred.DeferredHandler deferredHandler, Deferred.DeferredHandler deferredHandler2, Provider provider) {
deferredHandler.handle(provider);
deferredHandler2.handle(provider);
}
}

View File

@@ -0,0 +1,28 @@
package com.google.firebase.components;
/* loaded from: classes3.dex */
public abstract class Preconditions {
public static void checkArgument(boolean z, String str) {
if (!z) {
throw new IllegalArgumentException(str);
}
}
public static Object checkNotNull(Object obj) {
obj.getClass();
return obj;
}
public static Object checkNotNull(Object obj, String str) {
if (obj != null) {
return obj;
}
throw new NullPointerException(str);
}
public static void checkState(boolean z, String str) {
if (!z) {
throw new IllegalStateException(str);
}
}
}

View File

@@ -0,0 +1,48 @@
package com.google.firebase.components;
/* loaded from: classes3.dex */
public final class Qualified {
public final Class qualifier;
public final Class type;
public @interface Unqualified {
}
public Qualified(Class cls, Class cls2) {
this.qualifier = cls;
this.type = cls2;
}
public static Qualified unqualified(Class cls) {
return new Qualified(Unqualified.class, cls);
}
public static Qualified qualified(Class cls, Class cls2) {
return new Qualified(cls, cls2);
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null || Qualified.class != obj.getClass()) {
return false;
}
Qualified qualified = (Qualified) obj;
if (this.type.equals(qualified.type)) {
return this.qualifier.equals(qualified.qualifier);
}
return false;
}
public int hashCode() {
return (this.type.hashCode() * 31) + this.qualifier.hashCode();
}
public String toString() {
if (this.qualifier == Unqualified.class) {
return this.type.getName();
}
return "@" + this.qualifier.getName() + " " + this.type.getName();
}
}

View File

@@ -0,0 +1,121 @@
package com.google.firebase.components;
import com.google.firebase.events.Publisher;
import com.google.firebase.inject.Deferred;
import com.google.firebase.inject.Provider;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
/* loaded from: classes3.dex */
public final class RestrictedComponentContainer implements ComponentContainer {
public final Set allowedDeferredInterfaces;
public final Set allowedDirectInterfaces;
public final Set allowedProviderInterfaces;
public final Set allowedPublishedEvents;
public final Set allowedSetDirectInterfaces;
public final Set allowedSetProviderInterfaces;
public final ComponentContainer delegateContainer;
public RestrictedComponentContainer(Component component, ComponentContainer componentContainer) {
HashSet hashSet = new HashSet();
HashSet hashSet2 = new HashSet();
HashSet hashSet3 = new HashSet();
HashSet hashSet4 = new HashSet();
HashSet hashSet5 = new HashSet();
for (Dependency dependency : component.getDependencies()) {
if (dependency.isDirectInjection()) {
if (dependency.isSet()) {
hashSet4.add(dependency.getInterface());
} else {
hashSet.add(dependency.getInterface());
}
} else if (dependency.isDeferred()) {
hashSet3.add(dependency.getInterface());
} else if (dependency.isSet()) {
hashSet5.add(dependency.getInterface());
} else {
hashSet2.add(dependency.getInterface());
}
}
if (!component.getPublishedEvents().isEmpty()) {
hashSet.add(Qualified.unqualified(Publisher.class));
}
this.allowedDirectInterfaces = Collections.unmodifiableSet(hashSet);
this.allowedProviderInterfaces = Collections.unmodifiableSet(hashSet2);
this.allowedDeferredInterfaces = Collections.unmodifiableSet(hashSet3);
this.allowedSetDirectInterfaces = Collections.unmodifiableSet(hashSet4);
this.allowedSetProviderInterfaces = Collections.unmodifiableSet(hashSet5);
this.allowedPublishedEvents = component.getPublishedEvents();
this.delegateContainer = componentContainer;
}
@Override // com.google.firebase.components.ComponentContainer
public Object get(Class cls) {
if (!this.allowedDirectInterfaces.contains(Qualified.unqualified(cls))) {
throw new DependencyException(String.format("Attempting to request an undeclared dependency %s.", cls));
}
Object obj = this.delegateContainer.get(cls);
return !cls.equals(Publisher.class) ? obj : new RestrictedPublisher(this.allowedPublishedEvents, (Publisher) obj);
}
@Override // com.google.firebase.components.ComponentContainer
public Object get(Qualified qualified) {
if (!this.allowedDirectInterfaces.contains(qualified)) {
throw new DependencyException(String.format("Attempting to request an undeclared dependency %s.", qualified));
}
return this.delegateContainer.get(qualified);
}
@Override // com.google.firebase.components.ComponentContainer
public Provider getProvider(Class cls) {
return getProvider(Qualified.unqualified(cls));
}
@Override // com.google.firebase.components.ComponentContainer
public Deferred getDeferred(Class cls) {
return getDeferred(Qualified.unqualified(cls));
}
@Override // com.google.firebase.components.ComponentContainer
public Provider getProvider(Qualified qualified) {
if (!this.allowedProviderInterfaces.contains(qualified)) {
throw new DependencyException(String.format("Attempting to request an undeclared dependency Provider<%s>.", qualified));
}
return this.delegateContainer.getProvider(qualified);
}
@Override // com.google.firebase.components.ComponentContainer
public Deferred getDeferred(Qualified qualified) {
if (!this.allowedDeferredInterfaces.contains(qualified)) {
throw new DependencyException(String.format("Attempting to request an undeclared dependency Deferred<%s>.", qualified));
}
return this.delegateContainer.getDeferred(qualified);
}
@Override // com.google.firebase.components.ComponentContainer
public Provider setOfProvider(Qualified qualified) {
if (!this.allowedSetProviderInterfaces.contains(qualified)) {
throw new DependencyException(String.format("Attempting to request an undeclared dependency Provider<Set<%s>>.", qualified));
}
return this.delegateContainer.setOfProvider(qualified);
}
@Override // com.google.firebase.components.ComponentContainer
public Set setOf(Qualified qualified) {
if (!this.allowedSetDirectInterfaces.contains(qualified)) {
throw new DependencyException(String.format("Attempting to request an undeclared dependency Set<%s>.", qualified));
}
return this.delegateContainer.setOf(qualified);
}
public static class RestrictedPublisher implements Publisher {
public final Set allowedPublishedEvents;
public final Publisher delegate;
public RestrictedPublisher(Set set, Publisher publisher) {
this.allowedPublishedEvents = set;
this.delegate = publisher;
}
}
}