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; import org.bouncycastle.crypto.tls.CipherSuite; /* loaded from: classes.dex */ public final class iId extends TypeAdapter implements HJa { private PYE a; private Gson b; private InterfaceC15734iCu d; public iId(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; } tBi tbi = (tBi) obj; Gson gson = this.b; PYE pye = this.a; jsonWriter.beginObject(); if (tbi != tbi.b) { pye.c(jsonWriter, CipherSuite.TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256); Object obj2 = tbi.b; DTh.b(gson, Object.class, obj2).write(jsonWriter, obj2); } tbi.d(gson, jsonWriter, pye); 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; } tBi tbi = new tBi(); 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 != 479) { tbi.a(gson, jsonReader, e); } else if (z) { tbi.b = gson.getAdapter(Object.class).read2(jsonReader); } else { tbi.b = null; jsonReader.nextNull(); } } jsonReader.endObject(); return tbi; } }