Initial commit
This commit is contained in:
38
sources/com/google/zxing/pdf417/decoder/BarcodeMetadata.java
Normal file
38
sources/com/google/zxing/pdf417/decoder/BarcodeMetadata.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class BarcodeMetadata {
|
||||
private final int a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
private final int d;
|
||||
private final int e;
|
||||
|
||||
BarcodeMetadata(int i, int i2, int i3, int i4) {
|
||||
this.a = i;
|
||||
this.b = i4;
|
||||
this.c = i2;
|
||||
this.d = i3;
|
||||
this.e = i2 + i3;
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
int b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
int d() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
int e() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
37
sources/com/google/zxing/pdf417/decoder/BarcodeValue.java
Normal file
37
sources/com/google/zxing/pdf417/decoder/BarcodeValue.java
Normal file
@@ -0,0 +1,37 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import com.google.zxing.pdf417.PDF417Common;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class BarcodeValue {
|
||||
private final Map<Integer, Integer> a = new HashMap();
|
||||
|
||||
BarcodeValue() {
|
||||
}
|
||||
|
||||
void a(int i) {
|
||||
Integer num = this.a.get(Integer.valueOf(i));
|
||||
if (num == null) {
|
||||
num = 0;
|
||||
}
|
||||
this.a.put(Integer.valueOf(i), Integer.valueOf(num.intValue() + 1));
|
||||
}
|
||||
|
||||
int[] a() {
|
||||
ArrayList arrayList = new ArrayList();
|
||||
int i = -1;
|
||||
for (Map.Entry<Integer, Integer> entry : this.a.entrySet()) {
|
||||
if (entry.getValue().intValue() > i) {
|
||||
i = entry.getValue().intValue();
|
||||
arrayList.clear();
|
||||
arrayList.add(entry.getKey());
|
||||
} else if (entry.getValue().intValue() == i) {
|
||||
arrayList.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
return PDF417Common.a(arrayList);
|
||||
}
|
||||
}
|
174
sources/com/google/zxing/pdf417/decoder/BoundingBox.java
Normal file
174
sources/com/google/zxing/pdf417/decoder/BoundingBox.java
Normal file
@@ -0,0 +1,174 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class BoundingBox {
|
||||
private final BitMatrix a;
|
||||
private final ResultPoint b;
|
||||
private final ResultPoint c;
|
||||
private final ResultPoint d;
|
||||
private final ResultPoint e;
|
||||
private final int f;
|
||||
private final int g;
|
||||
private final int h;
|
||||
private final int i;
|
||||
|
||||
BoundingBox(BitMatrix bitMatrix, ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3, ResultPoint resultPoint4) throws NotFoundException {
|
||||
boolean z = resultPoint == null || resultPoint2 == null;
|
||||
boolean z2 = resultPoint3 == null || resultPoint4 == null;
|
||||
if (z && z2) {
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
if (z) {
|
||||
resultPoint = new ResultPoint(0.0f, resultPoint3.b());
|
||||
resultPoint2 = new ResultPoint(0.0f, resultPoint4.b());
|
||||
} else if (z2) {
|
||||
resultPoint3 = new ResultPoint(bitMatrix.k() - 1, resultPoint.b());
|
||||
resultPoint4 = new ResultPoint(bitMatrix.k() - 1, resultPoint2.b());
|
||||
}
|
||||
this.a = bitMatrix;
|
||||
this.b = resultPoint;
|
||||
this.c = resultPoint2;
|
||||
this.d = resultPoint3;
|
||||
this.e = resultPoint4;
|
||||
this.f = (int) Math.min(resultPoint.a(), resultPoint2.a());
|
||||
this.g = (int) Math.max(resultPoint3.a(), resultPoint4.a());
|
||||
this.h = (int) Math.min(resultPoint.b(), resultPoint3.b());
|
||||
this.i = (int) Math.max(resultPoint2.b(), resultPoint4.b());
|
||||
}
|
||||
|
||||
static BoundingBox a(BoundingBox boundingBox, BoundingBox boundingBox2) throws NotFoundException {
|
||||
return boundingBox == null ? boundingBox2 : boundingBox2 == null ? boundingBox : new BoundingBox(boundingBox.a, boundingBox.b, boundingBox.c, boundingBox2.d, boundingBox2.e);
|
||||
}
|
||||
|
||||
ResultPoint b() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.g;
|
||||
}
|
||||
|
||||
int d() {
|
||||
return this.i;
|
||||
}
|
||||
|
||||
int e() {
|
||||
return this.f;
|
||||
}
|
||||
|
||||
int f() {
|
||||
return this.h;
|
||||
}
|
||||
|
||||
ResultPoint g() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
ResultPoint h() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:13:0x002d */
|
||||
/* JADX WARN: Removed duplicated region for block: B:27:0x005b */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
com.google.zxing.pdf417.decoder.BoundingBox a(int r13, int r14, boolean r15) throws com.google.zxing.NotFoundException {
|
||||
/*
|
||||
r12 = this;
|
||||
com.google.zxing.ResultPoint r0 = r12.b
|
||||
com.google.zxing.ResultPoint r1 = r12.c
|
||||
com.google.zxing.ResultPoint r2 = r12.d
|
||||
com.google.zxing.ResultPoint r3 = r12.e
|
||||
if (r13 <= 0) goto L29
|
||||
if (r15 == 0) goto Le
|
||||
r4 = r0
|
||||
goto Lf
|
||||
Le:
|
||||
r4 = r2
|
||||
Lf:
|
||||
float r5 = r4.b()
|
||||
int r5 = (int) r5
|
||||
int r5 = r5 - r13
|
||||
if (r5 >= 0) goto L18
|
||||
r5 = 0
|
||||
L18:
|
||||
com.google.zxing.ResultPoint r13 = new com.google.zxing.ResultPoint
|
||||
float r4 = r4.a()
|
||||
float r5 = (float) r5
|
||||
r13.<init>(r4, r5)
|
||||
if (r15 == 0) goto L26
|
||||
r8 = r13
|
||||
goto L2a
|
||||
L26:
|
||||
r10 = r13
|
||||
r8 = r0
|
||||
goto L2b
|
||||
L29:
|
||||
r8 = r0
|
||||
L2a:
|
||||
r10 = r2
|
||||
L2b:
|
||||
if (r14 <= 0) goto L5b
|
||||
if (r15 == 0) goto L32
|
||||
com.google.zxing.ResultPoint r13 = r12.c
|
||||
goto L34
|
||||
L32:
|
||||
com.google.zxing.ResultPoint r13 = r12.e
|
||||
L34:
|
||||
float r0 = r13.b()
|
||||
int r0 = (int) r0
|
||||
int r0 = r0 + r14
|
||||
com.google.zxing.common.BitMatrix r14 = r12.a
|
||||
int r14 = r14.i()
|
||||
if (r0 < r14) goto L4a
|
||||
com.google.zxing.common.BitMatrix r14 = r12.a
|
||||
int r14 = r14.i()
|
||||
int r0 = r14 + (-1)
|
||||
L4a:
|
||||
com.google.zxing.ResultPoint r14 = new com.google.zxing.ResultPoint
|
||||
float r13 = r13.a()
|
||||
float r0 = (float) r0
|
||||
r14.<init>(r13, r0)
|
||||
if (r15 == 0) goto L58
|
||||
r9 = r14
|
||||
goto L5c
|
||||
L58:
|
||||
r11 = r14
|
||||
r9 = r1
|
||||
goto L5d
|
||||
L5b:
|
||||
r9 = r1
|
||||
L5c:
|
||||
r11 = r3
|
||||
L5d:
|
||||
com.google.zxing.pdf417.decoder.BoundingBox r13 = new com.google.zxing.pdf417.decoder.BoundingBox
|
||||
com.google.zxing.common.BitMatrix r7 = r12.a
|
||||
r6 = r13
|
||||
r6.<init>(r7, r8, r9, r10, r11)
|
||||
return r13
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.BoundingBox.a(int, int, boolean):com.google.zxing.pdf417.decoder.BoundingBox");
|
||||
}
|
||||
|
||||
ResultPoint a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
BoundingBox(BoundingBox boundingBox) {
|
||||
this.a = boundingBox.a;
|
||||
this.b = boundingBox.g();
|
||||
this.c = boundingBox.a();
|
||||
this.d = boundingBox.h();
|
||||
this.e = boundingBox.b();
|
||||
this.f = boundingBox.e();
|
||||
this.g = boundingBox.c();
|
||||
this.h = boundingBox.f();
|
||||
this.i = boundingBox.d();
|
||||
}
|
||||
}
|
61
sources/com/google/zxing/pdf417/decoder/Codeword.java
Normal file
61
sources/com/google/zxing/pdf417/decoder/Codeword.java
Normal file
@@ -0,0 +1,61 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class Codeword {
|
||||
private final int a;
|
||||
private final int b;
|
||||
private final int c;
|
||||
private final int d;
|
||||
private int e = -1;
|
||||
|
||||
Codeword(int i, int i2, int i3, int i4) {
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
this.c = i3;
|
||||
this.d = i4;
|
||||
}
|
||||
|
||||
boolean a(int i) {
|
||||
return i != -1 && this.c == (i % 3) * 3;
|
||||
}
|
||||
|
||||
int b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
int d() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
int e() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
int f() {
|
||||
return this.b - this.a;
|
||||
}
|
||||
|
||||
boolean g() {
|
||||
return a(this.e);
|
||||
}
|
||||
|
||||
void h() {
|
||||
this.e = ((this.d / 30) * 3) + (this.c / 3);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return this.e + "|" + this.d;
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
void b(int i) {
|
||||
this.e = i;
|
||||
}
|
||||
}
|
@@ -0,0 +1,375 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import com.baidu.cloud.media.player.IMediaPlayer;
|
||||
import com.google.zxing.FormatException;
|
||||
import com.google.zxing.pdf417.PDF417ResultMetadata;
|
||||
import java.math.BigInteger;
|
||||
import java.util.Arrays;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class DecodedBitStreamParser {
|
||||
private static final char[] a = ";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'".toCharArray();
|
||||
private static final char[] b = "0123456789&\r\t,:#-.$/+%*=^".toCharArray();
|
||||
private static final BigInteger[] c;
|
||||
|
||||
/* renamed from: com.google.zxing.pdf417.decoder.DecodedBitStreamParser$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[Mode.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[Mode.ALPHA.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[Mode.LOWER.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
a[Mode.MIXED.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
try {
|
||||
a[Mode.PUNCT.ordinal()] = 4;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
a[Mode.ALPHA_SHIFT.ordinal()] = 5;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
try {
|
||||
a[Mode.PUNCT_SHIFT.ordinal()] = 6;
|
||||
} catch (NoSuchFieldError unused6) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum Mode {
|
||||
ALPHA,
|
||||
LOWER,
|
||||
MIXED,
|
||||
PUNCT,
|
||||
ALPHA_SHIFT,
|
||||
PUNCT_SHIFT
|
||||
}
|
||||
|
||||
static {
|
||||
BigInteger[] bigIntegerArr = new BigInteger[16];
|
||||
c = bigIntegerArr;
|
||||
bigIntegerArr[0] = BigInteger.ONE;
|
||||
BigInteger valueOf = BigInteger.valueOf(900L);
|
||||
c[1] = valueOf;
|
||||
int i = 2;
|
||||
while (true) {
|
||||
BigInteger[] bigIntegerArr2 = c;
|
||||
if (i >= bigIntegerArr2.length) {
|
||||
return;
|
||||
}
|
||||
bigIntegerArr2[i] = bigIntegerArr2[i - 1].multiply(valueOf);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
||||
/* JADX WARN: Removed duplicated region for block: B:24:0x004e */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
static com.google.zxing.common.DecoderResult a(int[] r6, java.lang.String r7) throws com.google.zxing.FormatException {
|
||||
/*
|
||||
java.lang.StringBuilder r0 = new java.lang.StringBuilder
|
||||
int r1 = r6.length
|
||||
r2 = 1
|
||||
int r1 = r1 << r2
|
||||
r0.<init>(r1)
|
||||
java.nio.charset.Charset r1 = java.nio.charset.StandardCharsets.ISO_8859_1
|
||||
r2 = r6[r2]
|
||||
com.google.zxing.pdf417.PDF417ResultMetadata r3 = new com.google.zxing.pdf417.PDF417ResultMetadata
|
||||
r3.<init>()
|
||||
r4 = 2
|
||||
L12:
|
||||
r5 = 0
|
||||
r5 = r6[r5]
|
||||
if (r4 >= r5) goto L6d
|
||||
r5 = 913(0x391, float:1.28E-42)
|
||||
if (r2 == r5) goto L58
|
||||
switch(r2) {
|
||||
case 900: goto L53;
|
||||
case 901: goto L4e;
|
||||
case 902: goto L49;
|
||||
default: goto L1e;
|
||||
}
|
||||
L1e:
|
||||
switch(r2) {
|
||||
case 922: goto L44;
|
||||
case 923: goto L44;
|
||||
case 924: goto L4e;
|
||||
case 925: goto L41;
|
||||
case 926: goto L3e;
|
||||
case 927: goto L2d;
|
||||
case 928: goto L28;
|
||||
default: goto L21;
|
||||
}
|
||||
L21:
|
||||
int r4 = r4 + (-1)
|
||||
int r2 = b(r6, r4, r0)
|
||||
goto L60
|
||||
L28:
|
||||
int r2 = a(r6, r4, r3)
|
||||
goto L60
|
||||
L2d:
|
||||
int r2 = r4 + 1
|
||||
r1 = r6[r4]
|
||||
com.google.zxing.common.CharacterSetECI r1 = com.google.zxing.common.CharacterSetECI.getCharacterSetECIByValue(r1)
|
||||
java.lang.String r1 = r1.name()
|
||||
java.nio.charset.Charset r1 = java.nio.charset.Charset.forName(r1)
|
||||
goto L60
|
||||
L3e:
|
||||
int r2 = r4 + 2
|
||||
goto L60
|
||||
L41:
|
||||
int r2 = r4 + 1
|
||||
goto L60
|
||||
L44:
|
||||
com.google.zxing.FormatException r6 = com.google.zxing.FormatException.getFormatInstance()
|
||||
throw r6
|
||||
L49:
|
||||
int r2 = a(r6, r4, r0)
|
||||
goto L60
|
||||
L4e:
|
||||
int r2 = a(r2, r6, r1, r4, r0)
|
||||
goto L60
|
||||
L53:
|
||||
int r2 = b(r6, r4, r0)
|
||||
goto L60
|
||||
L58:
|
||||
int r2 = r4 + 1
|
||||
r4 = r6[r4]
|
||||
char r4 = (char) r4
|
||||
r0.append(r4)
|
||||
L60:
|
||||
int r4 = r6.length
|
||||
if (r2 >= r4) goto L68
|
||||
int r4 = r2 + 1
|
||||
r2 = r6[r2]
|
||||
goto L12
|
||||
L68:
|
||||
com.google.zxing.FormatException r6 = com.google.zxing.FormatException.getFormatInstance()
|
||||
throw r6
|
||||
L6d:
|
||||
int r6 = r0.length()
|
||||
if (r6 == 0) goto L81
|
||||
com.google.zxing.common.DecoderResult r6 = new com.google.zxing.common.DecoderResult
|
||||
java.lang.String r0 = r0.toString()
|
||||
r1 = 0
|
||||
r6.<init>(r1, r0, r1, r7)
|
||||
r6.a(r3)
|
||||
return r6
|
||||
L81:
|
||||
com.google.zxing.FormatException r6 = com.google.zxing.FormatException.getFormatInstance()
|
||||
throw r6
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.DecodedBitStreamParser.a(int[], java.lang.String):com.google.zxing.common.DecoderResult");
|
||||
}
|
||||
|
||||
/* JADX WARN: Failed to find 'out' block for switch in B:16:0x0034. Please report as an issue. */
|
||||
/* JADX WARN: Failed to find 'out' block for switch in B:17:0x0037. Please report as an issue. */
|
||||
private static int b(int[] iArr, int i, StringBuilder sb) {
|
||||
int[] iArr2 = new int[(iArr[0] - i) << 1];
|
||||
int[] iArr3 = new int[(iArr[0] - i) << 1];
|
||||
boolean z = false;
|
||||
int i2 = 0;
|
||||
while (i < iArr[0] && !z) {
|
||||
int i3 = i + 1;
|
||||
int i4 = iArr[i];
|
||||
if (i4 < 900) {
|
||||
iArr2[i2] = i4 / 30;
|
||||
iArr2[i2 + 1] = i4 % 30;
|
||||
i2 += 2;
|
||||
} else if (i4 != 913) {
|
||||
if (i4 != 928) {
|
||||
switch (i4) {
|
||||
case IMediaPlayer.MEDIA_INFO_TIMED_TEXT_ERROR /* 900 */:
|
||||
iArr2[i2] = 900;
|
||||
i2++;
|
||||
break;
|
||||
case IMediaPlayer.MEDIA_INFO_UNSUPPORTED_SUBTITLE /* 901 */:
|
||||
case IMediaPlayer.MEDIA_INFO_SUBTITLE_TIMED_OUT /* 902 */:
|
||||
break;
|
||||
default:
|
||||
switch (i4) {
|
||||
}
|
||||
}
|
||||
}
|
||||
i = i3 - 1;
|
||||
z = true;
|
||||
} else {
|
||||
iArr2[i2] = 913;
|
||||
i = i3 + 1;
|
||||
iArr3[i2] = iArr[i3];
|
||||
i2++;
|
||||
}
|
||||
i = i3;
|
||||
}
|
||||
a(iArr2, iArr3, i2, sb);
|
||||
return i;
|
||||
}
|
||||
|
||||
static int a(int[] iArr, int i, PDF417ResultMetadata pDF417ResultMetadata) throws FormatException {
|
||||
if (i + 2 <= iArr[0]) {
|
||||
int[] iArr2 = new int[2];
|
||||
int i2 = i;
|
||||
int i3 = 0;
|
||||
while (i3 < 2) {
|
||||
iArr2[i3] = iArr[i2];
|
||||
i3++;
|
||||
i2++;
|
||||
}
|
||||
pDF417ResultMetadata.c(Integer.parseInt(a(iArr2, 2)));
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int b2 = b(iArr, i2, sb);
|
||||
pDF417ResultMetadata.b(sb.toString());
|
||||
int i4 = iArr[b2] == 923 ? b2 + 1 : -1;
|
||||
while (b2 < iArr[0]) {
|
||||
int i5 = iArr[b2];
|
||||
if (i5 == 922) {
|
||||
b2++;
|
||||
pDF417ResultMetadata.a(true);
|
||||
} else if (i5 == 923) {
|
||||
int i6 = b2 + 1;
|
||||
switch (iArr[i6]) {
|
||||
case 0:
|
||||
StringBuilder sb2 = new StringBuilder();
|
||||
b2 = b(iArr, i6 + 1, sb2);
|
||||
pDF417ResultMetadata.c(sb2.toString());
|
||||
break;
|
||||
case 1:
|
||||
StringBuilder sb3 = new StringBuilder();
|
||||
b2 = a(iArr, i6 + 1, sb3);
|
||||
pDF417ResultMetadata.b(Integer.parseInt(sb3.toString()));
|
||||
break;
|
||||
case 2:
|
||||
StringBuilder sb4 = new StringBuilder();
|
||||
b2 = a(iArr, i6 + 1, sb4);
|
||||
pDF417ResultMetadata.b(Long.parseLong(sb4.toString()));
|
||||
break;
|
||||
case 3:
|
||||
StringBuilder sb5 = new StringBuilder();
|
||||
b2 = b(iArr, i6 + 1, sb5);
|
||||
pDF417ResultMetadata.d(sb5.toString());
|
||||
break;
|
||||
case 4:
|
||||
StringBuilder sb6 = new StringBuilder();
|
||||
b2 = b(iArr, i6 + 1, sb6);
|
||||
pDF417ResultMetadata.a(sb6.toString());
|
||||
break;
|
||||
case 5:
|
||||
StringBuilder sb7 = new StringBuilder();
|
||||
b2 = a(iArr, i6 + 1, sb7);
|
||||
pDF417ResultMetadata.a(Long.parseLong(sb7.toString()));
|
||||
break;
|
||||
case 6:
|
||||
StringBuilder sb8 = new StringBuilder();
|
||||
b2 = a(iArr, i6 + 1, sb8);
|
||||
pDF417ResultMetadata.a(Integer.parseInt(sb8.toString()));
|
||||
break;
|
||||
default:
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
} else {
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
}
|
||||
if (i4 != -1) {
|
||||
int i7 = b2 - i4;
|
||||
if (pDF417ResultMetadata.a()) {
|
||||
i7--;
|
||||
}
|
||||
pDF417ResultMetadata.a(Arrays.copyOfRange(iArr, i4, i7 + i4));
|
||||
}
|
||||
return b2;
|
||||
}
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
|
||||
/* JADX WARN: Can't fix incorrect switch cases order, some code will duplicate */
|
||||
/* JADX WARN: Removed duplicated region for block: B:26:0x00dc A[PHI: r2
|
||||
0x00dc: PHI (r2v15 com.google.zxing.pdf417.decoder.DecodedBitStreamParser$Mode) =
|
||||
(r2v1 com.google.zxing.pdf417.decoder.DecodedBitStreamParser$Mode)
|
||||
(r2v1 com.google.zxing.pdf417.decoder.DecodedBitStreamParser$Mode)
|
||||
(r2v1 com.google.zxing.pdf417.decoder.DecodedBitStreamParser$Mode)
|
||||
(r2v16 com.google.zxing.pdf417.decoder.DecodedBitStreamParser$Mode)
|
||||
binds: [B:63:0x00cb, B:53:0x00aa, B:40:0x0083, B:25:0x0052] A[DONT_GENERATE, DONT_INLINE]] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static void a(int[] r12, int[] r13, int r14, java.lang.StringBuilder r15) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 298
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.DecodedBitStreamParser.a(int[], int[], int, java.lang.StringBuilder):void");
|
||||
}
|
||||
|
||||
/* JADX WARN: Failed to find 'out' block for switch in B:45:0x0078. Please report as an issue. */
|
||||
/* JADX WARN: Failed to find 'out' block for switch in B:46:0x007b. Please report as an issue. */
|
||||
/* JADX WARN: Removed duplicated region for block: B:20:0x0046 A[SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:31:0x0021 A[ADDED_TO_REGION, SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:45:0x0078 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:64:0x00aa A[SYNTHETIC] */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static int a(int r16, int[] r17, java.nio.charset.Charset r18, int r19, java.lang.StringBuilder r20) {
|
||||
/*
|
||||
Method dump skipped, instructions count: 258
|
||||
To view this dump change 'Code comments level' option to 'DEBUG'
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.DecodedBitStreamParser.a(int, int[], java.nio.charset.Charset, int, java.lang.StringBuilder):int");
|
||||
}
|
||||
|
||||
private static int a(int[] iArr, int i, StringBuilder sb) throws FormatException {
|
||||
int[] iArr2 = new int[15];
|
||||
boolean z = false;
|
||||
int i2 = 0;
|
||||
while (i < iArr[0] && !z) {
|
||||
int i3 = i + 1;
|
||||
int i4 = iArr[i];
|
||||
if (i3 == iArr[0]) {
|
||||
z = true;
|
||||
}
|
||||
if (i4 < 900) {
|
||||
iArr2[i2] = i4;
|
||||
i2++;
|
||||
} else {
|
||||
if (i4 != 900 && i4 != 901 && i4 != 928) {
|
||||
switch (i4) {
|
||||
}
|
||||
}
|
||||
i3--;
|
||||
z = true;
|
||||
}
|
||||
if ((i2 % 15 == 0 || i4 == 902 || z) && i2 > 0) {
|
||||
sb.append(a(iArr2, i2));
|
||||
i2 = 0;
|
||||
}
|
||||
i = i3;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
private static String a(int[] iArr, int i) throws FormatException {
|
||||
BigInteger bigInteger = BigInteger.ZERO;
|
||||
for (int i2 = 0; i2 < i; i2++) {
|
||||
bigInteger = bigInteger.add(c[(i - i2) - 1].multiply(BigInteger.valueOf(iArr[i2])));
|
||||
}
|
||||
String bigInteger2 = bigInteger.toString();
|
||||
if (bigInteger2.charAt(0) == '1') {
|
||||
return bigInteger2.substring(1);
|
||||
}
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
}
|
261
sources/com/google/zxing/pdf417/decoder/DetectionResult.java
Normal file
261
sources/com/google/zxing/pdf417/decoder/DetectionResult.java
Normal file
@@ -0,0 +1,261 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import java.util.Formatter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class DetectionResult {
|
||||
private final BarcodeMetadata a;
|
||||
private final DetectionResultColumn[] b;
|
||||
private BoundingBox c;
|
||||
private final int d;
|
||||
|
||||
DetectionResult(BarcodeMetadata barcodeMetadata, BoundingBox boundingBox) {
|
||||
this.a = barcodeMetadata;
|
||||
this.d = barcodeMetadata.a();
|
||||
this.c = boundingBox;
|
||||
this.b = new DetectionResultColumn[this.d + 2];
|
||||
}
|
||||
|
||||
private void a(DetectionResultColumn detectionResultColumn) {
|
||||
if (detectionResultColumn != null) {
|
||||
((DetectionResultRowIndicatorColumn) detectionResultColumn).a(this.a);
|
||||
}
|
||||
}
|
||||
|
||||
private int f() {
|
||||
int g = g();
|
||||
if (g == 0) {
|
||||
return 0;
|
||||
}
|
||||
for (int i = 1; i < this.d + 1; i++) {
|
||||
Codeword[] b = this.b[i].b();
|
||||
for (int i2 = 0; i2 < b.length; i2++) {
|
||||
if (b[i2] != null && !b[i2].g()) {
|
||||
a(i, i2, b);
|
||||
}
|
||||
}
|
||||
}
|
||||
return g;
|
||||
}
|
||||
|
||||
private int g() {
|
||||
h();
|
||||
return i() + j();
|
||||
}
|
||||
|
||||
private void h() {
|
||||
DetectionResultColumn[] detectionResultColumnArr = this.b;
|
||||
if (detectionResultColumnArr[0] == null || detectionResultColumnArr[this.d + 1] == null) {
|
||||
return;
|
||||
}
|
||||
Codeword[] b = detectionResultColumnArr[0].b();
|
||||
Codeword[] b2 = this.b[this.d + 1].b();
|
||||
for (int i = 0; i < b.length; i++) {
|
||||
if (b[i] != null && b2[i] != null && b[i].c() == b2[i].c()) {
|
||||
for (int i2 = 1; i2 <= this.d; i2++) {
|
||||
Codeword codeword = this.b[i2].b()[i];
|
||||
if (codeword != null) {
|
||||
codeword.b(b[i].c());
|
||||
if (!codeword.g()) {
|
||||
this.b[i2].b()[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int i() {
|
||||
DetectionResultColumn[] detectionResultColumnArr = this.b;
|
||||
if (detectionResultColumnArr[0] == null) {
|
||||
return 0;
|
||||
}
|
||||
Codeword[] b = detectionResultColumnArr[0].b();
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < b.length; i2++) {
|
||||
if (b[i2] != null) {
|
||||
int c = b[i2].c();
|
||||
int i3 = i;
|
||||
int i4 = 0;
|
||||
for (int i5 = 1; i5 < this.d + 1 && i4 < 2; i5++) {
|
||||
Codeword codeword = this.b[i5].b()[i2];
|
||||
if (codeword != null) {
|
||||
i4 = a(c, i4, codeword);
|
||||
if (!codeword.g()) {
|
||||
i3++;
|
||||
}
|
||||
}
|
||||
}
|
||||
i = i3;
|
||||
}
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
private int j() {
|
||||
DetectionResultColumn[] detectionResultColumnArr = this.b;
|
||||
int i = this.d;
|
||||
if (detectionResultColumnArr[i + 1] == null) {
|
||||
return 0;
|
||||
}
|
||||
Codeword[] b = detectionResultColumnArr[i + 1].b();
|
||||
int i2 = 0;
|
||||
for (int i3 = 0; i3 < b.length; i3++) {
|
||||
if (b[i3] != null) {
|
||||
int c = b[i3].c();
|
||||
int i4 = i2;
|
||||
int i5 = 0;
|
||||
for (int i6 = this.d + 1; i6 > 0 && i5 < 2; i6--) {
|
||||
Codeword codeword = this.b[i6].b()[i3];
|
||||
if (codeword != null) {
|
||||
i5 = a(c, i5, codeword);
|
||||
if (!codeword.g()) {
|
||||
i4++;
|
||||
}
|
||||
}
|
||||
}
|
||||
i2 = i4;
|
||||
}
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
int b() {
|
||||
return this.a.b();
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.a.c();
|
||||
}
|
||||
|
||||
BoundingBox d() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
DetectionResultColumn[] e() {
|
||||
a(this.b[0]);
|
||||
a(this.b[this.d + 1]);
|
||||
int i = 928;
|
||||
while (true) {
|
||||
int f = f();
|
||||
if (f <= 0 || f >= i) {
|
||||
break;
|
||||
}
|
||||
i = f;
|
||||
}
|
||||
return this.b;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
DetectionResultColumn[] detectionResultColumnArr = this.b;
|
||||
DetectionResultColumn detectionResultColumn = detectionResultColumnArr[0];
|
||||
if (detectionResultColumn == null) {
|
||||
detectionResultColumn = detectionResultColumnArr[this.d + 1];
|
||||
}
|
||||
Formatter formatter = new Formatter();
|
||||
for (int i = 0; i < detectionResultColumn.b().length; i++) {
|
||||
try {
|
||||
formatter.format("CW %3d:", Integer.valueOf(i));
|
||||
for (int i2 = 0; i2 < this.d + 2; i2++) {
|
||||
if (this.b[i2] == null) {
|
||||
formatter.format(" | ", new Object[0]);
|
||||
} else {
|
||||
Codeword codeword = this.b[i2].b()[i];
|
||||
if (codeword == null) {
|
||||
formatter.format(" | ", new Object[0]);
|
||||
} else {
|
||||
formatter.format(" %3d|%3d", Integer.valueOf(codeword.c()), Integer.valueOf(codeword.e()));
|
||||
}
|
||||
}
|
||||
}
|
||||
formatter.format("%n", new Object[0]);
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} catch (Throwable th2) {
|
||||
try {
|
||||
formatter.close();
|
||||
} catch (Throwable th3) {
|
||||
th.addSuppressed(th3);
|
||||
}
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
String formatter2 = formatter.toString();
|
||||
formatter.close();
|
||||
return formatter2;
|
||||
}
|
||||
|
||||
private static int a(int i, int i2, Codeword codeword) {
|
||||
if (codeword == null || codeword.g()) {
|
||||
return i2;
|
||||
}
|
||||
if (!codeword.a(i)) {
|
||||
return i2 + 1;
|
||||
}
|
||||
codeword.b(i);
|
||||
return 0;
|
||||
}
|
||||
|
||||
private void a(int i, int i2, Codeword[] codewordArr) {
|
||||
Codeword codeword = codewordArr[i2];
|
||||
Codeword[] b = this.b[i - 1].b();
|
||||
DetectionResultColumn[] detectionResultColumnArr = this.b;
|
||||
int i3 = i + 1;
|
||||
Codeword[] b2 = detectionResultColumnArr[i3] != null ? detectionResultColumnArr[i3].b() : b;
|
||||
Codeword[] codewordArr2 = new Codeword[14];
|
||||
codewordArr2[2] = b[i2];
|
||||
codewordArr2[3] = b2[i2];
|
||||
if (i2 > 0) {
|
||||
int i4 = i2 - 1;
|
||||
codewordArr2[0] = codewordArr[i4];
|
||||
codewordArr2[4] = b[i4];
|
||||
codewordArr2[5] = b2[i4];
|
||||
}
|
||||
if (i2 > 1) {
|
||||
int i5 = i2 - 2;
|
||||
codewordArr2[8] = codewordArr[i5];
|
||||
codewordArr2[10] = b[i5];
|
||||
codewordArr2[11] = b2[i5];
|
||||
}
|
||||
if (i2 < codewordArr.length - 1) {
|
||||
int i6 = i2 + 1;
|
||||
codewordArr2[1] = codewordArr[i6];
|
||||
codewordArr2[6] = b[i6];
|
||||
codewordArr2[7] = b2[i6];
|
||||
}
|
||||
if (i2 < codewordArr.length - 2) {
|
||||
int i7 = i2 + 2;
|
||||
codewordArr2[9] = codewordArr[i7];
|
||||
codewordArr2[12] = b[i7];
|
||||
codewordArr2[13] = b2[i7];
|
||||
}
|
||||
for (int i8 = 0; i8 < 14 && !a(codeword, codewordArr2[i8]); i8++) {
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean a(Codeword codeword, Codeword codeword2) {
|
||||
if (codeword2 == null || !codeword2.g() || codeword2.a() != codeword.a()) {
|
||||
return false;
|
||||
}
|
||||
codeword.b(codeword2.c());
|
||||
return true;
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
void a(BoundingBox boundingBox) {
|
||||
this.c = boundingBox;
|
||||
}
|
||||
|
||||
void a(int i, DetectionResultColumn detectionResultColumn) {
|
||||
this.b[i] = detectionResultColumn;
|
||||
}
|
||||
|
||||
DetectionResultColumn a(int i) {
|
||||
return this.b[i];
|
||||
}
|
||||
}
|
@@ -0,0 +1,85 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import java.util.Formatter;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
class DetectionResultColumn {
|
||||
private final BoundingBox a;
|
||||
private final Codeword[] b;
|
||||
|
||||
DetectionResultColumn(BoundingBox boundingBox) {
|
||||
this.a = new BoundingBox(boundingBox);
|
||||
this.b = new Codeword[(boundingBox.d() - boundingBox.f()) + 1];
|
||||
}
|
||||
|
||||
final void a(int i, Codeword codeword) {
|
||||
this.b[c(i)] = codeword;
|
||||
}
|
||||
|
||||
final Codeword b(int i) {
|
||||
Codeword codeword;
|
||||
Codeword codeword2;
|
||||
Codeword a = a(i);
|
||||
if (a != null) {
|
||||
return a;
|
||||
}
|
||||
for (int i2 = 1; i2 < 5; i2++) {
|
||||
int c = c(i) - i2;
|
||||
if (c >= 0 && (codeword2 = this.b[c]) != null) {
|
||||
return codeword2;
|
||||
}
|
||||
int c2 = c(i) + i2;
|
||||
Codeword[] codewordArr = this.b;
|
||||
if (c2 < codewordArr.length && (codeword = codewordArr[c2]) != null) {
|
||||
return codeword;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
final int c(int i) {
|
||||
return i - this.a.f();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
Formatter formatter = new Formatter();
|
||||
try {
|
||||
int i = 0;
|
||||
for (Codeword codeword : this.b) {
|
||||
if (codeword == null) {
|
||||
formatter.format("%3d: | %n", Integer.valueOf(i));
|
||||
i++;
|
||||
} else {
|
||||
formatter.format("%3d: %3d|%3d%n", Integer.valueOf(i), Integer.valueOf(codeword.c()), Integer.valueOf(codeword.e()));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
String formatter2 = formatter.toString();
|
||||
formatter.close();
|
||||
return formatter2;
|
||||
} catch (Throwable th) {
|
||||
try {
|
||||
throw th;
|
||||
} catch (Throwable th2) {
|
||||
try {
|
||||
formatter.close();
|
||||
} catch (Throwable th3) {
|
||||
th.addSuppressed(th3);
|
||||
}
|
||||
throw th2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
final Codeword a(int i) {
|
||||
return this.b[c(i)];
|
||||
}
|
||||
|
||||
final BoundingBox a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
final Codeword[] b() {
|
||||
return this.b;
|
||||
}
|
||||
}
|
@@ -0,0 +1,184 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import com.google.zxing.ResultPoint;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class DetectionResultRowIndicatorColumn extends DetectionResultColumn {
|
||||
private final boolean c;
|
||||
|
||||
DetectionResultRowIndicatorColumn(BoundingBox boundingBox, boolean z) {
|
||||
super(boundingBox);
|
||||
this.c = z;
|
||||
}
|
||||
|
||||
private void b(BarcodeMetadata barcodeMetadata) {
|
||||
BoundingBox a = a();
|
||||
ResultPoint g = this.c ? a.g() : a.h();
|
||||
ResultPoint a2 = this.c ? a.a() : a.b();
|
||||
int c = c((int) a2.b());
|
||||
Codeword[] b = b();
|
||||
int i = -1;
|
||||
int i2 = 0;
|
||||
int i3 = 1;
|
||||
for (int c2 = c((int) g.b()); c2 < c; c2++) {
|
||||
if (b[c2] != null) {
|
||||
Codeword codeword = b[c2];
|
||||
codeword.h();
|
||||
int c3 = codeword.c() - i;
|
||||
if (c3 == 0) {
|
||||
i2++;
|
||||
} else {
|
||||
if (c3 == 1) {
|
||||
i3 = Math.max(i3, i2);
|
||||
i = codeword.c();
|
||||
} else if (codeword.c() >= barcodeMetadata.c()) {
|
||||
b[c2] = null;
|
||||
} else {
|
||||
i = codeword.c();
|
||||
}
|
||||
i2 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void f() {
|
||||
for (Codeword codeword : b()) {
|
||||
if (codeword != null) {
|
||||
codeword.h();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void a(BarcodeMetadata barcodeMetadata) {
|
||||
Codeword[] b = b();
|
||||
f();
|
||||
a(b, barcodeMetadata);
|
||||
BoundingBox a = a();
|
||||
ResultPoint g = this.c ? a.g() : a.h();
|
||||
ResultPoint a2 = this.c ? a.a() : a.b();
|
||||
int c = c((int) g.b());
|
||||
int c2 = c((int) a2.b());
|
||||
int i = -1;
|
||||
int i2 = 0;
|
||||
int i3 = 1;
|
||||
while (c < c2) {
|
||||
if (b[c] != null) {
|
||||
Codeword codeword = b[c];
|
||||
int c3 = codeword.c() - i;
|
||||
if (c3 == 0) {
|
||||
i2++;
|
||||
} else {
|
||||
if (c3 == 1) {
|
||||
i3 = Math.max(i3, i2);
|
||||
i = codeword.c();
|
||||
} else if (c3 < 0 || codeword.c() >= barcodeMetadata.c() || c3 > c) {
|
||||
b[c] = null;
|
||||
} else {
|
||||
if (i3 > 2) {
|
||||
c3 *= i3 - 2;
|
||||
}
|
||||
boolean z = c3 >= c;
|
||||
for (int i4 = 1; i4 <= c3 && !z; i4++) {
|
||||
z = b[c - i4] != null;
|
||||
}
|
||||
if (z) {
|
||||
b[c] = null;
|
||||
} else {
|
||||
i = codeword.c();
|
||||
}
|
||||
}
|
||||
i2 = 1;
|
||||
}
|
||||
}
|
||||
c++;
|
||||
}
|
||||
}
|
||||
|
||||
BarcodeMetadata c() {
|
||||
Codeword[] b = b();
|
||||
BarcodeValue barcodeValue = new BarcodeValue();
|
||||
BarcodeValue barcodeValue2 = new BarcodeValue();
|
||||
BarcodeValue barcodeValue3 = new BarcodeValue();
|
||||
BarcodeValue barcodeValue4 = new BarcodeValue();
|
||||
for (Codeword codeword : b) {
|
||||
if (codeword != null) {
|
||||
codeword.h();
|
||||
int e = codeword.e() % 30;
|
||||
int c = codeword.c();
|
||||
if (!this.c) {
|
||||
c += 2;
|
||||
}
|
||||
int i = c % 3;
|
||||
if (i == 0) {
|
||||
barcodeValue2.a((e * 3) + 1);
|
||||
} else if (i == 1) {
|
||||
barcodeValue4.a(e / 3);
|
||||
barcodeValue3.a(e % 3);
|
||||
} else if (i == 2) {
|
||||
barcodeValue.a(e + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (barcodeValue.a().length == 0 || barcodeValue2.a().length == 0 || barcodeValue3.a().length == 0 || barcodeValue4.a().length == 0 || barcodeValue.a()[0] <= 0 || barcodeValue2.a()[0] + barcodeValue3.a()[0] < 3 || barcodeValue2.a()[0] + barcodeValue3.a()[0] > 90) {
|
||||
return null;
|
||||
}
|
||||
BarcodeMetadata barcodeMetadata = new BarcodeMetadata(barcodeValue.a()[0], barcodeValue2.a()[0], barcodeValue3.a()[0], barcodeValue4.a()[0]);
|
||||
a(b, barcodeMetadata);
|
||||
return barcodeMetadata;
|
||||
}
|
||||
|
||||
int[] d() {
|
||||
int c;
|
||||
BarcodeMetadata c2 = c();
|
||||
if (c2 == null) {
|
||||
return null;
|
||||
}
|
||||
b(c2);
|
||||
int[] iArr = new int[c2.c()];
|
||||
for (Codeword codeword : b()) {
|
||||
if (codeword != null && (c = codeword.c()) < iArr.length) {
|
||||
iArr[c] = iArr[c] + 1;
|
||||
}
|
||||
}
|
||||
return iArr;
|
||||
}
|
||||
|
||||
boolean e() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
@Override // com.google.zxing.pdf417.decoder.DetectionResultColumn
|
||||
public String toString() {
|
||||
return "IsLeft: " + this.c + '\n' + super.toString();
|
||||
}
|
||||
|
||||
private void a(Codeword[] codewordArr, BarcodeMetadata barcodeMetadata) {
|
||||
for (int i = 0; i < codewordArr.length; i++) {
|
||||
Codeword codeword = codewordArr[i];
|
||||
if (codewordArr[i] != null) {
|
||||
int e = codeword.e() % 30;
|
||||
int c = codeword.c();
|
||||
if (c > barcodeMetadata.c()) {
|
||||
codewordArr[i] = null;
|
||||
} else {
|
||||
if (!this.c) {
|
||||
c += 2;
|
||||
}
|
||||
int i2 = c % 3;
|
||||
if (i2 != 0) {
|
||||
if (i2 != 1) {
|
||||
if (i2 == 2 && e + 1 != barcodeMetadata.a()) {
|
||||
codewordArr[i] = null;
|
||||
}
|
||||
} else if (e / 3 != barcodeMetadata.b() || e % 3 != barcodeMetadata.d()) {
|
||||
codewordArr[i] = null;
|
||||
}
|
||||
} else if ((e * 3) + 1 != barcodeMetadata.e()) {
|
||||
codewordArr[i] = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,119 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import com.google.zxing.common.detector.MathUtils;
|
||||
import com.google.zxing.pdf417.PDF417Common;
|
||||
import java.lang.reflect.Array;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class PDF417CodewordDecoder {
|
||||
private static final float[][] a = (float[][]) Array.newInstance((Class<?>) float.class, PDF417Common.b.length, 8);
|
||||
|
||||
static {
|
||||
int i;
|
||||
int i2 = 0;
|
||||
while (true) {
|
||||
int[] iArr = PDF417Common.b;
|
||||
if (i2 >= iArr.length) {
|
||||
return;
|
||||
}
|
||||
int i3 = iArr[i2];
|
||||
int i4 = i3 & 1;
|
||||
int i5 = i3;
|
||||
int i6 = 0;
|
||||
while (i6 < 8) {
|
||||
float f = 0.0f;
|
||||
while (true) {
|
||||
i = i5 & 1;
|
||||
if (i == i4) {
|
||||
f += 1.0f;
|
||||
i5 >>= 1;
|
||||
}
|
||||
}
|
||||
a[i2][(8 - i6) - 1] = f / 17.0f;
|
||||
i6++;
|
||||
i4 = i;
|
||||
}
|
||||
i2++;
|
||||
}
|
||||
}
|
||||
|
||||
private static int a(int[] iArr) {
|
||||
long j = 0;
|
||||
int i = 0;
|
||||
while (i < iArr.length) {
|
||||
long j2 = j;
|
||||
for (int i2 = 0; i2 < iArr[i]; i2++) {
|
||||
int i3 = 1;
|
||||
long j3 = j2 << 1;
|
||||
if (i % 2 != 0) {
|
||||
i3 = 0;
|
||||
}
|
||||
j2 = j3 | i3;
|
||||
}
|
||||
i++;
|
||||
j = j2;
|
||||
}
|
||||
return (int) j;
|
||||
}
|
||||
|
||||
private static int b(int[] iArr) {
|
||||
int a2 = MathUtils.a(iArr);
|
||||
float[] fArr = new float[8];
|
||||
if (a2 > 1) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
fArr[i] = iArr[i] / a2;
|
||||
}
|
||||
}
|
||||
int i2 = -1;
|
||||
int i3 = 0;
|
||||
float f = Float.MAX_VALUE;
|
||||
while (true) {
|
||||
float[][] fArr2 = a;
|
||||
if (i3 >= fArr2.length) {
|
||||
return i2;
|
||||
}
|
||||
float[] fArr3 = fArr2[i3];
|
||||
float f2 = 0.0f;
|
||||
for (int i4 = 0; i4 < 8; i4++) {
|
||||
float f3 = fArr3[i4] - fArr[i4];
|
||||
f2 += f3 * f3;
|
||||
if (f2 >= f) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (f2 < f) {
|
||||
i2 = PDF417Common.b[i3];
|
||||
f = f2;
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
}
|
||||
|
||||
private static int c(int[] iArr) {
|
||||
int a2 = a(iArr);
|
||||
if (PDF417Common.a(a2) == -1) {
|
||||
return -1;
|
||||
}
|
||||
return a2;
|
||||
}
|
||||
|
||||
static int d(int[] iArr) {
|
||||
int c = c(e(iArr));
|
||||
return c != -1 ? c : b(iArr);
|
||||
}
|
||||
|
||||
private static int[] e(int[] iArr) {
|
||||
float a2 = MathUtils.a(iArr);
|
||||
int[] iArr2 = new int[8];
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
for (int i3 = 0; i3 < 17; i3++) {
|
||||
if (iArr[i2] + i <= (a2 / 34.0f) + ((i3 * a2) / 17.0f)) {
|
||||
i += iArr[i2];
|
||||
i2++;
|
||||
}
|
||||
iArr2[i2] = iArr2[i2] + 1;
|
||||
}
|
||||
return iArr2;
|
||||
}
|
||||
}
|
@@ -0,0 +1,552 @@
|
||||
package com.google.zxing.pdf417.decoder;
|
||||
|
||||
import com.google.zxing.ChecksumException;
|
||||
import com.google.zxing.FormatException;
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.common.DecoderResult;
|
||||
import com.google.zxing.common.detector.MathUtils;
|
||||
import com.google.zxing.pdf417.PDF417Common;
|
||||
import com.google.zxing.pdf417.decoder.ec.ErrorCorrection;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class PDF417ScanningDecoder {
|
||||
private static final ErrorCorrection a = new ErrorCorrection();
|
||||
|
||||
public static DecoderResult a(BitMatrix bitMatrix, ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3, ResultPoint resultPoint4, int i, int i2) throws NotFoundException, FormatException, ChecksumException {
|
||||
DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn;
|
||||
int i3;
|
||||
int i4;
|
||||
int i5;
|
||||
DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn2 = null;
|
||||
DetectionResult detectionResult = null;
|
||||
DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn3 = null;
|
||||
BoundingBox boundingBox = new BoundingBox(bitMatrix, resultPoint, resultPoint2, resultPoint3, resultPoint4);
|
||||
int i6 = 0;
|
||||
while (i6 < 2) {
|
||||
if (resultPoint != null) {
|
||||
detectionResultRowIndicatorColumn2 = a(bitMatrix, boundingBox, resultPoint, true, i, i2);
|
||||
}
|
||||
detectionResultRowIndicatorColumn = detectionResultRowIndicatorColumn2;
|
||||
if (resultPoint3 != null) {
|
||||
detectionResultRowIndicatorColumn3 = a(bitMatrix, boundingBox, resultPoint3, false, i, i2);
|
||||
}
|
||||
detectionResult = b(detectionResultRowIndicatorColumn, detectionResultRowIndicatorColumn3);
|
||||
if (detectionResult == null) {
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
if (i6 != 0 || detectionResult.d() == null || (detectionResult.d().f() >= boundingBox.f() && detectionResult.d().d() <= boundingBox.d())) {
|
||||
detectionResult.a(boundingBox);
|
||||
break;
|
||||
}
|
||||
boundingBox = detectionResult.d();
|
||||
i6++;
|
||||
detectionResultRowIndicatorColumn2 = detectionResultRowIndicatorColumn;
|
||||
}
|
||||
detectionResultRowIndicatorColumn = detectionResultRowIndicatorColumn2;
|
||||
int a2 = detectionResult.a() + 1;
|
||||
detectionResult.a(0, detectionResultRowIndicatorColumn);
|
||||
detectionResult.a(a2, detectionResultRowIndicatorColumn3);
|
||||
boolean z = detectionResultRowIndicatorColumn != null;
|
||||
int i7 = i;
|
||||
int i8 = i2;
|
||||
for (int i9 = 1; i9 <= a2; i9++) {
|
||||
int i10 = z ? i9 : a2 - i9;
|
||||
if (detectionResult.a(i10) == null) {
|
||||
DetectionResultColumn detectionResultRowIndicatorColumn4 = (i10 == 0 || i10 == a2) ? new DetectionResultRowIndicatorColumn(boundingBox, i10 == 0) : new DetectionResultColumn(boundingBox);
|
||||
detectionResult.a(i10, detectionResultRowIndicatorColumn4);
|
||||
int i11 = -1;
|
||||
int i12 = i8;
|
||||
int i13 = -1;
|
||||
int i14 = i7;
|
||||
int f = boundingBox.f();
|
||||
while (f <= boundingBox.d()) {
|
||||
int a3 = a(detectionResult, i10, f, z);
|
||||
if (a3 >= 0 && a3 <= boundingBox.c()) {
|
||||
i5 = a3;
|
||||
} else if (i13 != i11) {
|
||||
i5 = i13;
|
||||
} else {
|
||||
i3 = i13;
|
||||
i4 = i12;
|
||||
i12 = i4;
|
||||
i13 = i3;
|
||||
f++;
|
||||
i11 = -1;
|
||||
}
|
||||
i3 = i13;
|
||||
int i15 = i12;
|
||||
Codeword a4 = a(bitMatrix, boundingBox.e(), boundingBox.c(), z, i5, f, i14, i15);
|
||||
if (a4 != null) {
|
||||
detectionResultRowIndicatorColumn4.a(f, a4);
|
||||
i14 = Math.min(i14, a4.f());
|
||||
i12 = Math.max(i15, a4.f());
|
||||
i13 = i5;
|
||||
f++;
|
||||
i11 = -1;
|
||||
} else {
|
||||
i4 = i15;
|
||||
i12 = i4;
|
||||
i13 = i3;
|
||||
f++;
|
||||
i11 = -1;
|
||||
}
|
||||
}
|
||||
i7 = i14;
|
||||
i8 = i12;
|
||||
}
|
||||
}
|
||||
return b(detectionResult);
|
||||
}
|
||||
|
||||
private static boolean a(int i, int i2, int i3) {
|
||||
return i2 + (-2) <= i && i <= i3 + 2;
|
||||
}
|
||||
|
||||
private static DetectionResult b(DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn, DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn2) throws NotFoundException {
|
||||
BarcodeMetadata a2;
|
||||
if ((detectionResultRowIndicatorColumn == null && detectionResultRowIndicatorColumn2 == null) || (a2 = a(detectionResultRowIndicatorColumn, detectionResultRowIndicatorColumn2)) == null) {
|
||||
return null;
|
||||
}
|
||||
return new DetectionResult(a2, BoundingBox.a(a(detectionResultRowIndicatorColumn), a(detectionResultRowIndicatorColumn2)));
|
||||
}
|
||||
|
||||
private static int c(int i) {
|
||||
return 2 << i;
|
||||
}
|
||||
|
||||
private static int b(int[] iArr) {
|
||||
int i = -1;
|
||||
for (int i2 : iArr) {
|
||||
i = Math.max(i, i2);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
private static DecoderResult b(DetectionResult detectionResult) throws FormatException, ChecksumException, NotFoundException {
|
||||
BarcodeValue[][] a2 = a(detectionResult);
|
||||
a(detectionResult, a2);
|
||||
ArrayList arrayList = new ArrayList();
|
||||
int[] iArr = new int[detectionResult.c() * detectionResult.a()];
|
||||
ArrayList arrayList2 = new ArrayList();
|
||||
ArrayList arrayList3 = new ArrayList();
|
||||
for (int i = 0; i < detectionResult.c(); i++) {
|
||||
int i2 = 0;
|
||||
while (i2 < detectionResult.a()) {
|
||||
int i3 = i2 + 1;
|
||||
int[] a3 = a2[i][i3].a();
|
||||
int a4 = (detectionResult.a() * i) + i2;
|
||||
if (a3.length == 0) {
|
||||
arrayList.add(Integer.valueOf(a4));
|
||||
} else if (a3.length == 1) {
|
||||
iArr[a4] = a3[0];
|
||||
} else {
|
||||
arrayList3.add(Integer.valueOf(a4));
|
||||
arrayList2.add(a3);
|
||||
}
|
||||
i2 = i3;
|
||||
}
|
||||
}
|
||||
int[][] iArr2 = new int[arrayList2.size()][];
|
||||
for (int i4 = 0; i4 < iArr2.length; i4++) {
|
||||
iArr2[i4] = (int[]) arrayList2.get(i4);
|
||||
}
|
||||
return a(detectionResult.b(), iArr, PDF417Common.a(arrayList), PDF417Common.a(arrayList3), iArr2);
|
||||
}
|
||||
|
||||
private static BoundingBox a(DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn) throws NotFoundException {
|
||||
int[] d;
|
||||
if (detectionResultRowIndicatorColumn == null || (d = detectionResultRowIndicatorColumn.d()) == null) {
|
||||
return null;
|
||||
}
|
||||
int b = b(d);
|
||||
int i = 0;
|
||||
int i2 = 0;
|
||||
for (int i3 : d) {
|
||||
i2 += b - i3;
|
||||
if (i3 > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Codeword[] b2 = detectionResultRowIndicatorColumn.b();
|
||||
for (int i4 = 0; i2 > 0 && b2[i4] == null; i4++) {
|
||||
i2--;
|
||||
}
|
||||
for (int length = d.length - 1; length >= 0; length--) {
|
||||
i += b - d[length];
|
||||
if (d[length] > 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int length2 = b2.length - 1; i > 0 && b2[length2] == null; length2--) {
|
||||
i--;
|
||||
}
|
||||
return detectionResultRowIndicatorColumn.a().a(i2, i, detectionResultRowIndicatorColumn.e());
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x0027 A[EDGE_INSN: B:17:0x0027->B:18:0x0027 BREAK A[LOOP:0: B:5:0x000c->B:13:0x000c], SYNTHETIC] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:8:0x0015 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static int[] b(com.google.zxing.common.BitMatrix r7, int r8, int r9, boolean r10, int r11, int r12) {
|
||||
/*
|
||||
r0 = 8
|
||||
int[] r1 = new int[r0]
|
||||
r2 = 1
|
||||
if (r10 == 0) goto L9
|
||||
r3 = 1
|
||||
goto La
|
||||
L9:
|
||||
r3 = -1
|
||||
La:
|
||||
r4 = 0
|
||||
r5 = r10
|
||||
Lc:
|
||||
if (r10 == 0) goto L11
|
||||
if (r11 >= r9) goto L27
|
||||
goto L13
|
||||
L11:
|
||||
if (r11 < r8) goto L27
|
||||
L13:
|
||||
if (r4 >= r0) goto L27
|
||||
boolean r6 = r7.b(r11, r12)
|
||||
if (r6 != r5) goto L22
|
||||
r6 = r1[r4]
|
||||
int r6 = r6 + r2
|
||||
r1[r4] = r6
|
||||
int r11 = r11 + r3
|
||||
goto Lc
|
||||
L22:
|
||||
int r4 = r4 + 1
|
||||
r5 = r5 ^ 1
|
||||
goto Lc
|
||||
L27:
|
||||
if (r4 == r0) goto L34
|
||||
if (r10 == 0) goto L2c
|
||||
r8 = r9
|
||||
L2c:
|
||||
if (r11 != r8) goto L32
|
||||
r7 = 7
|
||||
if (r4 != r7) goto L32
|
||||
goto L34
|
||||
L32:
|
||||
r7 = 0
|
||||
return r7
|
||||
L34:
|
||||
return r1
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.PDF417ScanningDecoder.b(com.google.zxing.common.BitMatrix, int, int, boolean, int, int):int[]");
|
||||
}
|
||||
|
||||
private static int b(int i) {
|
||||
return a(a(i));
|
||||
}
|
||||
|
||||
private static BarcodeMetadata a(DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn, DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn2) {
|
||||
BarcodeMetadata c;
|
||||
BarcodeMetadata c2;
|
||||
if (detectionResultRowIndicatorColumn == null || (c = detectionResultRowIndicatorColumn.c()) == null) {
|
||||
if (detectionResultRowIndicatorColumn2 == null) {
|
||||
return null;
|
||||
}
|
||||
return detectionResultRowIndicatorColumn2.c();
|
||||
}
|
||||
if (detectionResultRowIndicatorColumn2 == null || (c2 = detectionResultRowIndicatorColumn2.c()) == null || c.a() == c2.a() || c.b() == c2.b() || c.c() == c2.c()) {
|
||||
return c;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static DetectionResultRowIndicatorColumn a(BitMatrix bitMatrix, BoundingBox boundingBox, ResultPoint resultPoint, boolean z, int i, int i2) {
|
||||
DetectionResultRowIndicatorColumn detectionResultRowIndicatorColumn = new DetectionResultRowIndicatorColumn(boundingBox, z);
|
||||
int i3 = 0;
|
||||
while (i3 < 2) {
|
||||
int i4 = i3 == 0 ? 1 : -1;
|
||||
int a2 = (int) resultPoint.a();
|
||||
for (int b = (int) resultPoint.b(); b <= boundingBox.d() && b >= boundingBox.f(); b += i4) {
|
||||
Codeword a3 = a(bitMatrix, 0, bitMatrix.k(), z, a2, b, i, i2);
|
||||
if (a3 != null) {
|
||||
detectionResultRowIndicatorColumn.a(b, a3);
|
||||
if (z) {
|
||||
a2 = a3.d();
|
||||
} else {
|
||||
a2 = a3.b();
|
||||
}
|
||||
}
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
return detectionResultRowIndicatorColumn;
|
||||
}
|
||||
|
||||
private static void a(DetectionResult detectionResult, BarcodeValue[][] barcodeValueArr) throws NotFoundException {
|
||||
BarcodeValue barcodeValue = barcodeValueArr[0][1];
|
||||
int[] a2 = barcodeValue.a();
|
||||
int a3 = (detectionResult.a() * detectionResult.c()) - c(detectionResult.b());
|
||||
if (a2.length != 0) {
|
||||
if (a2[0] != a3) {
|
||||
barcodeValue.a(a3);
|
||||
}
|
||||
} else {
|
||||
if (a3 > 0 && a3 <= 928) {
|
||||
barcodeValue.a(a3);
|
||||
return;
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
}
|
||||
|
||||
private static DecoderResult a(int i, int[] iArr, int[] iArr2, int[] iArr3, int[][] iArr4) throws FormatException, ChecksumException {
|
||||
int[] iArr5 = new int[iArr3.length];
|
||||
int i2 = 100;
|
||||
while (true) {
|
||||
int i3 = i2 - 1;
|
||||
if (i2 > 0) {
|
||||
for (int i4 = 0; i4 < iArr5.length; i4++) {
|
||||
iArr[iArr3[i4]] = iArr4[i4][iArr5[i4]];
|
||||
}
|
||||
try {
|
||||
return a(iArr, i, iArr2);
|
||||
} catch (ChecksumException unused) {
|
||||
if (iArr5.length == 0) {
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
int i5 = 0;
|
||||
while (true) {
|
||||
if (i5 >= iArr5.length) {
|
||||
break;
|
||||
}
|
||||
if (iArr5[i5] < iArr4[i5].length - 1) {
|
||||
iArr5[i5] = iArr5[i5] + 1;
|
||||
break;
|
||||
}
|
||||
iArr5[i5] = 0;
|
||||
if (i5 == iArr5.length - 1) {
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
i5++;
|
||||
}
|
||||
i2 = i3;
|
||||
}
|
||||
} else {
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static BarcodeValue[][] a(DetectionResult detectionResult) {
|
||||
int c;
|
||||
BarcodeValue[][] barcodeValueArr = (BarcodeValue[][]) Array.newInstance((Class<?>) BarcodeValue.class, detectionResult.c(), detectionResult.a() + 2);
|
||||
for (int i = 0; i < barcodeValueArr.length; i++) {
|
||||
for (int i2 = 0; i2 < barcodeValueArr[i].length; i2++) {
|
||||
barcodeValueArr[i][i2] = new BarcodeValue();
|
||||
}
|
||||
}
|
||||
int i3 = 0;
|
||||
for (DetectionResultColumn detectionResultColumn : detectionResult.e()) {
|
||||
if (detectionResultColumn != null) {
|
||||
for (Codeword codeword : detectionResultColumn.b()) {
|
||||
if (codeword != null && (c = codeword.c()) >= 0 && c < barcodeValueArr.length) {
|
||||
barcodeValueArr[c][i3].a(codeword.e());
|
||||
}
|
||||
}
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
return barcodeValueArr;
|
||||
}
|
||||
|
||||
private static boolean a(DetectionResult detectionResult, int i) {
|
||||
return i >= 0 && i <= detectionResult.a() + 1;
|
||||
}
|
||||
|
||||
private static int a(DetectionResult detectionResult, int i, int i2, boolean z) {
|
||||
int i3 = z ? 1 : -1;
|
||||
int i4 = i - i3;
|
||||
Codeword a2 = a(detectionResult, i4) ? detectionResult.a(i4).a(i2) : null;
|
||||
if (a2 != null) {
|
||||
return z ? a2.b() : a2.d();
|
||||
}
|
||||
Codeword b = detectionResult.a(i).b(i2);
|
||||
if (b != null) {
|
||||
return z ? b.d() : b.b();
|
||||
}
|
||||
if (a(detectionResult, i4)) {
|
||||
b = detectionResult.a(i4).b(i2);
|
||||
}
|
||||
if (b != null) {
|
||||
return z ? b.b() : b.d();
|
||||
}
|
||||
int i5 = 0;
|
||||
while (true) {
|
||||
i -= i3;
|
||||
if (a(detectionResult, i)) {
|
||||
for (Codeword codeword : detectionResult.a(i).b()) {
|
||||
if (codeword != null) {
|
||||
return (z ? codeword.b() : codeword.d()) + (i3 * i5 * (codeword.b() - codeword.d()));
|
||||
}
|
||||
}
|
||||
i5++;
|
||||
} else {
|
||||
BoundingBox d = detectionResult.d();
|
||||
return z ? d.e() : d.c();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static Codeword a(BitMatrix bitMatrix, int i, int i2, boolean z, int i3, int i4, int i5, int i6) {
|
||||
int i7;
|
||||
int d;
|
||||
int a2;
|
||||
int a3 = a(bitMatrix, i, i2, z, i3, i4);
|
||||
int[] b = b(bitMatrix, i, i2, z, a3, i4);
|
||||
if (b == null) {
|
||||
return null;
|
||||
}
|
||||
int a4 = MathUtils.a(b);
|
||||
if (z) {
|
||||
a3 += a4;
|
||||
i7 = a3;
|
||||
} else {
|
||||
for (int i8 = 0; i8 < b.length / 2; i8++) {
|
||||
int i9 = b[i8];
|
||||
b[i8] = b[(b.length - 1) - i8];
|
||||
b[(b.length - 1) - i8] = i9;
|
||||
}
|
||||
i7 = a3 - a4;
|
||||
}
|
||||
if (a(a4, i5, i6) && (a2 = PDF417Common.a((d = PDF417CodewordDecoder.d(b)))) != -1) {
|
||||
return new Codeword(i7, a3, b(d), a2);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/* JADX WARN: Code restructure failed: missing block: B:16:0x0023, code lost:
|
||||
|
||||
continue;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:17:0x0023, code lost:
|
||||
|
||||
r0 = -r0;
|
||||
r2 = !r2;
|
||||
r1 = r1 + 1;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:18:0x0023, code lost:
|
||||
|
||||
continue;
|
||||
*/
|
||||
/* JADX WARN: Code restructure failed: missing block: B:20:0x0023, code lost:
|
||||
|
||||
continue;
|
||||
*/
|
||||
/* JADX WARN: Removed duplicated region for block: B:10:0x0018 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
private static int a(com.google.zxing.common.BitMatrix r5, int r6, int r7, boolean r8, int r9, int r10) {
|
||||
/*
|
||||
if (r8 == 0) goto L4
|
||||
r0 = -1
|
||||
goto L5
|
||||
L4:
|
||||
r0 = 1
|
||||
L5:
|
||||
r1 = 0
|
||||
r2 = r8
|
||||
r8 = r9
|
||||
L8:
|
||||
r3 = 2
|
||||
if (r1 >= r3) goto L29
|
||||
Lb:
|
||||
if (r2 == 0) goto L10
|
||||
if (r8 < r6) goto L23
|
||||
goto L12
|
||||
L10:
|
||||
if (r8 >= r7) goto L23
|
||||
L12:
|
||||
boolean r4 = r5.b(r8, r10)
|
||||
if (r2 != r4) goto L23
|
||||
int r4 = r9 - r8
|
||||
int r4 = java.lang.Math.abs(r4)
|
||||
if (r4 <= r3) goto L21
|
||||
return r9
|
||||
L21:
|
||||
int r8 = r8 + r0
|
||||
goto Lb
|
||||
L23:
|
||||
int r0 = -r0
|
||||
r2 = r2 ^ 1
|
||||
int r1 = r1 + 1
|
||||
goto L8
|
||||
L29:
|
||||
return r8
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.pdf417.decoder.PDF417ScanningDecoder.a(com.google.zxing.common.BitMatrix, int, int, boolean, int, int):int");
|
||||
}
|
||||
|
||||
private static DecoderResult a(int[] iArr, int i, int[] iArr2) throws FormatException, ChecksumException {
|
||||
if (iArr.length != 0) {
|
||||
int i2 = 1 << (i + 1);
|
||||
int a2 = a(iArr, iArr2, i2);
|
||||
a(iArr, i2);
|
||||
DecoderResult a3 = DecodedBitStreamParser.a(iArr, String.valueOf(i));
|
||||
a3.b(Integer.valueOf(a2));
|
||||
a3.a(Integer.valueOf(iArr2.length));
|
||||
return a3;
|
||||
}
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
|
||||
private static int a(int[] iArr, int[] iArr2, int i) throws ChecksumException {
|
||||
if ((iArr2 == null || iArr2.length <= (i / 2) + 3) && i >= 0 && i <= 512) {
|
||||
return a.a(iArr, i, iArr2);
|
||||
}
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
|
||||
private static void a(int[] iArr, int i) throws FormatException {
|
||||
if (iArr.length >= 4) {
|
||||
int i2 = iArr[0];
|
||||
if (i2 > iArr.length) {
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
if (i2 == 0) {
|
||||
if (i < iArr.length) {
|
||||
iArr[0] = iArr.length - i;
|
||||
return;
|
||||
}
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
return;
|
||||
}
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
|
||||
private static int[] a(int i) {
|
||||
int[] iArr = new int[8];
|
||||
int i2 = 0;
|
||||
int i3 = 7;
|
||||
while (true) {
|
||||
int i4 = i & 1;
|
||||
if (i4 != i2) {
|
||||
i3--;
|
||||
if (i3 < 0) {
|
||||
return iArr;
|
||||
}
|
||||
i2 = i4;
|
||||
}
|
||||
iArr[i3] = iArr[i3] + 1;
|
||||
i >>= 1;
|
||||
}
|
||||
}
|
||||
|
||||
private static int a(int[] iArr) {
|
||||
return ((((iArr[0] - iArr[2]) + iArr[4]) - iArr[6]) + 9) % 9;
|
||||
}
|
||||
}
|
117
sources/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java
Normal file
117
sources/com/google/zxing/pdf417/decoder/ec/ErrorCorrection.java
Normal file
@@ -0,0 +1,117 @@
|
||||
package com.google.zxing.pdf417.decoder.ec;
|
||||
|
||||
import com.google.zxing.ChecksumException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ErrorCorrection {
|
||||
private final ModulusGF a = ModulusGF.f;
|
||||
|
||||
public int a(int[] iArr, int i, int[] iArr2) throws ChecksumException {
|
||||
ModulusPoly modulusPoly = new ModulusPoly(this.a, iArr);
|
||||
int[] iArr3 = new int[i];
|
||||
boolean z = false;
|
||||
for (int i2 = i; i2 > 0; i2--) {
|
||||
int a = modulusPoly.a(this.a.a(i2));
|
||||
iArr3[i - i2] = a;
|
||||
if (a != 0) {
|
||||
z = true;
|
||||
}
|
||||
}
|
||||
if (!z) {
|
||||
return 0;
|
||||
}
|
||||
ModulusPoly a2 = this.a.a();
|
||||
if (iArr2 != null) {
|
||||
ModulusPoly modulusPoly2 = a2;
|
||||
for (int i3 : iArr2) {
|
||||
int a3 = this.a.a((iArr.length - 1) - i3);
|
||||
ModulusGF modulusGF = this.a;
|
||||
modulusPoly2 = modulusPoly2.b(new ModulusPoly(modulusGF, new int[]{modulusGF.d(0, a3), 1}));
|
||||
}
|
||||
}
|
||||
ModulusPoly[] a4 = a(this.a.b(i, 1), new ModulusPoly(this.a, iArr3), i);
|
||||
ModulusPoly modulusPoly3 = a4[0];
|
||||
ModulusPoly modulusPoly4 = a4[1];
|
||||
int[] a5 = a(modulusPoly3);
|
||||
int[] a6 = a(modulusPoly4, modulusPoly3, a5);
|
||||
for (int i4 = 0; i4 < a5.length; i4++) {
|
||||
int length = (iArr.length - 1) - this.a.c(a5[i4]);
|
||||
if (length < 0) {
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
iArr[length] = this.a.d(iArr[length], a6[i4]);
|
||||
}
|
||||
return a5.length;
|
||||
}
|
||||
|
||||
private ModulusPoly[] a(ModulusPoly modulusPoly, ModulusPoly modulusPoly2, int i) throws ChecksumException {
|
||||
if (modulusPoly.a() < modulusPoly2.a()) {
|
||||
modulusPoly2 = modulusPoly;
|
||||
modulusPoly = modulusPoly2;
|
||||
}
|
||||
ModulusPoly c = this.a.c();
|
||||
ModulusPoly a = this.a.a();
|
||||
while (true) {
|
||||
ModulusPoly modulusPoly3 = modulusPoly2;
|
||||
modulusPoly2 = modulusPoly;
|
||||
modulusPoly = modulusPoly3;
|
||||
ModulusPoly modulusPoly4 = a;
|
||||
ModulusPoly modulusPoly5 = c;
|
||||
c = modulusPoly4;
|
||||
if (modulusPoly.a() >= i / 2) {
|
||||
if (!modulusPoly.b()) {
|
||||
ModulusPoly c2 = this.a.c();
|
||||
int b = this.a.b(modulusPoly.b(modulusPoly.a()));
|
||||
while (modulusPoly2.a() >= modulusPoly.a() && !modulusPoly2.b()) {
|
||||
int a2 = modulusPoly2.a() - modulusPoly.a();
|
||||
int c3 = this.a.c(modulusPoly2.b(modulusPoly2.a()), b);
|
||||
c2 = c2.a(this.a.b(a2, c3));
|
||||
modulusPoly2 = modulusPoly2.c(modulusPoly.a(a2, c3));
|
||||
}
|
||||
a = c2.b(c).c(modulusPoly5).c();
|
||||
} else {
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
} else {
|
||||
int b2 = c.b(0);
|
||||
if (b2 != 0) {
|
||||
int b3 = this.a.b(b2);
|
||||
return new ModulusPoly[]{c.c(b3), modulusPoly.c(b3)};
|
||||
}
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private int[] a(ModulusPoly modulusPoly) throws ChecksumException {
|
||||
int a = modulusPoly.a();
|
||||
int[] iArr = new int[a];
|
||||
int i = 0;
|
||||
for (int i2 = 1; i2 < this.a.b() && i < a; i2++) {
|
||||
if (modulusPoly.a(i2) == 0) {
|
||||
iArr[i] = this.a.b(i2);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
if (i == a) {
|
||||
return iArr;
|
||||
}
|
||||
throw ChecksumException.getChecksumInstance();
|
||||
}
|
||||
|
||||
private int[] a(ModulusPoly modulusPoly, ModulusPoly modulusPoly2, int[] iArr) {
|
||||
int a = modulusPoly2.a();
|
||||
int[] iArr2 = new int[a];
|
||||
for (int i = 1; i <= a; i++) {
|
||||
iArr2[a - i] = this.a.c(i, modulusPoly2.b(i));
|
||||
}
|
||||
ModulusPoly modulusPoly3 = new ModulusPoly(this.a, iArr2);
|
||||
int length = iArr.length;
|
||||
int[] iArr3 = new int[length];
|
||||
for (int i2 = 0; i2 < length; i2++) {
|
||||
int b = this.a.b(iArr[i2]);
|
||||
iArr3[i2] = this.a.c(this.a.d(0, modulusPoly.a(b)), this.a.b(modulusPoly3.a(b)));
|
||||
}
|
||||
return iArr3;
|
||||
}
|
||||
}
|
87
sources/com/google/zxing/pdf417/decoder/ec/ModulusGF.java
Normal file
87
sources/com/google/zxing/pdf417/decoder/ec/ModulusGF.java
Normal file
@@ -0,0 +1,87 @@
|
||||
package com.google.zxing.pdf417.decoder.ec;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class ModulusGF {
|
||||
public static final ModulusGF f = new ModulusGF(929, 3);
|
||||
private final int[] a;
|
||||
private final int[] b;
|
||||
private final ModulusPoly c;
|
||||
private final ModulusPoly d;
|
||||
private final int e;
|
||||
|
||||
private ModulusGF(int i, int i2) {
|
||||
this.e = i;
|
||||
this.a = new int[i];
|
||||
this.b = new int[i];
|
||||
int i3 = 1;
|
||||
for (int i4 = 0; i4 < i; i4++) {
|
||||
this.a[i4] = i3;
|
||||
i3 = (i3 * i2) % i;
|
||||
}
|
||||
for (int i5 = 0; i5 < i - 1; i5++) {
|
||||
this.b[this.a[i5]] = i5;
|
||||
}
|
||||
this.c = new ModulusPoly(this, new int[]{0});
|
||||
this.d = new ModulusPoly(this, new int[]{1});
|
||||
}
|
||||
|
||||
ModulusPoly a() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
ModulusPoly b(int i, int i2) {
|
||||
if (i < 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (i2 == 0) {
|
||||
return this.c;
|
||||
}
|
||||
int[] iArr = new int[i + 1];
|
||||
iArr[0] = i2;
|
||||
return new ModulusPoly(this, iArr);
|
||||
}
|
||||
|
||||
ModulusPoly c() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
int d(int i, int i2) {
|
||||
int i3 = this.e;
|
||||
return ((i + i3) - i2) % i3;
|
||||
}
|
||||
|
||||
int a(int i, int i2) {
|
||||
return (i + i2) % this.e;
|
||||
}
|
||||
|
||||
int c(int i) {
|
||||
if (i != 0) {
|
||||
return this.b[i];
|
||||
}
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
|
||||
int a(int i) {
|
||||
return this.a[i];
|
||||
}
|
||||
|
||||
int c(int i, int i2) {
|
||||
if (i == 0 || i2 == 0) {
|
||||
return 0;
|
||||
}
|
||||
int[] iArr = this.a;
|
||||
int[] iArr2 = this.b;
|
||||
return iArr[(iArr2[i] + iArr2[i2]) % (this.e - 1)];
|
||||
}
|
||||
|
||||
int b(int i) {
|
||||
if (i != 0) {
|
||||
return this.a[(this.e - this.b[i]) - 1];
|
||||
}
|
||||
throw new ArithmeticException();
|
||||
}
|
||||
|
||||
int b() {
|
||||
return this.e;
|
||||
}
|
||||
}
|
184
sources/com/google/zxing/pdf417/decoder/ec/ModulusPoly.java
Normal file
184
sources/com/google/zxing/pdf417/decoder/ec/ModulusPoly.java
Normal file
@@ -0,0 +1,184 @@
|
||||
package com.google.zxing.pdf417.decoder.ec;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class ModulusPoly {
|
||||
private final ModulusGF a;
|
||||
private final int[] b;
|
||||
|
||||
ModulusPoly(ModulusGF modulusGF, int[] iArr) {
|
||||
if (iArr.length == 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
this.a = modulusGF;
|
||||
int length = iArr.length;
|
||||
if (length <= 1 || iArr[0] != 0) {
|
||||
this.b = iArr;
|
||||
return;
|
||||
}
|
||||
int i = 1;
|
||||
while (i < length && iArr[i] == 0) {
|
||||
i++;
|
||||
}
|
||||
if (i == length) {
|
||||
this.b = new int[]{0};
|
||||
return;
|
||||
}
|
||||
this.b = new int[length - i];
|
||||
int[] iArr2 = this.b;
|
||||
System.arraycopy(iArr, i, iArr2, 0, iArr2.length);
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.b.length - 1;
|
||||
}
|
||||
|
||||
boolean b() {
|
||||
return this.b[0] == 0;
|
||||
}
|
||||
|
||||
ModulusPoly c(ModulusPoly modulusPoly) {
|
||||
if (this.a.equals(modulusPoly.a)) {
|
||||
return modulusPoly.b() ? this : a(modulusPoly.c());
|
||||
}
|
||||
throw new IllegalArgumentException("ModulusPolys do not have same ModulusGF field");
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder(a() * 8);
|
||||
for (int a = a(); a >= 0; a--) {
|
||||
int b = b(a);
|
||||
if (b != 0) {
|
||||
if (b < 0) {
|
||||
sb.append(" - ");
|
||||
b = -b;
|
||||
} else if (sb.length() > 0) {
|
||||
sb.append(" + ");
|
||||
}
|
||||
if (a == 0 || b != 1) {
|
||||
sb.append(b);
|
||||
}
|
||||
if (a != 0) {
|
||||
if (a == 1) {
|
||||
sb.append('x');
|
||||
} else {
|
||||
sb.append("x^");
|
||||
sb.append(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
int a(int i) {
|
||||
if (i == 0) {
|
||||
return b(0);
|
||||
}
|
||||
if (i == 1) {
|
||||
int i2 = 0;
|
||||
for (int i3 : this.b) {
|
||||
i2 = this.a.a(i2, i3);
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
int[] iArr = this.b;
|
||||
int i4 = iArr[0];
|
||||
int length = iArr.length;
|
||||
for (int i5 = 1; i5 < length; i5++) {
|
||||
ModulusGF modulusGF = this.a;
|
||||
i4 = modulusGF.a(modulusGF.c(i, i4), this.b[i5]);
|
||||
}
|
||||
return i4;
|
||||
}
|
||||
|
||||
int b(int i) {
|
||||
return this.b[(r0.length - 1) - i];
|
||||
}
|
||||
|
||||
ModulusPoly b(ModulusPoly modulusPoly) {
|
||||
if (this.a.equals(modulusPoly.a)) {
|
||||
if (!b() && !modulusPoly.b()) {
|
||||
int[] iArr = this.b;
|
||||
int length = iArr.length;
|
||||
int[] iArr2 = modulusPoly.b;
|
||||
int length2 = iArr2.length;
|
||||
int[] iArr3 = new int[(length + length2) - 1];
|
||||
for (int i = 0; i < length; i++) {
|
||||
int i2 = iArr[i];
|
||||
for (int i3 = 0; i3 < length2; i3++) {
|
||||
int i4 = i + i3;
|
||||
ModulusGF modulusGF = this.a;
|
||||
iArr3[i4] = modulusGF.a(iArr3[i4], modulusGF.c(i2, iArr2[i3]));
|
||||
}
|
||||
}
|
||||
return new ModulusPoly(this.a, iArr3);
|
||||
}
|
||||
return this.a.c();
|
||||
}
|
||||
throw new IllegalArgumentException("ModulusPolys do not have same ModulusGF field");
|
||||
}
|
||||
|
||||
ModulusPoly c() {
|
||||
int length = this.b.length;
|
||||
int[] iArr = new int[length];
|
||||
for (int i = 0; i < length; i++) {
|
||||
iArr[i] = this.a.d(0, this.b[i]);
|
||||
}
|
||||
return new ModulusPoly(this.a, iArr);
|
||||
}
|
||||
|
||||
ModulusPoly a(ModulusPoly modulusPoly) {
|
||||
if (this.a.equals(modulusPoly.a)) {
|
||||
if (b()) {
|
||||
return modulusPoly;
|
||||
}
|
||||
if (modulusPoly.b()) {
|
||||
return this;
|
||||
}
|
||||
int[] iArr = this.b;
|
||||
int[] iArr2 = modulusPoly.b;
|
||||
if (iArr.length > iArr2.length) {
|
||||
iArr = iArr2;
|
||||
iArr2 = iArr;
|
||||
}
|
||||
int[] iArr3 = new int[iArr2.length];
|
||||
int length = iArr2.length - iArr.length;
|
||||
System.arraycopy(iArr2, 0, iArr3, 0, length);
|
||||
for (int i = length; i < iArr2.length; i++) {
|
||||
iArr3[i] = this.a.a(iArr[i - length], iArr2[i]);
|
||||
}
|
||||
return new ModulusPoly(this.a, iArr3);
|
||||
}
|
||||
throw new IllegalArgumentException("ModulusPolys do not have same ModulusGF field");
|
||||
}
|
||||
|
||||
ModulusPoly c(int i) {
|
||||
if (i == 0) {
|
||||
return this.a.c();
|
||||
}
|
||||
if (i == 1) {
|
||||
return this;
|
||||
}
|
||||
int length = this.b.length;
|
||||
int[] iArr = new int[length];
|
||||
for (int i2 = 0; i2 < length; i2++) {
|
||||
iArr[i2] = this.a.c(this.b[i2], i);
|
||||
}
|
||||
return new ModulusPoly(this.a, iArr);
|
||||
}
|
||||
|
||||
ModulusPoly a(int i, int i2) {
|
||||
if (i < 0) {
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
if (i2 == 0) {
|
||||
return this.a.c();
|
||||
}
|
||||
int length = this.b.length;
|
||||
int[] iArr = new int[i + length];
|
||||
for (int i3 = 0; i3 < length; i3++) {
|
||||
iArr[i3] = this.a.c(this.b[i3], i2);
|
||||
}
|
||||
return new ModulusPoly(this.a, iArr);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user