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

import com.bytedance.covode.number.Covode;
import com.google.gson.c.a;
import com.google.gson.c.b;
import com.google.gson.c.c;
import com.google.gson.s;
import com.google.gson.u;

public class ReplaceLineEndAdapter extends u<String> {
    static {
        Covode.recordClassIndex(122062);
    }

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

        /* JADX WARNING: Failed to process nested try/catch */
        /* JADX WARNING: Missing exception handler attribute for start block: B:3:0x0018 */
        static {
            /*
                r0 = 122063(0x1dccf, float:1.71047E-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.NULL     // 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.STRING     // Catch:{ NoSuchFieldError -> 0x0023 }
                int r1 = r0.ordinal()     // Catch:{ NoSuchFieldError -> 0x0023 }
                r0 = 2
                r2[r1] = r0     // Catch:{ NoSuchFieldError -> 0x0023 }
            L_0x0023:
                return
            */
            throw new UnsupportedOperationException("Method not decompiled: com.ss.android.ugc.aweme.utils.ReplaceLineEndAdapter.AnonymousClass1.<clinit>():void");
        }
    }

    /* JADX WARNING: type inference failed for: r2v0, types: [java.lang.Throwable, com.google.gson.s] */
    public /* synthetic */ Object read(a aVar) {
        b LJFF = aVar.LJFF();
        int i = AnonymousClass1.LIZ[LJFF.ordinal()];
        if (i == 1) {
            aVar.LJIIJ();
            return null;
        } else if (i == 2) {
            String LJIIIIZZ = aVar.LJIIIIZZ();
            if (LJIIIIZZ.contains("\r\n")) {
                return LJIIIIZZ.replaceAll("\r\n", "\n");
            }
            return LJIIIIZZ;
        } else {
            throw new s("expect STRING, but got " + LJFF.name() + " at " + aVar.LJIILL());
        }
    }

    public /* synthetic */ void write(c cVar, Object obj) {
        cVar.LIZIZ((String) obj);
    }
}
