package defpackage;

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

/* renamed from: ᵩᵿˌᵚ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final /* synthetic */ class C3845 implements InterfaceC3290 {

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final /* synthetic */ int f14313;

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public final /* synthetic */ Object f14314;

    public /* synthetic */ C3845(int i, Object obj) {
        this.f14313 = i;
        this.f14314 = obj;
    }

    @Override // defpackage.InterfaceC3290
    public final Object get() throws ClassNotFoundException {
        int i = this.f14313;
        Object obj = this.f14314;
        switch (i) {
            case 0:
                String str = (String) obj;
                try {
                    Class<?> cls = Class.forName(str);
                    if (ComponentRegistrar.class.isAssignableFrom(cls)) {
                        return (ComponentRegistrar) cls.getDeclaredConstructor(null).newInstance(null);
                    }
                    throw new InvalidRegistrarException("Class " + str + " is not an instance of com.google.firebase.components.ComponentRegistrar");
                } catch (ClassNotFoundException unused) {
                    return null;
                } catch (IllegalAccessException e) {
                    throw new InvalidRegistrarException(AbstractC4486.m9550("Could not instantiate ", str, "."), e);
                } catch (InstantiationException e2) {
                    throw new InvalidRegistrarException(AbstractC4486.m9550("Could not instantiate ", str, "."), e2);
                } catch (NoSuchMethodException e3) {
                    throw new InvalidRegistrarException(AbstractC4486.m9562("Could not instantiate ", str), e3);
                } catch (InvocationTargetException e4) {
                    throw new InvalidRegistrarException(AbstractC4486.m9562("Could not instantiate ", str), e4);
                }
            case 1:
                return (ComponentRegistrar) obj;
            default:
                return new C4252((C2288) obj);
        }
    }
}
