package E4;

import android.util.Log;
import com.google.firebase.components.ComponentRegistrar;
import d5.AbstractC0844a;
import java.lang.reflect.InvocationTargetException;
import n4.u0;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class b implements D4.b {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final /* synthetic */ int f2184a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public final /* synthetic */ Object f2185b;

    public /* synthetic */ b(int i, Object obj) {
        this.f2184a = i;
        this.f2185b = obj;
    }

    @Override // D4.b
    public final Object get() {
        switch (this.f2184a) {
            case u0.f15495q /* 0 */:
                return new F4.c((W3.f) this.f2185b);
            case 1:
                String str = (String) this.f2185b;
                try {
                    Class<?> cls = Class.forName(str);
                    if (ComponentRegistrar.class.isAssignableFrom(cls)) {
                        return (ComponentRegistrar) cls.getDeclaredConstructor(null).newInstance(null);
                    }
                    throw new d4.k("Class " + str + " is not an instance of com.google.firebase.components.ComponentRegistrar");
                } catch (ClassNotFoundException unused) {
                    Log.w("ComponentDiscovery", "Class " + str + " is not an found.");
                    return null;
                } catch (IllegalAccessException e8) {
                    throw new d4.k(I1.a.p("Could not instantiate ", str, "."), e8);
                } catch (InstantiationException e9) {
                    throw new d4.k(I1.a.p("Could not instantiate ", str, "."), e9);
                } catch (NoSuchMethodException e10) {
                    throw new d4.k(AbstractC0844a.x("Could not instantiate ", str), e10);
                } catch (InvocationTargetException e11) {
                    throw new d4.k(AbstractC0844a.x("Could not instantiate ", str), e11);
                }
            default:
                return (ComponentRegistrar) this.f2185b;
        }
    }
}
