package f.z.d;

import f.u.b0;
import f.u.c0;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/* JADX INFO: compiled from: ClassReference.kt */
/* JADX INFO: loaded from: classes.dex */
public final class e implements f.c0.b<Object>, d {

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

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private static final Map<Class<? extends f.c<?>>, Integer> f3995c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private static final HashMap<String, String> f3996d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    private static final HashMap<String, String> f3997e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    private static final HashMap<String, String> f3998f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    private static final Map<String, String> f3999g;
    private final Class<?> a;

    /* JADX INFO: compiled from: ClassReference.kt */
    public static final class a {
        private a() {
        }

        public /* synthetic */ a(g gVar) {
            this();
        }

        public final String a(Class<?> cls) {
            String str;
            k.e(cls, "jClass");
            String str2 = null;
            if (!cls.isAnonymousClass()) {
                if (cls.isLocalClass()) {
                    String simpleName = cls.getSimpleName();
                    Method enclosingMethod = cls.getEnclosingMethod();
                    if (enclosingMethod != null) {
                        k.d(simpleName, "name");
                        String strU = f.e0.t.U(simpleName, enclosingMethod.getName() + '$', null, 2, null);
                        if (strU != null) {
                            return strU;
                        }
                    }
                    Constructor<?> enclosingConstructor = cls.getEnclosingConstructor();
                    if (enclosingConstructor == null) {
                        k.d(simpleName, "name");
                        return f.e0.t.T(simpleName, '$', null, 2, null);
                    }
                    k.d(simpleName, "name");
                    return f.e0.t.U(simpleName, enclosingConstructor.getName() + '$', null, 2, null);
                }
                if (!cls.isArray()) {
                    String str3 = (String) e.f3999g.get(cls.getName());
                    return str3 == null ? cls.getSimpleName() : str3;
                }
                Class<?> componentType = cls.getComponentType();
                if (componentType.isPrimitive() && (str = (String) e.f3999g.get(componentType.getName())) != null) {
                    str2 = str + "Array";
                }
                if (str2 == null) {
                    return "Array";
                }
            }
            return str2;
        }
    }

    /* JADX WARN: Multi-variable type inference failed */
    static {
        int i2 = 0;
        List listF = f.u.k.f(f.z.c.a.class, f.z.c.l.class, f.z.c.p.class, f.z.c.q.class, f.z.c.r.class, f.z.c.s.class, f.z.c.t.class, f.z.c.u.class, f.z.c.v.class, f.z.c.w.class, f.z.c.b.class, f.z.c.c.class, f.z.c.d.class, f.z.c.e.class, f.z.c.f.class, f.z.c.g.class, f.z.c.h.class, f.z.c.i.class, f.z.c.j.class, f.z.c.k.class, f.z.c.m.class, f.z.c.n.class, f.z.c.o.class);
        ArrayList arrayList = new ArrayList(f.u.l.j(listF, 10));
        for (Object obj : listF) {
            int i3 = i2 + 1;
            if (i2 < 0) {
                f.u.i.i();
                throw null;
            }
            arrayList.add(f.p.a((Class) obj, Integer.valueOf(i2)));
            i2 = i3;
        }
        f3995c = c0.i(arrayList);
        HashMap<String, String> map = new HashMap<>();
        map.put("boolean", "kotlin.Boolean");
        map.put("char", "kotlin.Char");
        map.put("byte", "kotlin.Byte");
        map.put("short", "kotlin.Short");
        map.put("int", "kotlin.Int");
        map.put("float", "kotlin.Float");
        map.put("long", "kotlin.Long");
        map.put("double", "kotlin.Double");
        f3996d = map;
        HashMap<String, String> map2 = new HashMap<>();
        map2.put("java.lang.Boolean", "kotlin.Boolean");
        map2.put("java.lang.Character", "kotlin.Char");
        map2.put("java.lang.Byte", "kotlin.Byte");
        map2.put("java.lang.Short", "kotlin.Short");
        map2.put("java.lang.Integer", "kotlin.Int");
        map2.put("java.lang.Float", "kotlin.Float");
        map2.put("java.lang.Long", "kotlin.Long");
        map2.put("java.lang.Double", "kotlin.Double");
        f3997e = map2;
        HashMap<String, String> map3 = new HashMap<>();
        map3.put("java.lang.Object", "kotlin.Any");
        map3.put("java.lang.String", "kotlin.String");
        map3.put("java.lang.CharSequence", "kotlin.CharSequence");
        map3.put("java.lang.Throwable", "kotlin.Throwable");
        map3.put("java.lang.Cloneable", "kotlin.Cloneable");
        map3.put("java.lang.Number", "kotlin.Number");
        map3.put("java.lang.Comparable", "kotlin.Comparable");
        map3.put("java.lang.Enum", "kotlin.Enum");
        map3.put("java.lang.annotation.Annotation", "kotlin.Annotation");
        map3.put("java.lang.Iterable", "kotlin.collections.Iterable");
        map3.put("java.util.Iterator", "kotlin.collections.Iterator");
        map3.put("java.util.Collection", "kotlin.collections.Collection");
        map3.put("java.util.List", "kotlin.collections.List");
        map3.put("java.util.Set", "kotlin.collections.Set");
        map3.put("java.util.ListIterator", "kotlin.collections.ListIterator");
        map3.put("java.util.Map", "kotlin.collections.Map");
        map3.put("java.util.Map$Entry", "kotlin.collections.Map.Entry");
        map3.put("kotlin.jvm.internal.StringCompanionObject", "kotlin.String.Companion");
        map3.put("kotlin.jvm.internal.EnumCompanionObject", "kotlin.Enum.Companion");
        map3.putAll(f3996d);
        map3.putAll(f3997e);
        Collection<String> collectionValues = f3996d.values();
        k.d(collectionValues, "primitiveFqNames.values");
        for (String str : collectionValues) {
            StringBuilder sb = new StringBuilder();
            sb.append("kotlin.jvm.internal.");
            k.d(str, "kotlinName");
            sb.append(f.e0.t.W(str, '.', null, 2, null));
            sb.append("CompanionObject");
            f.k kVarA = f.p.a(sb.toString(), str + ".Companion");
            map3.put(kVarA.c(), kVarA.d());
        }
        for (Map.Entry<Class<? extends f.c<?>>, Integer> entry : f3995c.entrySet()) {
            map3.put(entry.getKey().getName(), "kotlin.Function" + entry.getValue().intValue());
        }
        f3998f = map3;
        LinkedHashMap linkedHashMap = new LinkedHashMap(b0.a(map3.size()));
        for (Map.Entry entry2 : map3.entrySet()) {
            linkedHashMap.put(entry2.getKey(), f.e0.t.W((String) entry2.getValue(), '.', null, 2, null));
        }
        f3999g = linkedHashMap;
    }

    public e(Class<?> cls) {
        k.e(cls, "jClass");
        this.a = cls;
    }

    @Override // f.c0.b
    public String a() {
        return f3994b.a(b());
    }

    @Override // f.z.d.d
    public Class<?> b() {
        return this.a;
    }

    public boolean equals(Object obj) {
        return (obj instanceof e) && k.a(f.z.a.b(this), f.z.a.b((f.c0.b) obj));
    }

    public int hashCode() {
        return f.z.a.b(this).hashCode();
    }

    public String toString() {
        return b().toString() + " (Kotlin reflection is not available)";
    }
}
