package o; import com.google.gson.Gson; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; import java.io.IOException; /* loaded from: classes.dex */ public final class MD extends TypeAdapter implements HJa { private PYE a; private Gson b; private InterfaceC15734iCu d; public MD(Gson gson, InterfaceC15734iCu interfaceC15734iCu, PYE pye) { this.b = gson; this.d = interfaceC15734iCu; this.a = pye; } @Override // com.google.gson.TypeAdapter public final void write(JsonWriter jsonWriter, Object obj) throws IOException { if (obj == null) { jsonWriter.nullValue(); return; } MB mb = (MB) obj; Gson gson = this.b; PYE pye = this.a; jsonWriter.beginObject(); if (mb != mb.c) { pye.c(jsonWriter, 228); String str = mb.c; DTh.b(gson, String.class, str).write(jsonWriter, str); } if (mb != mb.d) { pye.c(jsonWriter, 433); String str2 = mb.d; DTh.b(gson, String.class, str2).write(jsonWriter, str2); } jsonWriter.endObject(); } @Override // com.google.gson.TypeAdapter /* renamed from: read */ public final Object read2(JsonReader jsonReader) throws IOException { if (jsonReader.peek() == JsonToken.NULL) { jsonReader.skipValue(); return null; } MB mb = new MB(); Gson gson = this.b; InterfaceC15734iCu interfaceC15734iCu = this.d; jsonReader.beginObject(); while (jsonReader.hasNext()) { int e = interfaceC15734iCu.e(jsonReader); boolean z = jsonReader.peek() != JsonToken.NULL; if (e != 515) { if (e != 679) { jsonReader.skipValue(); } else if (z) { mb.c = (String) gson.getAdapter(String.class).read2(jsonReader); } else { mb.c = null; jsonReader.nextNull(); } } else if (z) { mb.d = (String) gson.getAdapter(String.class).read2(jsonReader); } else { mb.d = null; jsonReader.nextNull(); } } jsonReader.endObject(); return mb; } }