what-the-bank/sources/o/mPf.java

57 lines
1.9 KiB
Java

package o;
import com.google.zxing.FormatException;
import java.util.Collection;
import java.util.Collections;
/* loaded from: classes2.dex */
public final class mPf extends AbstractC10489eFp {
@Override // o.Ggl
protected final Collection<PTS> b() {
return Collections.singleton(PTS.EAN_13);
}
@Override // o.Ggl
public final boolean[] d(String str) {
int length = str.length();
if (length == 12) {
try {
int a = rua.a(str);
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(a);
str = sb.toString();
} catch (FormatException e) {
throw new IllegalArgumentException(e);
}
} else if (length == 13) {
try {
if (!rua.c(str)) {
throw new IllegalArgumentException("Contents do not pass checksum");
}
} catch (FormatException unused) {
throw new IllegalArgumentException("Illegal contents");
}
} else {
throw new IllegalArgumentException("Requested contents should be 12 or 13 digits long, but got ".concat(String.valueOf(length)));
}
a(str);
int i = pNh.a[Character.digit(str.charAt(0), 10)];
boolean[] zArr = new boolean[95];
int b = b(zArr, 0, rua.i, true);
for (int i2 = 1; i2 <= 6; i2++) {
int digit = Character.digit(str.charAt(i2), 10);
if (((i >> (6 - i2)) & 1) == 1) {
digit += 10;
}
b += b(zArr, b, rua.d[digit], false);
}
int b2 = b + b(zArr, b, rua.e, false);
for (int i3 = 7; i3 <= 12; i3++) {
b2 += b(zArr, b2, rua.c[Character.digit(str.charAt(i3), 10)], true);
}
b(zArr, b2, rua.i, true);
return zArr;
}
}