package o;

import com.google.firebase.components.ComponentRegistrar;
import java.lang.reflect.InvocationTargetException;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* renamed from: o.Lj, reason: case insensitive filesystem */
/* loaded from: classes.dex */
public final /* synthetic */ class C0295Lj implements DZ {
    public final /* synthetic */ int a;
    public final /* synthetic */ Object b;

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

    @Override // o.DZ
    public final Object get() throws ClassNotFoundException {
        switch (this.a) {
            case 0:
                String str = (String) this.b;
                try {
                    Class<?> cls = Class.forName(str);
                    if (ComponentRegistrar.class.isAssignableFrom(cls)) {
                        return (ComponentRegistrar) cls.getDeclaredConstructor(null).newInstance(null);
                    }
                    throw new FI("Class " + str + " is not an instance of com.google.firebase.components.ComponentRegistrar");
                } catch (ClassNotFoundException unused) {
                    return null;
                } catch (IllegalAccessException e) {
                    throw new FI(AbstractC2462sn.j("Could not instantiate ", str, "."), e);
                } catch (InstantiationException e2) {
                    throw new FI(AbstractC2462sn.j("Could not instantiate ", str, "."), e2);
                } catch (NoSuchMethodException e3) {
                    throw new FI(AbstractC2462sn.u("Could not instantiate ", str), e3);
                } catch (InvocationTargetException e4) {
                    throw new FI(AbstractC2462sn.u("Could not instantiate ", str), e4);
                }
            case 1:
                return (ComponentRegistrar) this.b;
            default:
                return new C2321rG((C0076Cy) this.b);
        }
    }
}
