package c.n.e.a;

import c.q.d.j;
import java.lang.reflect.Method;

/* JADX INFO: compiled from: DebugMetadata.kt */
/* JADX INFO: loaded from: classes.dex */
final class g {

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public static a f1435b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public static final g f1436c = new g();

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private static final a f1434a = new a(null, null, null);

    /* JADX INFO: compiled from: DebugMetadata.kt */
    private static final class a {

        /* JADX INFO: renamed from: a, reason: collision with root package name */
        public final Method f1437a;

        /* JADX INFO: renamed from: b, reason: collision with root package name */
        public final Method f1438b;

        /* JADX INFO: renamed from: c, reason: collision with root package name */
        public final Method f1439c;

        public a(Method method, Method method2, Method method3) {
            this.f1437a = method;
            this.f1438b = method2;
            this.f1439c = method3;
        }
    }

    private g() {
    }

    private final a a(c.n.e.a.a aVar) {
        try {
            a aVar2 = new a(Class.class.getDeclaredMethod("getModule", new Class[0]), aVar.getClass().getClassLoader().loadClass("java.lang.Module").getDeclaredMethod("getDescriptor", new Class[0]), aVar.getClass().getClassLoader().loadClass("java.lang.module.ModuleDescriptor").getDeclaredMethod("name", new Class[0]));
            f1435b = aVar2;
            return aVar2;
        } catch (Exception unused) {
            a aVar3 = f1434a;
            f1435b = aVar3;
            return aVar3;
        }
    }

    public final String b(c.n.e.a.a aVar) {
        Method method;
        Object objInvoke;
        Method method2;
        Object objInvoke2;
        j.c(aVar, "continuation");
        a aVarA = f1435b;
        if (aVarA == null) {
            aVarA = a(aVar);
        }
        if (aVarA == f1434a || (method = aVarA.f1437a) == null || (objInvoke = method.invoke(aVar.getClass(), new Object[0])) == null || (method2 = aVarA.f1438b) == null || (objInvoke2 = method2.invoke(objInvoke, new Object[0])) == null) {
            return null;
        }
        Method method3 = aVarA.f1439c;
        Object objInvoke3 = method3 != null ? method3.invoke(objInvoke2, new Object[0]) : null;
        return (String) (objInvoke3 instanceof String ? objInvoke3 : null);
    }
}
