package ῲ.Ԕ.K;

import androidx.fragment.app.Fragment;
import java.lang.reflect.InvocationTargetException;
import ඓ.K.K.K.C1293;
import ῲ.㴹.C2288;

/* renamed from: ῲ.Ԕ.K.ඓ  reason: contains not printable characters */
/* compiled from: FragmentFactory */
public class C1522 {

    /* renamed from: K  reason: contains not printable characters */
    public static final C2288<String, Class<?>> f5582 = new C2288<>();

    /* renamed from: ʬ  reason: contains not printable characters */
    public static Class<?> m3875(ClassLoader classLoader, String str) throws ClassNotFoundException {
        Class<?> orDefault = f5582.getOrDefault(str, null);
        if (orDefault != null) {
            return orDefault;
        }
        Class<?> cls = Class.forName(str, false, classLoader);
        f5582.put(str, cls);
        return cls;
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public static boolean m3876(ClassLoader classLoader, String str) {
        try {
            return Fragment.class.isAssignableFrom(m3875(classLoader, str));
        } catch (ClassNotFoundException unused) {
            return false;
        }
    }

    /* JADX DEBUG: Type inference failed for r3v3. Raw type applied. Possible types: java.lang.Class<?>, java.lang.Class<? extends androidx.fragment.app.Fragment> */
    /* renamed from: 㸾  reason: contains not printable characters */
    public static Class<? extends Fragment> m3877(ClassLoader classLoader, String str) {
        try {
            return m3875(classLoader, str);
        } catch (ClassNotFoundException e) {
            throw new Fragment.InstantiationException(C1293.m3413("Unable to instantiate fragment ", str, ": make sure class name exists"), e);
        } catch (ClassCastException e2) {
            throw new Fragment.InstantiationException(C1293.m3413("Unable to instantiate fragment ", str, ": make sure class is a valid subclass of Fragment"), e2);
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public Fragment m3878(ClassLoader classLoader, String str) {
        try {
            return (Fragment) m3877(classLoader, str).getConstructor(new Class[0]).newInstance(new Object[0]);
        } catch (InstantiationException e) {
            throw new Fragment.InstantiationException(C1293.m3413("Unable to instantiate fragment ", str, ": make sure class name exists, is public, and has an empty constructor that is public"), e);
        } catch (IllegalAccessException e2) {
            throw new Fragment.InstantiationException(C1293.m3413("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(C1293.m3413("Unable to instantiate fragment ", str, ": could not find Fragment constructor"), e3);
        } catch (InvocationTargetException e4) {
            throw new Fragment.InstantiationException(C1293.m3413("Unable to instantiate fragment ", str, ": calling Fragment constructor caused an exception"), e4);
        }
    }
}
