package g.h0.c;

import com.google.zxing.oned.rss.expanded.decoders.DecodedChar;
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.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/* JADX INFO: compiled from: ClassReference.kt */
/* JADX INFO: loaded from: classes.dex */
@g.i
public final class e implements g.k0.c<Object>, d {

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

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public static final Map<Class<? extends g.d<?>>, Integer> f4103e;

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

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    public static final HashMap<String, String> f4105g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    public static final HashMap<String, String> f4106h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    public static final Map<String, String> f4107i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    public final Class<?> f4108j;

    /* JADX INFO: compiled from: ClassReference.kt */
    @g.i
    public static final class a {
        public a(g gVar) {
        }
    }

    static {
        int i2 = 0;
        List listU = g.c0.g.u(g.h0.b.a.class, g.h0.b.l.class, g.h0.b.p.class, g.h0.b.q.class, g.h0.b.r.class, g.h0.b.s.class, g.h0.b.t.class, g.h0.b.u.class, g.h0.b.v.class, g.h0.b.w.class, g.h0.b.b.class, g.h0.b.c.class, g.h0.b.d.class, g.h0.b.e.class, g.h0.b.f.class, g.h0.b.g.class, g.h0.b.h.class, g.h0.b.i.class, g.h0.b.j.class, g.h0.b.k.class, g.h0.b.m.class, g.h0.b.n.class, g.h0.b.o.class);
        ArrayList arrayList = new ArrayList(f.a.y.a.C(listU, 10));
        for (Object obj : listU) {
            int i3 = i2 + 1;
            if (i2 < 0) {
                g.c0.g.D();
                throw null;
            }
            arrayList.add(new g.k((Class) obj, Integer.valueOf(i2)));
            i2 = i3;
        }
        f4103e = g.c0.g.G(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");
        f4104f = 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");
        f4105g = 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(map);
        map3.putAll(map2);
        Collection<String> collectionValues = map.values();
        l.e(collectionValues, "primitiveFqNames.values");
        for (String str : collectionValues) {
            StringBuilder sb = new StringBuilder();
            sb.append("kotlin.jvm.internal.");
            l.e(str, "kotlinName");
            sb.append(g.m0.f.M(str, '.', null, 2));
            sb.append("CompanionObject");
            map3.put(sb.toString(), str + ".Companion");
        }
        for (Map.Entry<Class<? extends g.d<?>>, Integer> entry : f4103e.entrySet()) {
            map3.put(entry.getKey().getName(), "kotlin.Function" + entry.getValue().intValue());
        }
        f4106h = map3;
        LinkedHashMap linkedHashMap = new LinkedHashMap(f.a.y.a.x0(map3.size()));
        Iterator<T> it = map3.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry entry2 = (Map.Entry) it.next();
            linkedHashMap.put(entry2.getKey(), g.m0.f.M((String) entry2.getValue(), '.', null, 2));
        }
        f4107i = linkedHashMap;
    }

    public e(Class<?> cls) {
        l.f(cls, "jClass");
        this.f4108j = cls;
    }

    @Override // g.k0.c
    public String a() {
        String str;
        Class<?> cls = this.f4108j;
        l.f(cls, "jClass");
        String strP = null;
        if (!cls.isAnonymousClass()) {
            if (cls.isLocalClass()) {
                String simpleName = cls.getSimpleName();
                Method enclosingMethod = cls.getEnclosingMethod();
                if (enclosingMethod != null) {
                    l.e(simpleName, "name");
                    return g.m0.f.L(simpleName, enclosingMethod.getName() + DecodedChar.FNC1, null, 2);
                }
                Constructor<?> enclosingConstructor = cls.getEnclosingConstructor();
                if (enclosingConstructor != null) {
                    l.e(simpleName, "name");
                    return g.m0.f.L(simpleName, enclosingConstructor.getName() + DecodedChar.FNC1, null, 2);
                }
                l.e(simpleName, "name");
                l.f(simpleName, "<this>");
                l.f(simpleName, "missingDelimiterValue");
                int iL = g.m0.f.l(simpleName, DecodedChar.FNC1, 0, false, 6);
                if (iL == -1) {
                    return simpleName;
                }
                String strSubstring = simpleName.substring(iL + 1, simpleName.length());
                l.e(strSubstring, "this as java.lang.String…ing(startIndex, endIndex)");
                return strSubstring;
            }
            if (!cls.isArray()) {
                String str2 = f4107i.get(cls.getName());
                return str2 == null ? cls.getSimpleName() : str2;
            }
            Class<?> componentType = cls.getComponentType();
            if (componentType.isPrimitive() && (str = f4107i.get(componentType.getName())) != null) {
                strP = d.b.a.a.a.p(str, "Array");
            }
            if (strP == null) {
                return "Array";
            }
        }
        return strP;
    }

    @Override // g.h0.c.d
    public Class<?> b() {
        return this.f4108j;
    }

    public boolean equals(Object obj) {
        return (obj instanceof e) && l.a(f.a.y.a.c0(this), f.a.y.a.c0((g.k0.c) obj));
    }

    public int hashCode() {
        return f.a.y.a.c0(this).hashCode();
    }

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