what-the-bank/sources/com/facetec/sdk/fh.java

76 lines
2.1 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.facetec.sdk;
import java.io.IOException;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.util.ArrayList;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
/* loaded from: classes.dex */
public final class fh extends ek<Date> {
public static final en a = new en() { // from class: com.facetec.sdk.fh.2
@Override // com.facetec.sdk.en
public final <T> ek<T> e(dx dxVar, fv<T> fvVar) {
if (fvVar.a() == Date.class) {
return new fh();
}
return null;
}
};
private final List<DateFormat> e;
public fh() {
ArrayList arrayList = new ArrayList();
this.e = arrayList;
arrayList.add(DateFormat.getDateTimeInstance(2, 2, Locale.US));
if (!Locale.getDefault().equals(Locale.US)) {
arrayList.add(DateFormat.getDateTimeInstance(2, 2));
}
if (ew.b()) {
arrayList.add(fa.e(2, 2));
}
}
private Date d(String str) {
synchronized (this) {
Iterator<DateFormat> it = this.e.iterator();
while (it.hasNext()) {
try {
return it.next().parse(str);
} catch (ParseException unused) {
}
}
try {
return fp.a(str, new ParsePosition(0));
} catch (ParseException e) {
throw new ei(str, e);
}
}
}
/* JADX INFO: Access modifiers changed from: private */
@Override // com.facetec.sdk.ek
public void b(ga gaVar, Date date) throws IOException {
synchronized (this) {
if (date == null) {
gaVar.h();
} else {
gaVar.b(this.e.get(0).format(date));
}
}
}
@Override // com.facetec.sdk.ek
public final /* synthetic */ Date a(fu fuVar) throws IOException {
if (fuVar.i() == gc.NULL) {
fuVar.l();
return null;
}
return d(fuVar.h());
}
}