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

52 lines
1.7 KiB
Java

package o;
import com.google.zxing.FormatException;
import java.util.Collection;
import java.util.Collections;
/* loaded from: classes2.dex */
public final class xVd extends AbstractC10489eFp {
@Override // o.Ggl
protected final Collection<PTS> b() {
return Collections.singleton(PTS.EAN_8);
}
@Override // o.Ggl
public final boolean[] d(String str) {
int length = str.length();
if (length == 7) {
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 == 8) {
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 7 or 8 digits long, but got ".concat(String.valueOf(length)));
}
a(str);
boolean[] zArr = new boolean[67];
int b = b(zArr, 0, rua.i, true);
for (int i = 0; i <= 3; i++) {
b += b(zArr, b, rua.c[Character.digit(str.charAt(i), 10)], false);
}
int b2 = b + b(zArr, b, rua.e, false);
for (int i2 = 4; i2 <= 7; i2++) {
b2 += b(zArr, b2, rua.c[Character.digit(str.charAt(i2), 10)], true);
}
b(zArr, b2, rua.i, true);
return zArr;
}
}