package com.ss.android.ugc.aweme.ecommercebase.utils;

import com.bytedance.covode.number.Covode;
import com.google.gson.Gson;
import com.google.gson.c.a;
import com.google.gson.c.c;
import com.google.gson.u;
import java.util.ArrayList;
import java.util.HashMap;

public final class FixedTypeAdapter extends u<Object> {
    public final u<Object> LIZ = new Gson().LIZ(Object.class);

    static {
        Covode.recordClassIndex(73064);
    }

    /* renamed from: com.ss.android.ugc.aweme.ecommercebase.utils.FixedTypeAdapter$1  reason: invalid class name */
    public static /* synthetic */ class AnonymousClass1 {
        public static final /* synthetic */ int[] LIZ;

        /* JADX WARNING: Can't wrap try/catch for region: R(14:0|1|2|3|4|5|6|7|8|9|10|11|12|14) */
        /* JADX WARNING: Code restructure failed: missing block: B:15:?, code lost:
            return;
         */
        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Missing exception handler attribute for start block: B:11:0x0044 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0018 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:5:0x0023 */
        /* JADX WARNING: Missing exception handler attribute for start block: B:7:0x002e */
        /* JADX WARNING: Missing exception handler attribute for start block: B:9:0x0039 */
        static {
            /*
                r0 = 73065(0x11d69, float:1.02386E-40)
                com.bytedance.covode.number.Covode.recordClassIndex(r0)
                com.google.gson.c.b[] r0 = com.google.gson.c.b.values()
                int r0 = r0.length
                int[] r2 = new int[r0]
                LIZ = r2
                com.google.gson.c.b r0 = com.google.gson.c.b.BEGIN_OBJECT     // Catch:{ NoSuchFieldError -> 0x0018 }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x0018 }
                r0 = 1
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x0018 }
            L_0x0018:
                int[] r2 = LIZ     // Catch:{ NoSuchFieldError -> 0x0023 }
                com.google.gson.c.b r0 = com.google.gson.c.b.BEGIN_ARRAY     // Catch:{ NoSuchFieldError -> 0x0023 }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x0023 }
                r0 = 2
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x0023 }
            L_0x0023:
                int[] r2 = LIZ     // Catch:{ NoSuchFieldError -> 0x002e }
                com.google.gson.c.b r0 = com.google.gson.c.b.NUMBER     // Catch:{ NoSuchFieldError -> 0x002e }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x002e }
                r0 = 3
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x002e }
            L_0x002e:
                int[] r2 = LIZ     // Catch:{ NoSuchFieldError -> 0x0039 }
                com.google.gson.c.b r0 = com.google.gson.c.b.STRING     // Catch:{ NoSuchFieldError -> 0x0039 }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x0039 }
                r0 = 4
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x0039 }
            L_0x0039:
                int[] r2 = LIZ     // Catch:{ NoSuchFieldError -> 0x0044 }
                com.google.gson.c.b r0 = com.google.gson.c.b.BOOLEAN     // Catch:{ NoSuchFieldError -> 0x0044 }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x0044 }
                r0 = 5
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x0044 }
            L_0x0044:
                int[] r2 = LIZ     // Catch:{ NoSuchFieldError -> 0x004f }
                com.google.gson.c.b r0 = com.google.gson.c.b.NULL     // Catch:{ NoSuchFieldError -> 0x004f }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x004f }
                r0 = 6
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x004f }
            L_0x004f:
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.ecommercebase.utils.FixedTypeAdapter.AnonymousClass1.<clinit>():void");
        }
    }

    public final Object read(a aVar) {
        switch (AnonymousClass1.LIZ[aVar.LJFF().ordinal()]) {
            case 1:
                HashMap hashMap = new HashMap();
                aVar.LIZJ();
                while (aVar.LJ()) {
                    hashMap.put(aVar.LJII(), read(aVar));
                }
                aVar.LIZLLL();
                return hashMap;
            case 2:
                ArrayList arrayList = new ArrayList();
                aVar.LIZ();
                while (aVar.LJ()) {
                    arrayList.add(read(aVar));
                }
                aVar.LIZIZ();
                return arrayList;
            case 3:
                String LJIIIIZZ = aVar.LJIIIIZZ();
                if (LJIIIIZZ.indexOf(46) != -1) {
                    return Double.valueOf(Double.parseDouble(LJIIIIZZ));
                }
                return Long.valueOf(Long.parseLong(LJIIIIZZ));
            case 4:
                return aVar.LJIIIIZZ();
            case 5:
                return Boolean.valueOf(aVar.LJIIIZ());
            case 6:
                aVar.LJIIJ();
                return null;
            default:
                throw new IllegalStateException();
        }
    }

    public final void write(c cVar, Object obj) {
        this.LIZ.write(cVar, obj);
    }
}
