package defpackage;

import ed.z;
import hb.a;
import io.flutter.plugins.sharedpreferences.StringListLookupResultType;
import io.flutter.plugins.sharedpreferences.j;
import io.flutter.plugins.sharedpreferences.v;
import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;
import java.util.List;
import nb.g;

/* JADX INFO: loaded from: classes.dex */
public final class h extends z {

    /* JADX INFO: renamed from: d, reason: collision with root package name */
    public final /* synthetic */ int f26349d;

    @Override // ed.z
    public final Object readValueOfType(byte b10, ByteBuffer byteBuffer) {
        switch (this.f26349d) {
            case 0:
                g.i(byteBuffer, "buffer");
                if (b10 == -127) {
                    Object value = readValue(byteBuffer);
                    List list = value instanceof List ? (List) value : null;
                    if (list != null) {
                    }
                } else if (b10 == -126) {
                    Object value2 = readValue(byteBuffer);
                    List list2 = value2 instanceof List ? (List) value2 : null;
                    if (list2 != null) {
                    }
                }
                break;
            default:
                g.i(byteBuffer, "buffer");
                if (b10 == -127) {
                    Long l10 = (Long) readValue(byteBuffer);
                    if (l10 != null) {
                        int iLongValue = (int) l10.longValue();
                        StringListLookupResultType.f28274a.getClass();
                        StringListLookupResultType[] stringListLookupResultTypeArrValues = StringListLookupResultType.values();
                        int length = stringListLookupResultTypeArrValues.length;
                        for (int i10 = 0; i10 < length; i10++) {
                            StringListLookupResultType stringListLookupResultType = stringListLookupResultTypeArrValues[i10];
                            if (stringListLookupResultType.getRaw() == iLongValue) {
                            }
                        }
                    }
                } else if (b10 == -126) {
                    Object value3 = readValue(byteBuffer);
                    List list3 = value3 instanceof List ? (List) value3 : null;
                    if (list3 != null) {
                        String str = (String) list3.get(0);
                        Object obj = list3.get(1);
                        g.g(obj, "null cannot be cast to non-null type kotlin.Boolean");
                    }
                } else if (b10 == -125) {
                    Object value4 = readValue(byteBuffer);
                    List list4 = value4 instanceof List ? (List) value4 : null;
                    if (list4 != null) {
                        String str2 = (String) list4.get(0);
                        Object obj2 = list4.get(1);
                        g.g(obj2, "null cannot be cast to non-null type io.flutter.plugins.sharedpreferences.StringListLookupResultType");
                    }
                }
                break;
        }
        return super.readValueOfType(b10, byteBuffer);
    }

    @Override // ed.z
    public final void writeValue(ByteArrayOutputStream byteArrayOutputStream, Object obj) {
        switch (this.f26349d) {
            case 0:
                g.i(byteArrayOutputStream, "stream");
                if (obj instanceof b) {
                    byteArrayOutputStream.write(129);
                    writeValue(byteArrayOutputStream, a.l0(((b) obj).f4696a));
                } else if (!(obj instanceof a)) {
                    super.writeValue(byteArrayOutputStream, obj);
                } else {
                    byteArrayOutputStream.write(130);
                    writeValue(byteArrayOutputStream, a.l0(((a) obj).f2a));
                }
                break;
            default:
                g.i(byteArrayOutputStream, "stream");
                if (obj instanceof StringListLookupResultType) {
                    byteArrayOutputStream.write(129);
                    writeValue(byteArrayOutputStream, Integer.valueOf(((StringListLookupResultType) obj).getRaw()));
                } else if (obj instanceof j) {
                    byteArrayOutputStream.write(130);
                    j jVar = (j) obj;
                    writeValue(byteArrayOutputStream, a.m0(jVar.f28291a, Boolean.valueOf(jVar.f28292b)));
                } else if (!(obj instanceof v)) {
                    super.writeValue(byteArrayOutputStream, obj);
                } else {
                    byteArrayOutputStream.write(131);
                    v vVar = (v) obj;
                    writeValue(byteArrayOutputStream, a.m0(vVar.f28316a, vVar.f28317b));
                }
                break;
        }
    }
}
