package g;

import d.AbstractC0421a;
import d.C0422b;
import d.C0424d;
import d.C0425e;
import d.C0426f;
import d.C0427g;
import d.EnumC0439l;
import e.InterfaceC0450a;
import e.InterfaceC0451b;
import h.C0496A;
import h.C0497B;
import h.C0498C;
import h.C0499a;
import h.C0501c;
import h.InterfaceC0502d;
import h.n;
import h.o;
import h.p;
import h.q;
import h.r;
import h.s;
import h.t;
import h.u;
import h.w;
import h.x;
import h.z;
import i.C0509B;
import i.C0510C;
import i.C0511D;
import i.C0518K;
import i.C0527g;
import i.C0529i;
import i.C0532l;
import i.C0533m;
import i.C0534n;
import i.C0535o;
import i.C0536p;
import i.C0537q;
import i.C0539t;
import i.C0542w;
import i.O;
import i.Q;
import i.T;
import i.Y;
import i.g0;
import j.C0550a;
import java.io.Closeable;
import java.io.File;
import java.io.Serializable;
import java.lang.ref.SoftReference;
import java.lang.ref.WeakReference;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.lang.reflect.TypeVariable;
import java.lang.reflect.WildcardType;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.net.Inet4Address;
import java.net.Inet6Address;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.URI;
import java.net.URL;
import java.nio.charset.Charset;
import java.security.AccessControlException;
import java.sql.Date;
import java.sql.Time;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collection;
import java.util.Currency;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.UUID;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicIntegerArray;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicLongArray;
import java.util.concurrent.atomic.AtomicReference;
import java.util.regex.Pattern;
import javax.xml.datatype.XMLGregorianCalendar;
import l.AbstractC0610b;
import l.AbstractC0613e;
import l.C0609a;
import l.C0611c;
import l.C0614f;
import l.C0615g;
import l.k;
import l.l;

/* JADX INFO: loaded from: classes.dex */
public class i {

    /* JADX INFO: renamed from: A, reason: collision with root package name */
    private static boolean f3990A;

    /* JADX INFO: renamed from: B, reason: collision with root package name */
    private static boolean f3991B;

    /* JADX INFO: renamed from: C, reason: collision with root package name */
    private static boolean f3992C;

    /* JADX INFO: renamed from: u, reason: collision with root package name */
    private static final String[] f3995u;

    /* JADX INFO: renamed from: x, reason: collision with root package name */
    private static final long[] f3998x;

    /* JADX INFO: renamed from: y, reason: collision with root package name */
    public static i f3999y;

    /* JADX INFO: renamed from: z, reason: collision with root package name */
    private static boolean f4000z;

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    private final C0614f f4001a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    private final C0614f f4002b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    private final ConcurrentMap f4003c;

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    private boolean f4004d;

    /* JADX INFO: renamed from: e, reason: collision with root package name */
    public final j f4005e;

    /* JADX INFO: renamed from: f, reason: collision with root package name */
    public EnumC0439l f4006f;

    /* JADX INFO: renamed from: g, reason: collision with root package name */
    protected ClassLoader f4007g;

    /* JADX INFO: renamed from: h, reason: collision with root package name */
    protected C0499a f4008h;

    /* JADX INFO: renamed from: i, reason: collision with root package name */
    private boolean f4009i;

    /* JADX INFO: renamed from: j, reason: collision with root package name */
    private long[] f4010j;

    /* JADX INFO: renamed from: k, reason: collision with root package name */
    private long[] f4011k;

    /* JADX INFO: renamed from: l, reason: collision with root package name */
    private long[] f4012l;

    /* JADX INFO: renamed from: m, reason: collision with root package name */
    public final boolean f4013m;

    /* JADX INFO: renamed from: n, reason: collision with root package name */
    private boolean f4014n;

    /* JADX INFO: renamed from: o, reason: collision with root package name */
    public boolean f4015o;

    /* JADX INFO: renamed from: p, reason: collision with root package name */
    private List f4016p;

    /* JADX INFO: renamed from: q, reason: collision with root package name */
    private volatile List f4017q;

    /* JADX INFO: renamed from: r, reason: collision with root package name */
    private boolean f4018r;

    /* JADX INFO: renamed from: s, reason: collision with root package name */
    public static final String[] f3993s = y(AbstractC0613e.g("fastjson.parser.deny.internal"));

    /* JADX INFO: renamed from: t, reason: collision with root package name */
    public static final String[] f3994t = y(AbstractC0613e.g("fastjson.parser.deny"));

    /* JADX INFO: renamed from: v, reason: collision with root package name */
    public static final boolean f3996v = "true".equals(AbstractC0613e.g("fastjson.parser.autoTypeSupport"));

    /* JADX INFO: renamed from: w, reason: collision with root package name */
    public static final boolean f3997w = "true".equals(AbstractC0613e.g("fastjson.parser.safeMode"));

    public interface a {
    }

    static {
        String[] strArrY = y(AbstractC0613e.g("fastjson.parser.autoTypeAccept"));
        if (strArrY == null) {
            strArrY = new String[0];
        }
        f3995u = strArrY;
        f3998x = new long[]{-9013707057526259810L, -8773806119481270567L, -8421588593326113468L, -8070393259084821111L, -7858127399773263546L, -7043543676283957292L, -6976602508726000783L, -6293031534589903644L, -6081111809668363619L, -5779433778261875721L, -5399450433995651784L, -4540135604787511831L, -4207865850564917696L, -3950343444501679205L, -3714900953609113456L, -3393714734093696063L, -3378497329992063044L, -2631228350337215662L, -2551988546877734201L, -2473987886800209058L, -2265617974881722705L, -1759511109484434299L, -1477946458560579955L, -816725787720647462L, -520183782617964618L, 59775428743665658L, 484499585846206473L, 532945107123976213L, 711449177569584898L, 829148494126372070L, 956883420092542580L, 1233162291719202522L, 1696465274354442213L, 1863557081881630420L, 2238472697200138595L, 2380202963256720577L, 2643099543618286743L, 2793877891138577121L, 3804572268889088203L, 4567982875926242015L, 4784070066737926537L, 4960004821520561233L, 5348524593377618456L, 5454920836284873808L, 5695987590363189151L, 6073645722991901167L, 6114875255374330593L, 6137737446243999215L, 6160752908990493848L, 6939315124833099497L, 7048426940343117278L, 7267793227937552092L, 8331868837379820532L, 8357451534615459155L, 8890227807433646566L, 9166532985682478006L, 9215131087512669423L};
        f3999y = new i();
        f4000z = false;
        f3990A = false;
        f3991B = false;
        f3992C = false;
    }

    public i() {
        this(false);
    }

    private void d(String[] strArr) {
        if (strArr == null) {
            return;
        }
        for (String str : strArr) {
            a(str);
        }
    }

    private void e(String[] strArr) {
        if (strArr == null) {
            return;
        }
        for (String str : strArr) {
            b(str);
        }
    }

    private void f(String[] strArr) {
        if (strArr == null) {
            return;
        }
        for (String str : strArr) {
            c(str);
        }
    }

    private static Method o(Class cls, Class cls2) {
        for (Method method : cls.getMethods()) {
            if (Modifier.isStatic(method.getModifiers()) && method.getReturnType() == cls2 && method.getParameterTypes().length == 1 && ((InterfaceC0450a) method.getAnnotation(InterfaceC0450a.class)) != null) {
                return method;
            }
        }
        return null;
    }

    public static Field q(String str, Map map) {
        Field field = (Field) map.get(str);
        if (field == null) {
            field = (Field) map.get("_" + str);
        }
        if (field == null) {
            field = (Field) map.get("m_" + str);
        }
        if (field != null) {
            return field;
        }
        char cCharAt = str.charAt(0);
        if (cCharAt >= 'a' && cCharAt <= 'z') {
            char[] charArray = str.toCharArray();
            charArray[0] = (char) (charArray[0] - ' ');
            field = (Field) map.get(new String(charArray));
        }
        if (str.length() <= 2) {
            return field;
        }
        char cCharAt2 = str.charAt(1);
        if (str.length() <= 2 || cCharAt < 'a' || cCharAt > 'z' || cCharAt2 < 'A' || cCharAt2 > 'Z') {
            return field;
        }
        for (Map.Entry entry : map.entrySet()) {
            if (str.equalsIgnoreCase((String) entry.getKey())) {
                return (Field) entry.getValue();
            }
        }
        return field;
    }

    public static i r() {
        return f3999y;
    }

    private void s() {
        C0614f c0614f = this.f4001a;
        Q q2 = Q.f4263b;
        c0614f.c(SimpleDateFormat.class, q2);
        this.f4001a.c(Timestamp.class, z.f4184c);
        this.f4001a.c(Date.class, z.f4183b);
        this.f4001a.c(Time.class, C0498C.f4117a);
        this.f4001a.c(java.util.Date.class, C0542w.f4381a);
        C0614f c0614f2 = this.f4001a;
        C0536p c0536p = C0536p.f4376b;
        c0614f2.c(Calendar.class, c0536p);
        this.f4001a.c(XMLGregorianCalendar.class, c0536p);
        this.f4001a.c(C0425e.class, r.f4173a);
        C0614f c0614f3 = this.f4001a;
        C0539t c0539t = C0539t.f4380a;
        c0614f3.c(C0422b.class, c0539t);
        this.f4001a.c(Map.class, r.f4173a);
        this.f4001a.c(HashMap.class, r.f4173a);
        this.f4001a.c(LinkedHashMap.class, r.f4173a);
        this.f4001a.c(TreeMap.class, r.f4173a);
        this.f4001a.c(ConcurrentMap.class, r.f4173a);
        this.f4001a.c(ConcurrentHashMap.class, r.f4173a);
        this.f4001a.c(Collection.class, c0539t);
        this.f4001a.c(List.class, c0539t);
        this.f4001a.c(ArrayList.class, c0539t);
        C0614f c0614f4 = this.f4001a;
        p pVar = p.f4151a;
        c0614f4.c(Object.class, pVar);
        this.f4001a.c(String.class, g0.f4362a);
        this.f4001a.c(StringBuffer.class, g0.f4362a);
        this.f4001a.c(StringBuilder.class, g0.f4362a);
        C0614f c0614f5 = this.f4001a;
        Class cls = Character.TYPE;
        i.r rVar = i.r.f4378a;
        c0614f5.c(cls, rVar);
        this.f4001a.c(Character.class, rVar);
        C0614f c0614f6 = this.f4001a;
        Class cls2 = Byte.TYPE;
        s sVar = s.f4174a;
        c0614f6.c(cls2, sVar);
        this.f4001a.c(Byte.class, sVar);
        this.f4001a.c(Short.TYPE, sVar);
        this.f4001a.c(Short.class, sVar);
        this.f4001a.c(Integer.TYPE, C0511D.f4218a);
        this.f4001a.c(Integer.class, C0511D.f4218a);
        this.f4001a.c(Long.TYPE, O.f4259a);
        this.f4001a.c(Long.class, O.f4259a);
        this.f4001a.c(BigInteger.class, C0533m.f4373c);
        this.f4001a.c(BigDecimal.class, C0532l.f4370c);
        this.f4001a.c(Float.TYPE, C0509B.f4215b);
        this.f4001a.c(Float.class, C0509B.f4215b);
        this.f4001a.c(Double.TYPE, sVar);
        this.f4001a.c(Double.class, sVar);
        C0614f c0614f7 = this.f4001a;
        Class cls3 = Boolean.TYPE;
        C0534n c0534n = C0534n.f4374a;
        c0614f7.c(cls3, c0534n);
        this.f4001a.c(Boolean.class, c0534n);
        this.f4001a.c(Class.class, q2);
        this.f4001a.c(char[].class, new C0537q());
        this.f4001a.c(AtomicBoolean.class, c0534n);
        this.f4001a.c(AtomicInteger.class, C0511D.f4218a);
        this.f4001a.c(AtomicLong.class, O.f4259a);
        C0614f c0614f8 = this.f4001a;
        Y y2 = Y.f4268a;
        c0614f8.c(AtomicReference.class, y2);
        this.f4001a.c(WeakReference.class, y2);
        this.f4001a.c(SoftReference.class, y2);
        this.f4001a.c(UUID.class, q2);
        this.f4001a.c(TimeZone.class, q2);
        this.f4001a.c(Locale.class, q2);
        this.f4001a.c(Currency.class, q2);
        this.f4001a.c(Inet4Address.class, q2);
        this.f4001a.c(Inet6Address.class, q2);
        this.f4001a.c(InetSocketAddress.class, q2);
        this.f4001a.c(File.class, q2);
        this.f4001a.c(URI.class, q2);
        this.f4001a.c(URL.class, q2);
        this.f4001a.c(Pattern.class, q2);
        this.f4001a.c(Charset.class, q2);
        this.f4001a.c(C0427g.class, q2);
        this.f4001a.c(Number.class, sVar);
        C0614f c0614f9 = this.f4001a;
        C0527g c0527g = C0527g.f4361a;
        c0614f9.c(AtomicIntegerArray.class, c0527g);
        this.f4001a.c(AtomicLongArray.class, c0527g);
        this.f4001a.c(StackTraceElement.class, C0496A.f4116a);
        this.f4001a.c(Serializable.class, pVar);
        this.f4001a.c(Cloneable.class, pVar);
        this.f4001a.c(Comparable.class, pVar);
        this.f4001a.c(Closeable.class, pVar);
        this.f4001a.c(C0426f.class, new n());
    }

    public static boolean u(Class cls) {
        return cls.isPrimitive() || cls == Boolean.class || cls == Character.class || cls == Byte.class || cls == Short.class || cls == Integer.class || cls == Long.class || cls == Float.class || cls == Double.class || cls == BigInteger.class || cls == BigDecimal.class || cls == String.class || cls == java.util.Date.class || cls == Date.class || cls == Time.class || cls == Timestamp.class || cls.isEnum();
    }

    public static void v(Class cls, Map map) {
        for (Field field : cls.getDeclaredFields()) {
            String name = field.getName();
            if (!map.containsKey(name)) {
                map.put(name, field);
            }
        }
        if (cls.getSuperclass() == null || cls.getSuperclass() == Object.class) {
            return;
        }
        v(cls.getSuperclass(), map);
    }

    private static String[] y(String str) {
        if (str == null || str.length() <= 0) {
            return null;
        }
        return str.split(",");
    }

    public void a(String str) {
        if (str == null || str.length() == 0) {
            return;
        }
        long jI = l.I(str);
        if (Arrays.binarySearch(this.f4012l, jI) >= 0) {
            return;
        }
        long[] jArr = this.f4012l;
        int length = jArr.length;
        long[] jArr2 = new long[length + 1];
        jArr2[length] = jI;
        System.arraycopy(jArr, 0, jArr2, 0, jArr.length);
        Arrays.sort(jArr2);
        this.f4012l = jArr2;
    }

    public void b(String str) {
        if (str == null || str.length() == 0) {
            return;
        }
        long jI = l.I(str);
        if (Arrays.binarySearch(this.f4011k, jI) >= 0) {
            return;
        }
        long[] jArr = this.f4011k;
        int length = jArr.length;
        long[] jArr2 = new long[length + 1];
        jArr2[length] = jI;
        System.arraycopy(jArr, 0, jArr2, 0, jArr.length);
        Arrays.sort(jArr2);
        this.f4011k = jArr2;
    }

    public void c(String str) {
        if (str == null || str.length() == 0) {
            return;
        }
        long jI = l.I(str);
        long[] jArr = this.f4010j;
        if (jArr == null) {
            this.f4010j = new long[]{jI};
            return;
        }
        if (Arrays.binarySearch(jArr, jI) >= 0) {
            return;
        }
        long[] jArr2 = this.f4010j;
        int length = jArr2.length;
        long[] jArr3 = new long[1 + length];
        jArr3[length] = jI;
        System.arraycopy(jArr2, 0, jArr3, 0, jArr2.length);
        Arrays.sort(jArr3);
        this.f4010j = jArr3;
    }

    public Class g(String str, Class cls) {
        return h(str, cls, AbstractC0421a.f3668H);
    }

    /* JADX WARN: Removed duplicated region for block: B:24:0x0049  */
    /*
        Code decompiled incorrectly, please refer to instructions dump.
        To view partially-correct add '--show-bad-code' argument
    */
    public java.lang.Class h(java.lang.String r24, java.lang.Class r25, int r26) throws java.lang.Throwable {
        /*
            Method dump skipped, instruction units count: 1012
            To view this dump add '--comments-level debug' option
        */
        throw new UnsupportedOperationException("Method not decompiled: g.i.h(java.lang.String, java.lang.Class, int):java.lang.Class");
    }

    public h.l i(i iVar, C0615g c0615g, C0611c c0611c) {
        Class clsDeserializeUsing;
        Class cls = c0615g.f5289a;
        Class cls2 = c0611c.f5264y;
        InterfaceC0451b interfaceC0451bD = c0611c.d();
        Class cls3 = null;
        if (interfaceC0451bD != null && (clsDeserializeUsing = interfaceC0451bD.deserializeUsing()) != Void.class) {
            cls3 = clsDeserializeUsing;
        }
        return (cls3 == null && (cls2 == List.class || cls2 == ArrayList.class)) ? new C0501c(iVar, cls, c0611c) : new h.f(iVar, cls, c0611c);
    }

    public t j(Class cls, Type type) {
        InterfaceC0451b interfaceC0451bD;
        Method method;
        C0499a c0499a;
        boolean zA = this.f4004d & (!this.f4013m);
        if (zA) {
            e.d dVar = (e.d) l.M(cls, e.d.class);
            if (dVar != null) {
                Class clsDeserializer = dVar.deserializer();
                if (clsDeserializer != Void.class) {
                    try {
                        Object objNewInstance = clsDeserializer.newInstance();
                        if (objNewInstance instanceof t) {
                            return (t) objNewInstance;
                        }
                    } catch (Throwable unused) {
                    }
                }
                zA = dVar.asm();
            }
            if (zA) {
                Class clsF = C0615g.f(cls, dVar);
                if (clsF == null) {
                    clsF = cls;
                }
                while (true) {
                    if (!Modifier.isPublic(clsF.getModifiers())) {
                        zA = false;
                        break;
                    }
                    clsF = clsF.getSuperclass();
                    if (clsF == Object.class || clsF == null) {
                        break;
                    }
                }
            }
        }
        if (cls.getTypeParameters().length != 0) {
            zA = false;
        }
        if (zA && (c0499a = this.f4008h) != null && c0499a.f4120a.c(cls)) {
            zA = false;
        }
        if (zA) {
            zA = AbstractC0610b.a(cls.getSimpleName());
        }
        if (zA) {
            if (cls.isInterface()) {
                zA = false;
            }
            C0615g c0615gC = C0615g.c(cls, type, this.f4006f, false, l.f5332b, this.f4014n);
            if (zA && c0615gC.f5296h.length > 200) {
                zA = false;
            }
            Constructor constructor = c0615gC.f5291c;
            if (zA && constructor == null && !cls.isInterface()) {
                zA = false;
            }
            for (C0611c c0611c : c0615gC.f5296h) {
                if (!c0611c.f5245L) {
                    Class cls2 = c0611c.f5264y;
                    if (Modifier.isPublic(cls2.getModifiers()) && ((!cls2.isMemberClass() || Modifier.isStatic(cls2.getModifiers())) && ((c0611c.l() == null || AbstractC0610b.a(c0611c.l().getName())) && (((interfaceC0451bD = c0611c.d()) == null || (AbstractC0610b.a(interfaceC0451bD.name()) && interfaceC0451bD.format().length() == 0 && interfaceC0451bD.deserializeUsing() == Void.class && interfaceC0451bD.parseFeatures().length == 0 && !interfaceC0451bD.unwrapped())) && (((method = c0611c.f5256g) == null || method.getParameterTypes().length <= 1) && (!cls2.isEnum() || (n(cls2) instanceof h.h))))))) {
                    }
                }
                zA = false;
                break;
            }
        }
        if (zA && cls.isMemberClass() && !Modifier.isStatic(cls.getModifiers())) {
            zA = false;
        }
        if (!((zA && l.y0(cls)) ? false : zA)) {
            return new o(this, cls, type);
        }
        C0615g c0615gB = C0615g.b(cls, type, this.f4006f);
        try {
            return this.f4008h.v(this, c0615gB);
        } catch (C0424d unused2) {
            return new o(this, c0615gB);
        } catch (NoSuchMethodException unused3) {
            return new o(this, cls, type);
        } catch (Exception e2) {
            throw new C0424d("create asm deserializer error, " + cls.getName(), e2);
        }
    }

    public t k(Type type) {
        Type typeD = AbstractC0421a.d(type);
        if (typeD == null) {
            return (t) this.f4001a.b(type);
        }
        C0614f c0614f = (C0614f) this.f4002b.b(type);
        if (c0614f == null) {
            return null;
        }
        return (t) c0614f.b(typeD);
    }

    public ClassLoader l() {
        return this.f4007g;
    }

    public t m(Class cls, Type type) {
        t tVarJ;
        t xVar;
        Class clsMappingTo;
        Type type2 = type;
        t tVarK = k(type2);
        if (tVarK != null) {
            return tVarK;
        }
        if (type2 == null) {
            type2 = cls;
        }
        t tVarK2 = k(type2);
        if (tVarK2 != null) {
            return tVarK2;
        }
        e.d dVar = (e.d) l.M(cls, e.d.class);
        if (dVar != null && (clsMappingTo = dVar.mappingTo()) != Void.class) {
            return m(clsMappingTo, clsMappingTo);
        }
        if ((type2 instanceof WildcardType) || (type2 instanceof TypeVariable) || (type2 instanceof ParameterizedType)) {
            tVarK2 = k(cls);
        }
        if (tVarK2 != null) {
            return tVarK2;
        }
        Iterator it = this.f4016p.iterator();
        Method methodO = null;
        if (it.hasNext()) {
            android.support.v4.media.a.a(it.next());
            throw null;
        }
        String strReplace = cls.getName().replace('$', '.');
        if (strReplace.startsWith("java.awt.") && C0529i.j(cls) && !f4000z) {
            String[] strArr = {"java.awt.Point", "java.awt.Font", "java.awt.Rectangle", "java.awt.Color"};
            for (int i2 = 0; i2 < 4; i2++) {
                try {
                    String str = strArr[i2];
                    if (str.equals(strReplace)) {
                        Class<?> cls2 = Class.forName(str);
                        C0529i c0529i = C0529i.f4364a;
                        w(cls2, c0529i);
                        return c0529i;
                    }
                } catch (Throwable unused) {
                    f4000z = true;
                }
            }
            tVarK2 = C0529i.f4364a;
        }
        if (!f3990A) {
            try {
                if (strReplace.startsWith("java.time.")) {
                    String[] strArr2 = {"java.time.LocalDateTime", "java.time.LocalDate", "java.time.LocalTime", "java.time.ZonedDateTime", "java.time.OffsetDateTime", "java.time.OffsetTime", "java.time.ZoneOffset", "java.time.ZoneRegion", "java.time.ZoneId", "java.time.Period", "java.time.Duration", "java.time.Instant"};
                    for (int i3 = 0; i3 < 12; i3++) {
                        String str2 = strArr2[i3];
                        if (str2.equals(strReplace)) {
                            Class<?> cls3 = Class.forName(str2);
                            q qVar = q.f4152a;
                            w(cls3, qVar);
                            return qVar;
                        }
                    }
                } else if (strReplace.startsWith("java.util.Optional")) {
                    String[] strArr3 = {"java.util.Optional", "java.util.OptionalDouble", "java.util.OptionalInt", "java.util.OptionalLong"};
                    for (int i4 = 0; i4 < 4; i4++) {
                        String str3 = strArr3[i4];
                        if (str3.equals(strReplace)) {
                            Class<?> cls4 = Class.forName(str3);
                            u uVar = u.f4175a;
                            w(cls4, uVar);
                            return uVar;
                        }
                    }
                }
            } catch (Throwable unused2) {
                f3990A = true;
            }
        }
        if (!f3991B) {
            try {
                if (strReplace.startsWith("org.joda.time.")) {
                    String[] strArr4 = {"org.joda.time.DateTime", "org.joda.time.LocalDate", "org.joda.time.LocalDateTime", "org.joda.time.LocalTime", "org.joda.time.Instant", "org.joda.time.Period", "org.joda.time.Duration", "org.joda.time.DateTimeZone", "org.joda.time.format.DateTimeFormatter"};
                    for (int i5 = 0; i5 < 9; i5++) {
                        String str4 = strArr4[i5];
                        if (str4.equals(strReplace)) {
                            Class<?> cls5 = Class.forName(str4);
                            tVarK2 = C0518K.f4237a;
                            w(cls5, tVarK2);
                            return tVarK2;
                        }
                    }
                }
            } catch (Throwable unused3) {
                f3991B = true;
            }
        }
        if (!f3992C && strReplace.startsWith("com.google.common.collect.")) {
            try {
                String[] strArr5 = {"com.google.common.collect.HashMultimap", "com.google.common.collect.LinkedListMultimap", "com.google.common.collect.LinkedHashMultimap", "com.google.common.collect.ArrayListMultimap", "com.google.common.collect.TreeMultimap"};
                for (int i6 = 0; i6 < 5; i6++) {
                    String str5 = strArr5[i6];
                    if (str5.equals(strReplace)) {
                        Class<?> cls6 = Class.forName(str5);
                        tVarK2 = C0510C.f4217a;
                        w(cls6, tVarK2);
                        return tVarK2;
                    }
                }
            } catch (ClassNotFoundException unused4) {
                f3992C = true;
            }
        }
        if (strReplace.equals("java.nio.ByteBuffer")) {
            tVarK2 = C0535o.f4375a;
            w(cls, tVarK2);
        }
        if (strReplace.equals("java.nio.file.Path")) {
            tVarK2 = Q.f4263b;
            w(cls, tVarK2);
        }
        if (cls == Map.Entry.class) {
            tVarK2 = Q.f4263b;
            w(cls, tVarK2);
        }
        if (strReplace.equals("org.javamoney.moneta.Money")) {
            tVarK2 = C0550a.f4516a;
            w(cls, tVarK2);
        }
        try {
            Iterator it2 = k.a(InterfaceC0502d.class, Thread.currentThread().getContextClassLoader()).iterator();
            if (it2.hasNext()) {
                android.support.v4.media.a.a(it2.next());
                throw null;
            }
        } catch (Exception unused5) {
        }
        if (tVarK2 == null) {
            tVarK2 = k(type2);
        }
        if (tVarK2 != null) {
            return tVarK2;
        }
        if (cls.isEnum()) {
            if (this.f4014n) {
                for (Method method : cls.getMethods()) {
                    if (l.r0(method)) {
                        t tVarJ2 = j(cls, type2);
                        w(type2, tVarJ2);
                        return tVarJ2;
                    }
                }
            }
            Class cls7 = (Class) AbstractC0421a.d(cls);
            e.d dVar2 = (e.d) l.M(cls7 != null ? cls7 : cls, e.d.class);
            if (dVar2 != null) {
                try {
                    t tVar = (t) dVar2.deserializer().newInstance();
                    w(cls, tVar);
                    return tVar;
                } catch (Throwable unused6) {
                }
            }
            if (cls7 != null) {
                Method methodO2 = o(cls7, cls);
                if (methodO2 != null) {
                    try {
                        methodO = cls.getMethod(methodO2.getName(), methodO2.getParameterTypes());
                    } catch (Exception unused7) {
                    }
                }
            } else {
                methodO = o(cls, cls);
            }
            if (methodO != null) {
                h.g gVar = new h.g(methodO);
                w(cls, gVar);
                return gVar;
            }
            tVarJ = p(cls);
        } else if (cls.isArray()) {
            tVarJ = T.f4266a;
        } else if (cls == Set.class || cls == HashSet.class || cls == Collection.class || cls == List.class || cls == ArrayList.class || Collection.class.isAssignableFrom(cls)) {
            tVarJ = C0539t.f4380a;
        } else if (Map.class.isAssignableFrom(cls)) {
            tVarJ = r.f4173a;
        } else {
            if (Throwable.class.isAssignableFrom(cls)) {
                xVar = new C0497B(this, cls);
            } else if (w.class.isAssignableFrom(cls)) {
                xVar = new x(cls);
            } else {
                tVarJ = cls == InetAddress.class ? Q.f4263b : j(cls, type2);
            }
            tVarJ = xVar;
        }
        w(type2, tVarJ);
        return tVarJ;
    }

    public t n(Type type) {
        t tVarK = k(type);
        if (tVarK != null) {
            return tVarK;
        }
        if (type instanceof Class) {
            return m((Class) type, type);
        }
        if (type instanceof ParameterizedType) {
            Type rawType = ((ParameterizedType) type).getRawType();
            return rawType instanceof Class ? m((Class) rawType, type) : n(rawType);
        }
        if (type instanceof WildcardType) {
            Type[] upperBounds = ((WildcardType) type).getUpperBounds();
            if (upperBounds.length == 1) {
                return n(upperBounds[0]);
            }
        }
        return p.f4151a;
    }

    protected t p(Class cls) {
        return new h.h(cls);
    }

    public boolean t() {
        return this.f4014n;
    }

    public void w(Type type, t tVar) {
        Type typeD = AbstractC0421a.d(type);
        if (typeD == null) {
            this.f4001a.c(type, tVar);
            return;
        }
        C0614f c0614f = (C0614f) this.f4002b.b(type);
        if (c0614f == null) {
            c0614f = new C0614f(4);
            this.f4002b.c(type, c0614f);
        }
        c0614f.c(typeD, tVar);
    }

    public void x(boolean z2) {
        this.f4004d = z2;
    }

    public i(boolean z2) {
        this(null, null, z2);
    }

    private i(C0499a c0499a, ClassLoader classLoader, boolean z2) {
        this.f4001a = new C0614f();
        this.f4002b = new C0614f(16);
        this.f4003c = new ConcurrentHashMap(16, 0.75f, 1);
        this.f4004d = !AbstractC0610b.f5242b;
        this.f4005e = new j(4096);
        this.f4009i = f3996v;
        this.f4014n = false;
        this.f4015o = l.f5332b;
        this.f4016p = new ArrayList();
        this.f4018r = f3997w;
        this.f4011k = new long[]{-9164606388214699518L, -8720046426850100497L, -8649961213709896794L, -8165637398350707645L, -8109300701639721088L, -7966123100503199569L, -7921218830998286408L, -7775351613326101303L, -7768608037458185275L, -7766605818834748097L, -6835437086156813536L, -6316154655839304624L, -6179589609550493385L, -6025144546313590215L, -5939269048541779808L, -5885964883385605994L, -5764804792063216819L, -5472097725414717105L, -5194641081268104286L, -5076846148177416215L, -4837536971810737970L, -4703320437989596122L, -4608341446948126581L, -4537258998789938600L, -4438775680185074100L, -4314457471973557243L, -4150995715611818742L, -4082057040235125754L, -3975378478825053783L, -3935185854875733362L, -3319207949486691020L, -3077205613010077203L, -3053747177772160511L, -2995060141064716555L, -2825378362173150292L, -2533039401923731906L, -2439930098895578154L, -2378990704010641148L, -2364987994247679115L, -2262244760619952081L, -2192804397019347313L, -2095516571388852610L, -1872417015366588117L, -1650485814983027158L, -1589194880214235129L, -965955008570215305L, -905177026366752536L, -831789045734283466L, -582813228520337988L, -254670111376247151L, -219577392946377768L, -190281065685395680L, -26639035867733124L, -9822483067882491L, 4750336058574309L, 33238344207745342L, 156405680656087946L, 218512992947536312L, 313864100207897507L, 386461436234701831L, 823641066473609950L, 1073634739308289776L, 1153291637701043748L, 1203232727967308606L, 1214780596910349029L, 1459860845934817624L, 1502845958873959152L, 1534439610567445754L, 1698504441317515818L, 1818089308493370394L, 2078113382421334967L, 2164696723069287854L, 2622551729063269307L, 2653453629929770569L, 2660670623866180977L, 2731823439467737506L, 2836431254737891113L, 2930861374593775110L, 3085473968517218653L, 3089451460101527857L, 3114862868117605599L, 3129395579983849527L, 3256258368248066264L, 3452379460455804429L, 3547627781654598988L, 3637939656440441093L, 3688179072722109200L, 3718352661124136681L, 3730752432285826863L, 3794316665763266033L, 4000049462512838776L, 4046190361520671643L, 4147696707147271408L, 4193204392725694463L, 4241163808635564644L, 4254584350247334433L, 4814658433570175913L, 4841947709850912914L, 4904007817188630457L, 5100336081510080343L, 5274044858141538265L, 5347909877633654828L, 5450448828334921485L, 5474268165959054640L, 5545425291794704408L, 5596129856135573697L, 5688200883751798389L, 5751393439502795295L, 5944107969236155580L, 6007332606592876737L, 6280357960959217660L, 6456855723474196908L, 6511035576063254270L, 6534946468240507089L, 6584624952928234050L, 6734240326434096246L, 6742705432718011780L, 6854854816081053523L, 7045245923763966215L, 7123326897294507060L, 7179336928365889465L, 7240293012336844478L, 7347653049056829645L, 7375862386996623731L, 7442624256860549330L, 7617522210483516279L, 7658177784286215602L, 8055461369741094911L, 8389032537095247355L, 8409640769019589119L, 8488266005336625107L, 8537233257283452655L, 8838294710098435315L, 9140390920032557669L, 9140416208800006522L};
        long[] jArr = new long[f3995u.length];
        int i2 = 0;
        while (true) {
            String[] strArr = f3995u;
            if (i2 >= strArr.length) {
                break;
            }
            jArr[i2] = l.I(strArr[i2]);
            i2++;
        }
        Arrays.sort(jArr);
        this.f4012l = jArr;
        this.f4013m = z2;
        if (c0499a == null && !AbstractC0610b.f5242b) {
            try {
                if (classLoader == null) {
                    c0499a = new C0499a(new C0609a());
                } else {
                    c0499a = new C0499a(classLoader);
                }
            } catch (ExceptionInInitializerError | NoClassDefFoundError | AccessControlException unused) {
            }
        }
        this.f4008h = c0499a;
        if (c0499a == null) {
            this.f4004d = false;
        }
        s();
        e(f3994t);
        f(f3993s);
        d(f3995u);
    }
}
