what-the-bank/sources/o/KLD.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 KLD extends AbstractC10489eFp {
@Override // o.Ggl
protected final Collection<PTS> b() {
return Collections.singleton(PTS.UPC_E);
}
@Override // o.Ggl
public final boolean[] d(String str) {
int length = str.length();
if (length == 7) {
try {
int a = rua.a(eAT.d(str));
StringBuilder sb = new StringBuilder();
sb.append(str);
sb.append(a);
str = sb.toString();
} catch (FormatException e) {
throw new IllegalArgumentException(e);
}
} else if (length == 8) {
try {
if (!rua.c(eAT.d(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 7 or 8 digits long, but got ".concat(String.valueOf(length)));
}
a(str);
int digit = Character.digit(str.charAt(0), 10);
if (digit != 0 && digit != 1) {
throw new IllegalArgumentException("Number system must be 0 or 1");
}
int i = eAT.a[digit][Character.digit(str.charAt(7), 10)];
boolean[] zArr = new boolean[51];
int b = b(zArr, 0, rua.i, true);
for (int i2 = 1; i2 <= 6; i2++) {
int digit2 = Character.digit(str.charAt(i2), 10);
if (((i >> (6 - i2)) & 1) == 1) {
digit2 += 10;
}
b += b(zArr, b, rua.d[digit2], false);
}
b(zArr, b, rua.b, false);
return zArr;
}
}