discord-jadx/app/src/main/java/c/i/e/q/n.java

136 lines
5.8 KiB
Java

package c.i.e.q;
import c.i.e.j;
import c.i.e.k;
import c.i.e.n.a;
import com.google.zxing.NotFoundException;
import com.google.zxing.Result;
import java.util.EnumMap;
/* compiled from: UPCEANExtension5Support */
public final class n {
public static final int[] a = {24, 20, 18, 17, 12, 6, 3, 10, 9, 5};
public final int[] b = new int[4];
/* renamed from: c reason: collision with root package name */
public final StringBuilder f1422c = new StringBuilder();
/* JADX WARNING: Removed duplicated region for block: B:60:0x0121 */
/* JADX WARNING: Removed duplicated region for block: B:63:0x0153 */
public Result a(int i, a aVar, int[] iArr) throws NotFoundException {
EnumMap enumMap;
String str;
String str2;
StringBuilder sb = this.f1422c;
sb.setLength(0);
int[] iArr2 = this.b;
iArr2[0] = 0;
iArr2[1] = 0;
iArr2[2] = 0;
iArr2[3] = 0;
int i2 = aVar.j;
int i3 = iArr[1];
int i4 = 0;
for (int i5 = 0; i5 < 5 && i3 < i2; i5++) {
int h = p.h(aVar, iArr2, i3, p.d);
sb.append((char) ((h % 10) + 48));
for (int i6 : iArr2) {
i3 += i6;
}
if (h >= 10) {
i4 |= 1 << (4 - i5);
}
if (i5 != 4) {
i3 = aVar.g(aVar.f(i3));
}
}
if (sb.length() == 5) {
for (int i7 = 0; i7 < 10; i7++) {
if (i4 == a[i7]) {
String sb2 = sb.toString();
int length = sb2.length();
int i8 = 0;
for (int i9 = length - 2; i9 >= 0; i9 -= 2) {
i8 += sb2.charAt(i9) - '0';
}
int i10 = i8 * 3;
char c2 = 65535;
for (int i11 = length - 1; i11 >= 0; i11 -= 2) {
i10 += sb2.charAt(i11) - '0';
}
if ((i10 * 3) % 10 == i7) {
String sb3 = sb.toString();
if (sb3.length() == 5) {
char charAt = sb3.charAt(0);
if (charAt == '0') {
str2 = "£";
} else if (charAt != '5') {
if (charAt == '9') {
switch (sb3.hashCode()) {
case 54118329:
if (sb3.equals("90000")) {
c2 = 0;
break;
}
break;
case 54395376:
if (sb3.equals("99990")) {
c2 = 1;
break;
}
break;
case 54395377:
if (sb3.equals("99991")) {
c2 = 2;
break;
}
break;
}
switch (c2) {
case 0:
str = null;
break;
case 1:
str = "Used";
break;
case 2:
str = "0.00";
break;
}
if (str != null) {
enumMap = new EnumMap(j.class);
enumMap.put((EnumMap) j.SUGGESTED_PRICE, (j) str);
float f = (float) i;
Result result = new Result(sb3, null, new k[]{new k(((float) (iArr[0] + iArr[1])) / 2.0f, f), new k((float) i3, f)}, c.i.e.a.UPC_EAN_EXTENSION);
if (enumMap != null) {
result.a(enumMap);
}
return result;
}
}
str2 = "";
} else {
str2 = "$";
}
int parseInt = Integer.parseInt(sb3.substring(1));
String valueOf = String.valueOf(parseInt / 100);
int i12 = parseInt % 100;
str = str2 + valueOf + '.' + (i12 < 10 ? "0".concat(String.valueOf(i12)) : String.valueOf(i12));
if (str != null) {
}
}
enumMap = null;
float f = (float) i;
Result result = new Result(sb3, null, new k[]{new k(((float) (iArr[0] + iArr[1])) / 2.0f, f), new k((float) i3, f)}, c.i.e.a.UPC_EAN_EXTENSION);
if (enumMap != null) {
}
return result;
}
throw NotFoundException.k;
}
}
throw NotFoundException.k;
}
throw NotFoundException.k;
}
}