package defpackage;

import androidx.fragment.app.Fragment$InstantiationException;
import java.lang.reflect.InvocationTargetException;

/* renamed from: ᵞʡʦـ, reason: contains not printable characters */
/* loaded from: classes3.dex */
public final class C2944 {

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static final C2771 f11407 = new C2771(0);

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

    public C2944(AbstractC4731 abstractC4731) {
        this.f11408 = abstractC4731;
    }

    /* renamed from: ˏᵙ, reason: contains not printable characters */
    public static Class m7176(ClassLoader classLoader, String str) {
        try {
            return m7177(classLoader, str);
        } catch (ClassCastException e) {
            throw new Fragment$InstantiationException(AbstractC4486.m9550("Unable to instantiate fragment ", str, ": make sure class is a valid subclass of Fragment"), e);
        } catch (ClassNotFoundException e2) {
            throw new Fragment$InstantiationException(AbstractC4486.m9550("Unable to instantiate fragment ", str, ": make sure class name exists"), e2);
        }
    }

    /* renamed from: ᵴᵳ, reason: contains not printable characters */
    public static Class m7177(ClassLoader classLoader, String str) throws ClassNotFoundException {
        C2771 c2771 = f11407;
        C2771 c27712 = (C2771) c2771.get(classLoader);
        if (c27712 == null) {
            c27712 = new C2771(0);
            c2771.put(classLoader, c27712);
        }
        Class cls = (Class) c27712.get(str);
        if (cls != null) {
            return cls;
        }
        Class<?> cls2 = Class.forName(str, false, classLoader);
        c27712.put(str, cls2);
        return cls2;
    }

    /* renamed from: ᵥᵯˎ, reason: contains not printable characters */
    public final AbstractComponentCallbacksC3693 m7178(String str) {
        try {
            return (AbstractComponentCallbacksC3693) m7176(this.f11408.f17518.f3055.getClassLoader(), str).getConstructor(null).newInstance(null);
        } catch (IllegalAccessException e) {
            throw new Fragment$InstantiationException(AbstractC4486.m9550("Unable to instantiate fragment ", str, ": make sure class name exists, is public, and has an empty constructor that is public"), e);
        } catch (InstantiationException e2) {
            throw new Fragment$InstantiationException(AbstractC4486.m9550("Unable to instantiate fragment ", str, ": make sure class name exists, is public, and has an empty constructor that is public"), e2);
        } catch (NoSuchMethodException e3) {
            throw new Fragment$InstantiationException(AbstractC4486.m9550("Unable to instantiate fragment ", str, ": could not find Fragment constructor"), e3);
        } catch (InvocationTargetException e4) {
            throw new Fragment$InstantiationException(AbstractC4486.m9550("Unable to instantiate fragment ", str, ": calling Fragment constructor caused an exception"), e4);
        }
    }
}
