package defpackage;

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

/* JADX INFO: renamed from: ʽˏᵹˑ, reason: contains not printable characters */
/* JADX INFO: loaded from: classes3.dex */
public final /* synthetic */ class C0118 implements InterfaceC5081 {

    /* JADX INFO: renamed from: ʽˈˋ, reason: contains not printable characters */
    public final /* synthetic */ Object f1422;

    /* JADX INFO: renamed from: ᵲᵶᵳˈ, reason: contains not printable characters */
    public final /* synthetic */ int f1423;

    public /* synthetic */ C0118(int i, Object obj) {
        this.f1423 = i;
        this.f1422 = obj;
    }

    @Override // defpackage.InterfaceC5081
    public final Object get() {
        int i = this.f1423;
        Object obj = this.f1422;
        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(AbstractC3589.m8117("Could not instantiate ", str, "."), e);
                } catch (InstantiationException e2) {
                    throw new InvalidRegistrarException(AbstractC3589.m8117("Could not instantiate ", str, "."), e2);
                } catch (NoSuchMethodException e3) {
                    throw new InvalidRegistrarException(AbstractC3589.m8102("Could not instantiate ", str), e3);
                } catch (InvocationTargetException e4) {
                    throw new InvalidRegistrarException(AbstractC3589.m8102("Could not instantiate ", str), e4);
                }
            case 1:
                return (ComponentRegistrar) obj;
            default:
                return new C3052((C1191) obj);
        }
    }
}
