package mn;

import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import kn.g;
import kn.h;
import kn.l;
import kotlin.jvm.internal.t;
import nn.n;
import nn.p0;
import on.e;

/* loaded from: classes3.dex */
public abstract class a {
    public static final boolean a(kn.c cVar) {
        e B;
        t.g(cVar, "<this>");
        if (cVar instanceof h) {
            l lVar = (l) cVar;
            Field b10 = c.b(lVar);
            if (!(b10 != null ? b10.isAccessible() : true)) {
                return false;
            }
            Method c10 = c.c(lVar);
            if (!(c10 != null ? c10.isAccessible() : true)) {
                return false;
            }
            Method e10 = c.e((h) cVar);
            if (!(e10 != null ? e10.isAccessible() : true)) {
                return false;
            }
        } else if (cVar instanceof l) {
            l lVar2 = (l) cVar;
            Field b11 = c.b(lVar2);
            if (!(b11 != null ? b11.isAccessible() : true)) {
                return false;
            }
            Method c11 = c.c(lVar2);
            if (!(c11 != null ? c11.isAccessible() : true)) {
                return false;
            }
        } else if (cVar instanceof l.b) {
            Field b12 = c.b(((l.b) cVar).l());
            if (!(b12 != null ? b12.isAccessible() : true)) {
                return false;
            }
            Method d10 = c.d((g) cVar);
            if (!(d10 != null ? d10.isAccessible() : true)) {
                return false;
            }
        } else if (cVar instanceof h.a) {
            Field b13 = c.b(((h.a) cVar).l());
            if (!(b13 != null ? b13.isAccessible() : true)) {
                return false;
            }
            Method d11 = c.d((g) cVar);
            if (!(d11 != null ? d11.isAccessible() : true)) {
                return false;
            }
        } else {
            if (!(cVar instanceof g)) {
                throw new UnsupportedOperationException("Unknown callable: " + cVar + " (" + cVar.getClass() + ')');
            }
            g gVar = (g) cVar;
            Method d12 = c.d(gVar);
            if (!(d12 != null ? d12.isAccessible() : true)) {
                return false;
            }
            n b14 = p0.b(cVar);
            Member member = (b14 == null || (B = b14.B()) == null) ? null : B.getMember();
            AccessibleObject accessibleObject = member instanceof AccessibleObject ? (AccessibleObject) member : null;
            if (!(accessibleObject != null ? accessibleObject.isAccessible() : true)) {
                return false;
            }
            Constructor a10 = c.a(gVar);
            if (!(a10 != null ? a10.isAccessible() : true)) {
                return false;
            }
        }
        return true;
    }
}
