92 lines
3.3 KiB
Java
92 lines
3.3 KiB
Java
package o;
|
|
|
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
|
import com.google.firebase.ml.vision.text.FirebaseVisionText;
|
|
import io.beid.beidk.ui.camera.GraphicOverlay;
|
|
import java.text.DateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.HashMap;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Pattern;
|
|
|
|
/* renamed from: o.fQZ, reason: case insensitive filesystem */
|
|
/* loaded from: classes5.dex */
|
|
public final class C13086fQZ implements fQU<FirebaseVisionText> {
|
|
private final DateFormat a = new SimpleDateFormat("yyMMdd");
|
|
private Map<Character, Integer> b;
|
|
public InterfaceC13081fQA c;
|
|
private GraphicOverlay<Object> e;
|
|
|
|
public C13086fQZ(GraphicOverlay<Object> graphicOverlay) {
|
|
this.e = graphicOverlay;
|
|
HashMap hashMap = new HashMap();
|
|
this.b = hashMap;
|
|
Integer num = 0;
|
|
hashMap.put(Character.valueOf(UrlTreeKt.configurablePathSegmentPrefixChar), num);
|
|
while (num.intValue() < 10) {
|
|
this.b.put(Character.valueOf(num.toString().toCharArray()[0]), num);
|
|
num = Integer.valueOf(num.intValue() + 1);
|
|
}
|
|
for (Integer num2 = 10; num2.intValue() < 36; num2 = Integer.valueOf(num2.intValue() + 1)) {
|
|
this.b.put(Character.valueOf((char) (num2.intValue() + 55)), num2);
|
|
}
|
|
}
|
|
|
|
private boolean a(String str, int i) {
|
|
int i2 = 0;
|
|
int i3 = 0;
|
|
while (true) {
|
|
int i4 = 1;
|
|
if (i2 >= str.length()) {
|
|
break;
|
|
}
|
|
char charAt = str.charAt(i2);
|
|
i2++;
|
|
int i5 = i2 % 3;
|
|
if (i5 != 0) {
|
|
i4 = i5 != 1 ? i5 != 2 ? 0 : 3 : 7;
|
|
}
|
|
i3 += i4 * this.b.get(Character.valueOf(charAt)).intValue();
|
|
}
|
|
return i3 % 10 == i;
|
|
}
|
|
|
|
@Override // o.fQU
|
|
public final void b() {
|
|
GraphicOverlay<Object> graphicOverlay = this.e;
|
|
synchronized (graphicOverlay.b) {
|
|
graphicOverlay.d.clear();
|
|
}
|
|
graphicOverlay.postInvalidate();
|
|
}
|
|
|
|
@Override // o.fQU
|
|
public final void d(List<FirebaseVisionText> list) {
|
|
Iterator<FirebaseVisionText> it = list.iterator();
|
|
while (it.hasNext()) {
|
|
Iterator<FirebaseVisionText.TextBlock> it2 = it.next().getTextBlocks().iterator();
|
|
while (it2.hasNext()) {
|
|
Matcher matcher = Pattern.compile("([\\w\\d<]{9})(\\d)([\\w<]{3})(\\d{6})(\\d)([FM])(\\d{6})(\\d)").matcher(it2.next().getText().trim().replaceAll(" ", ""));
|
|
while (matcher.find()) {
|
|
String group = matcher.group(1);
|
|
int parseInt = Integer.parseInt(matcher.group(2));
|
|
String group2 = matcher.group(4);
|
|
int parseInt2 = Integer.parseInt(matcher.group(5));
|
|
String group3 = matcher.group(7);
|
|
int parseInt3 = Integer.parseInt(matcher.group(8));
|
|
try {
|
|
if (a(group, parseInt) && a(group2, parseInt2) && a(group3, parseInt3)) {
|
|
this.c.e(group, group2, group3);
|
|
b();
|
|
}
|
|
} catch (Exception unused) {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|