package com.facetec.sdk; import java.io.IOException; import java.util.ArrayList; /* loaded from: classes.dex */ public final class fm extends ek { public static final en a = new en() { // from class: com.facetec.sdk.fm.2 @Override // com.facetec.sdk.en public final ek e(dx dxVar, fv fvVar) { if (fvVar.a() == Object.class) { return new fm(dxVar); } return null; } }; private final dx b; fm(dx dxVar) { this.b = dxVar; } /* renamed from: com.facetec.sdk.fm$4, reason: invalid class name */ /* loaded from: classes.dex */ static final /* synthetic */ class AnonymousClass4 { static final int[] b; static { int[] iArr = new int[gc.values().length]; b = iArr; try { iArr[gc.BEGIN_ARRAY.ordinal()] = 1; } catch (NoSuchFieldError unused) { } try { b[gc.BEGIN_OBJECT.ordinal()] = 2; } catch (NoSuchFieldError unused2) { } try { b[gc.STRING.ordinal()] = 3; } catch (NoSuchFieldError unused3) { } try { b[gc.NUMBER.ordinal()] = 4; } catch (NoSuchFieldError unused4) { } try { b[gc.BOOLEAN.ordinal()] = 5; } catch (NoSuchFieldError unused5) { } try { b[gc.NULL.ordinal()] = 6; } catch (NoSuchFieldError unused6) { } } } @Override // com.facetec.sdk.ek public final Object a(fu fuVar) throws IOException { switch (AnonymousClass4.b[fuVar.i().ordinal()]) { case 1: ArrayList arrayList = new ArrayList(); fuVar.a(); while (fuVar.e()) { arrayList.add(a(fuVar)); } fuVar.c(); return arrayList; case 2: ey eyVar = new ey(); fuVar.d(); while (fuVar.e()) { eyVar.put(fuVar.f(), a(fuVar)); } fuVar.b(); return eyVar; case 3: return fuVar.h(); case 4: return Double.valueOf(fuVar.o()); case 5: return Boolean.valueOf(fuVar.g()); case 6: fuVar.l(); return null; default: throw new IllegalStateException(); } } @Override // com.facetec.sdk.ek public final void b(ga gaVar, Object obj) throws IOException { if (obj == null) { gaVar.h(); return; } ek b = this.b.b((Class) obj.getClass()); if (b instanceof fm) { gaVar.d(); gaVar.a(); } else { b.b(gaVar, obj); } } }