package 㿎.ሽ.ᨨ;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import ඓ.K.K.K.C1293;

/* renamed from: 㿎.ሽ.ᨨ.ඓ  reason: contains not printable characters */
/* compiled from: OptionalMethod */
public class C2552<T> {

    /* renamed from: ʬ  reason: contains not printable characters */
    public final Class[] f8626;

    /* renamed from: ῲ  reason: contains not printable characters */
    public final String f8627;

    /* renamed from: K  reason: contains not printable characters */
    public final Class<?> f8628;

    public C2552(Class<?> cls, String str, Class... clsArr) {
        this.f8628 = cls;
        this.f8627 = str;
        this.f8626 = clsArr;
    }

    /* renamed from: ʬ  reason: contains not printable characters */
    public Object m6695(T t, Object... objArr) {
        try {
            return m6697(t, objArr);
        } catch (InvocationTargetException e) {
            Throwable targetException = e.getTargetException();
            if (targetException instanceof RuntimeException) {
                throw ((RuntimeException) targetException);
            }
            AssertionError assertionError = new AssertionError("Unexpected exception");
            assertionError.initCause(targetException);
            throw assertionError;
        }
    }

    /* renamed from: ῲ  reason: contains not printable characters */
    public Object m6696(T t, Object... objArr) {
        try {
            Method r0 = m6698(t.getClass());
            if (r0 == null) {
                return null;
            }
            try {
                return r0.invoke(t, objArr);
            } catch (IllegalAccessException unused) {
                return null;
            }
        } catch (InvocationTargetException e) {
            Throwable targetException = e.getTargetException();
            if (targetException instanceof RuntimeException) {
                throw ((RuntimeException) targetException);
            }
            AssertionError assertionError = new AssertionError("Unexpected exception");
            assertionError.initCause(targetException);
            throw assertionError;
        }
    }

    /* renamed from: K  reason: contains not printable characters */
    public Object m6697(T t, Object... objArr) throws InvocationTargetException {
        Method r0 = m6698(t.getClass());
        if (r0 != null) {
            try {
                return r0.invoke(t, objArr);
            } catch (IllegalAccessException e) {
                AssertionError assertionError = new AssertionError("Unexpectedly could not call: " + r0);
                assertionError.initCause(e);
                throw assertionError;
            }
        } else {
            StringBuilder r02 = C1293.m3416("Method ");
            r02.append(this.f8627);
            r02.append(" not supported for object ");
            r02.append((Object) t);
            throw new AssertionError(r02.toString());
        }
    }

    /* JADX WARNING: Code restructure failed: missing block: B:8:0x0011, code lost:
        if ((r4.getModifiers() & 1) == 0) goto L_0x0013;
     */
    /* renamed from: K  reason: contains not printable characters */
    public final Method m6698(Class<?> cls) {
        Method method;
        Class<?> cls2;
        String str = this.f8627;
        if (str == null) {
            return null;
        }
        try {
            method = cls.getMethod(str, this.f8626);
        } catch (NoSuchMethodException unused) {
        }
        method = null;
        if (method != null || (cls2 = this.f8628) == null || cls2.isAssignableFrom(method.getReturnType())) {
            return method;
        }
        return null;
        if (method != null) {
        }
        return method;
    }
}
