package N2;

import android.util.Log;
import com.google.firebase.components.ComponentRegistrar;
import java.lang.reflect.InvocationTargetException;
import p0.AbstractC0928a;

/* JADX INFO: loaded from: classes.dex */
public final /* synthetic */ class e implements Z2.a {

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

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

    public /* synthetic */ e(int i, Object obj) {
        this.f2196a = i;
        this.f2197b = obj;
    }

    @Override // Z2.a
    public final Object get() {
        switch (this.f2196a) {
            case 0:
                String str = (String) this.f2197b;
                try {
                    Class<?> cls = Class.forName(str);
                    if (ComponentRegistrar.class.isAssignableFrom(cls)) {
                        return (ComponentRegistrar) cls.getDeclaredConstructor(new Class[0]).newInstance(new Object[0]);
                    }
                    throw new n("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 e2) {
                    throw new n(AbstractC0928a.l("Could not instantiate ", str, "."), e2);
                } catch (InstantiationException e6) {
                    throw new n(AbstractC0928a.l("Could not instantiate ", str, "."), e6);
                } catch (NoSuchMethodException e7) {
                    throw new n(s0.c.f("Could not instantiate ", str), e7);
                } catch (InvocationTargetException e8) {
                    throw new n(s0.c.f("Could not instantiate ", str), e8);
                }
            case 1:
                return (ComponentRegistrar) this.f2197b;
            default:
                return new b3.c((I2.g) this.f2197b);
        }
    }
}
