Initial commit
This commit is contained in:
31
sources/com/google/zxing/aztec/AztecDetectorResult.java
Normal file
31
sources/com/google/zxing/aztec/AztecDetectorResult.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package com.google.zxing.aztec;
|
||||
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.common.DetectorResult;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AztecDetectorResult extends DetectorResult {
|
||||
private final boolean c;
|
||||
private final int d;
|
||||
private final int e;
|
||||
|
||||
public AztecDetectorResult(BitMatrix bitMatrix, ResultPoint[] resultPointArr, boolean z, int i, int i2) {
|
||||
super(bitMatrix, resultPointArr);
|
||||
this.c = z;
|
||||
this.d = i;
|
||||
this.e = i2;
|
||||
}
|
||||
|
||||
public int c() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
public int d() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public boolean e() {
|
||||
return this.c;
|
||||
}
|
||||
}
|
118
sources/com/google/zxing/aztec/AztecReader.java
Normal file
118
sources/com/google/zxing/aztec/AztecReader.java
Normal file
@@ -0,0 +1,118 @@
|
||||
package com.google.zxing.aztec;
|
||||
|
||||
import com.google.zxing.Reader;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AztecReader implements Reader {
|
||||
/* JADX WARN: Removed duplicated region for block: B:21:0x0051 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:25:0x005e A[LOOP:0: B:24:0x005c->B:25:0x005e, LOOP_END] */
|
||||
/* JADX WARN: Removed duplicated region for block: B:29:0x0084 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:32:0x008f */
|
||||
/* JADX WARN: Removed duplicated region for block: B:8:0x0031 */
|
||||
@Override // com.google.zxing.Reader
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public com.google.zxing.Result a(com.google.zxing.BinaryBitmap r13, java.util.Map<com.google.zxing.DecodeHintType, ?> r14) throws com.google.zxing.NotFoundException, com.google.zxing.FormatException {
|
||||
/*
|
||||
r12 = this;
|
||||
com.google.zxing.aztec.detector.Detector r0 = new com.google.zxing.aztec.detector.Detector
|
||||
com.google.zxing.common.BitMatrix r13 = r13.a()
|
||||
r0.<init>(r13)
|
||||
r13 = 0
|
||||
r1 = 0
|
||||
com.google.zxing.aztec.AztecDetectorResult r2 = r0.a(r13) // Catch: com.google.zxing.FormatException -> L25 com.google.zxing.NotFoundException -> L2b
|
||||
com.google.zxing.ResultPoint[] r3 = r2.b() // Catch: com.google.zxing.FormatException -> L25 com.google.zxing.NotFoundException -> L2b
|
||||
com.google.zxing.aztec.decoder.Decoder r4 = new com.google.zxing.aztec.decoder.Decoder // Catch: com.google.zxing.FormatException -> L21 com.google.zxing.NotFoundException -> L23
|
||||
r4.<init>() // Catch: com.google.zxing.FormatException -> L21 com.google.zxing.NotFoundException -> L23
|
||||
com.google.zxing.common.DecoderResult r2 = r4.a(r2) // Catch: com.google.zxing.FormatException -> L21 com.google.zxing.NotFoundException -> L23
|
||||
r4 = r3
|
||||
r3 = r1
|
||||
r1 = r2
|
||||
r2 = r3
|
||||
goto L2f
|
||||
L21:
|
||||
r2 = move-exception
|
||||
goto L27
|
||||
L23:
|
||||
r2 = move-exception
|
||||
goto L2d
|
||||
L25:
|
||||
r2 = move-exception
|
||||
r3 = r1
|
||||
L27:
|
||||
r4 = r3
|
||||
r3 = r2
|
||||
r2 = r1
|
||||
goto L2f
|
||||
L2b:
|
||||
r2 = move-exception
|
||||
r3 = r1
|
||||
L2d:
|
||||
r4 = r3
|
||||
r3 = r1
|
||||
L2f:
|
||||
if (r1 != 0) goto L4e
|
||||
r1 = 1
|
||||
com.google.zxing.aztec.AztecDetectorResult r0 = r0.a(r1) // Catch: com.google.zxing.FormatException -> L44 com.google.zxing.NotFoundException -> L46
|
||||
com.google.zxing.ResultPoint[] r4 = r0.b() // Catch: com.google.zxing.FormatException -> L44 com.google.zxing.NotFoundException -> L46
|
||||
com.google.zxing.aztec.decoder.Decoder r1 = new com.google.zxing.aztec.decoder.Decoder // Catch: com.google.zxing.FormatException -> L44 com.google.zxing.NotFoundException -> L46
|
||||
r1.<init>() // Catch: com.google.zxing.FormatException -> L44 com.google.zxing.NotFoundException -> L46
|
||||
com.google.zxing.common.DecoderResult r1 = r1.a(r0) // Catch: com.google.zxing.FormatException -> L44 com.google.zxing.NotFoundException -> L46
|
||||
goto L4e
|
||||
L44:
|
||||
r13 = move-exception
|
||||
goto L47
|
||||
L46:
|
||||
r13 = move-exception
|
||||
L47:
|
||||
if (r2 != 0) goto L4d
|
||||
if (r3 == 0) goto L4c
|
||||
throw r3
|
||||
L4c:
|
||||
throw r13
|
||||
L4d:
|
||||
throw r2
|
||||
L4e:
|
||||
r8 = r4
|
||||
if (r14 == 0) goto L66
|
||||
com.google.zxing.DecodeHintType r0 = com.google.zxing.DecodeHintType.NEED_RESULT_POINT_CALLBACK
|
||||
java.lang.Object r14 = r14.get(r0)
|
||||
com.google.zxing.ResultPointCallback r14 = (com.google.zxing.ResultPointCallback) r14
|
||||
if (r14 == 0) goto L66
|
||||
int r0 = r8.length
|
||||
L5c:
|
||||
if (r13 >= r0) goto L66
|
||||
r2 = r8[r13]
|
||||
r14.a(r2)
|
||||
int r13 = r13 + 1
|
||||
goto L5c
|
||||
L66:
|
||||
com.google.zxing.Result r13 = new com.google.zxing.Result
|
||||
java.lang.String r5 = r1.h()
|
||||
byte[] r6 = r1.e()
|
||||
int r7 = r1.c()
|
||||
com.google.zxing.BarcodeFormat r9 = com.google.zxing.BarcodeFormat.AZTEC
|
||||
long r10 = java.lang.System.currentTimeMillis()
|
||||
r4 = r13
|
||||
r4.<init>(r5, r6, r7, r8, r9, r10)
|
||||
java.util.List r14 = r1.a()
|
||||
if (r14 == 0) goto L89
|
||||
com.google.zxing.ResultMetadataType r0 = com.google.zxing.ResultMetadataType.BYTE_SEGMENTS
|
||||
r13.a(r0, r14)
|
||||
L89:
|
||||
java.lang.String r14 = r1.b()
|
||||
if (r14 == 0) goto L94
|
||||
com.google.zxing.ResultMetadataType r0 = com.google.zxing.ResultMetadataType.ERROR_CORRECTION_LEVEL
|
||||
r13.a(r0, r14)
|
||||
L94:
|
||||
return r13
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.aztec.AztecReader.a(com.google.zxing.BinaryBitmap, java.util.Map):com.google.zxing.Result");
|
||||
}
|
||||
|
||||
@Override // com.google.zxing.Reader
|
||||
public void reset() {
|
||||
}
|
||||
}
|
78
sources/com/google/zxing/aztec/AztecWriter.java
Normal file
78
sources/com/google/zxing/aztec/AztecWriter.java
Normal file
@@ -0,0 +1,78 @@
|
||||
package com.google.zxing.aztec;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.EncodeHintType;
|
||||
import com.google.zxing.Writer;
|
||||
import com.google.zxing.aztec.encoder.AztecCode;
|
||||
import com.google.zxing.aztec.encoder.Encoder;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Map;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AztecWriter implements Writer {
|
||||
@Override // com.google.zxing.Writer
|
||||
public BitMatrix a(String str, BarcodeFormat barcodeFormat, int i, int i2, Map<EncodeHintType, ?> map) {
|
||||
Charset charset;
|
||||
int i3;
|
||||
int i4;
|
||||
Charset charset2 = StandardCharsets.ISO_8859_1;
|
||||
if (map != null) {
|
||||
if (map.containsKey(EncodeHintType.CHARACTER_SET)) {
|
||||
charset2 = Charset.forName(map.get(EncodeHintType.CHARACTER_SET).toString());
|
||||
}
|
||||
int parseInt = map.containsKey(EncodeHintType.ERROR_CORRECTION) ? Integer.parseInt(map.get(EncodeHintType.ERROR_CORRECTION).toString()) : 33;
|
||||
if (map.containsKey(EncodeHintType.AZTEC_LAYERS)) {
|
||||
charset = charset2;
|
||||
i3 = parseInt;
|
||||
i4 = Integer.parseInt(map.get(EncodeHintType.AZTEC_LAYERS).toString());
|
||||
return a(str, barcodeFormat, i, i2, charset, i3, i4);
|
||||
}
|
||||
charset = charset2;
|
||||
i3 = parseInt;
|
||||
} else {
|
||||
charset = charset2;
|
||||
i3 = 33;
|
||||
}
|
||||
i4 = 0;
|
||||
return a(str, barcodeFormat, i, i2, charset, i3, i4);
|
||||
}
|
||||
|
||||
private static BitMatrix a(String str, BarcodeFormat barcodeFormat, int i, int i2, Charset charset, int i3, int i4) {
|
||||
if (barcodeFormat == BarcodeFormat.AZTEC) {
|
||||
return a(Encoder.a(str.getBytes(charset), i3, i4), i, i2);
|
||||
}
|
||||
throw new IllegalArgumentException("Can only encode AZTEC, but got ".concat(String.valueOf(barcodeFormat)));
|
||||
}
|
||||
|
||||
private static BitMatrix a(AztecCode aztecCode, int i, int i2) {
|
||||
BitMatrix a = aztecCode.a();
|
||||
if (a != null) {
|
||||
int k = a.k();
|
||||
int i3 = a.i();
|
||||
int max = Math.max(i, k);
|
||||
int max2 = Math.max(i2, i3);
|
||||
int min = Math.min(max / k, max2 / i3);
|
||||
int i4 = (max - (k * min)) / 2;
|
||||
int i5 = (max2 - (i3 * min)) / 2;
|
||||
BitMatrix bitMatrix = new BitMatrix(max, max2);
|
||||
int i6 = 0;
|
||||
while (i6 < i3) {
|
||||
int i7 = i4;
|
||||
int i8 = 0;
|
||||
while (i8 < k) {
|
||||
if (a.b(i8, i6)) {
|
||||
bitMatrix.a(i7, i5, min, min);
|
||||
}
|
||||
i8++;
|
||||
i7 += min;
|
||||
}
|
||||
i6++;
|
||||
i5 += min;
|
||||
}
|
||||
return bitMatrix;
|
||||
}
|
||||
throw new IllegalStateException();
|
||||
}
|
||||
}
|
317
sources/com/google/zxing/aztec/decoder/Decoder.java
Normal file
317
sources/com/google/zxing/aztec/decoder/Decoder.java
Normal file
@@ -0,0 +1,317 @@
|
||||
package com.google.zxing.aztec.decoder;
|
||||
|
||||
import com.google.zxing.FormatException;
|
||||
import com.google.zxing.aztec.AztecDetectorResult;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.common.DecoderResult;
|
||||
import com.google.zxing.common.reedsolomon.GenericGF;
|
||||
import com.google.zxing.common.reedsolomon.ReedSolomonDecoder;
|
||||
import com.google.zxing.common.reedsolomon.ReedSolomonException;
|
||||
import com.ubt.jimu.message.OfficalMsgBean;
|
||||
import java.util.Arrays;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Decoder {
|
||||
private static final String[] b = {"CTRL_PS", " ", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "CTRL_LL", "CTRL_ML", "CTRL_DL", "CTRL_BS"};
|
||||
private static final String[] c = {"CTRL_PS", " ", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "CTRL_US", "CTRL_ML", "CTRL_DL", "CTRL_BS"};
|
||||
private static final String[] d = {"CTRL_PS", " ", "\u0001", "\u0002", "\u0003", "\u0004", "\u0005", "\u0006", "\u0007", "\b", "\t", "\n", "\u000b", "\f", "\r", "\u001b", "\u001c", "\u001d", "\u001e", "\u001f", "@", "\\", "^", "_", "`", "|", "~", "\u007f", "CTRL_LL", "CTRL_UL", "CTRL_PL", "CTRL_BS"};
|
||||
private static final String[] e = {"", "\r", "\r\n", ". ", ", ", ": ", "!", "\"", "#", "$", "%", "&", "'", "(", ")", "*", "+", ",", "-", ".", "/", ":", ";", "<", "=", ">", "?", "[", "]", "{", "}", "CTRL_UL"};
|
||||
private static final String[] f = {"CTRL_PS", " ", "0", "1", "2", "3", "4", "5", OfficalMsgBean.TYPE_ONLINE, "7", "8", "9", ",", ".", "CTRL_UL", "CTRL_US"};
|
||||
private AztecDetectorResult a;
|
||||
|
||||
/* renamed from: com.google.zxing.aztec.decoder.Decoder$1, reason: invalid class name */
|
||||
static /* synthetic */ class AnonymousClass1 {
|
||||
static final /* synthetic */ int[] a = new int[Table.values().length];
|
||||
|
||||
static {
|
||||
try {
|
||||
a[Table.UPPER.ordinal()] = 1;
|
||||
} catch (NoSuchFieldError unused) {
|
||||
}
|
||||
try {
|
||||
a[Table.LOWER.ordinal()] = 2;
|
||||
} catch (NoSuchFieldError unused2) {
|
||||
}
|
||||
try {
|
||||
a[Table.MIXED.ordinal()] = 3;
|
||||
} catch (NoSuchFieldError unused3) {
|
||||
}
|
||||
try {
|
||||
a[Table.PUNCT.ordinal()] = 4;
|
||||
} catch (NoSuchFieldError unused4) {
|
||||
}
|
||||
try {
|
||||
a[Table.DIGIT.ordinal()] = 5;
|
||||
} catch (NoSuchFieldError unused5) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private enum Table {
|
||||
UPPER,
|
||||
LOWER,
|
||||
MIXED,
|
||||
DIGIT,
|
||||
PUNCT,
|
||||
BINARY
|
||||
}
|
||||
|
||||
private static int a(int i, boolean z) {
|
||||
return ((z ? 88 : 112) + (i << 4)) * i;
|
||||
}
|
||||
|
||||
private boolean[] b(boolean[] zArr) throws FormatException {
|
||||
GenericGF genericGF;
|
||||
int i = 8;
|
||||
if (this.a.d() <= 2) {
|
||||
i = 6;
|
||||
genericGF = GenericGF.j;
|
||||
} else if (this.a.d() <= 8) {
|
||||
genericGF = GenericGF.n;
|
||||
} else if (this.a.d() <= 22) {
|
||||
i = 10;
|
||||
genericGF = GenericGF.i;
|
||||
} else {
|
||||
i = 12;
|
||||
genericGF = GenericGF.h;
|
||||
}
|
||||
int c2 = this.a.c();
|
||||
int length = zArr.length / i;
|
||||
if (length < c2) {
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
int[] iArr = new int[length];
|
||||
int length2 = zArr.length % i;
|
||||
int i2 = 0;
|
||||
while (i2 < length) {
|
||||
iArr[i2] = a(zArr, length2, i);
|
||||
i2++;
|
||||
length2 += i;
|
||||
}
|
||||
try {
|
||||
new ReedSolomonDecoder(genericGF).a(iArr, length - c2);
|
||||
int i3 = (1 << i) - 1;
|
||||
int i4 = 0;
|
||||
for (int i5 = 0; i5 < c2; i5++) {
|
||||
int i6 = iArr[i5];
|
||||
if (i6 == 0 || i6 == i3) {
|
||||
throw FormatException.getFormatInstance();
|
||||
}
|
||||
if (i6 == 1 || i6 == i3 - 1) {
|
||||
i4++;
|
||||
}
|
||||
}
|
||||
boolean[] zArr2 = new boolean[(c2 * i) - i4];
|
||||
int i7 = 0;
|
||||
for (int i8 = 0; i8 < c2; i8++) {
|
||||
int i9 = iArr[i8];
|
||||
if (i9 == 1 || i9 == i3 - 1) {
|
||||
Arrays.fill(zArr2, i7, (i7 + i) - 1, i9 > 1);
|
||||
i7 += i - 1;
|
||||
} else {
|
||||
int i10 = i - 1;
|
||||
while (i10 >= 0) {
|
||||
int i11 = i7 + 1;
|
||||
zArr2[i7] = ((1 << i10) & i9) != 0;
|
||||
i10--;
|
||||
i7 = i11;
|
||||
}
|
||||
}
|
||||
}
|
||||
return zArr2;
|
||||
} catch (ReedSolomonException e2) {
|
||||
throw FormatException.getFormatInstance(e2);
|
||||
}
|
||||
}
|
||||
|
||||
private static String c(boolean[] zArr) {
|
||||
int length = zArr.length;
|
||||
Table table = Table.UPPER;
|
||||
StringBuilder sb = new StringBuilder(20);
|
||||
Table table2 = table;
|
||||
Table table3 = table2;
|
||||
int i = 0;
|
||||
while (i < length) {
|
||||
if (table2 != Table.BINARY) {
|
||||
int i2 = table2 == Table.DIGIT ? 4 : 5;
|
||||
if (length - i < i2) {
|
||||
break;
|
||||
}
|
||||
int a = a(zArr, i, i2);
|
||||
i += i2;
|
||||
String a2 = a(table2, a);
|
||||
if (a2.startsWith("CTRL_")) {
|
||||
table3 = a(a2.charAt(5));
|
||||
if (a2.charAt(6) != 'L') {
|
||||
table3 = table2;
|
||||
table2 = table3;
|
||||
}
|
||||
} else {
|
||||
sb.append(a2);
|
||||
}
|
||||
table2 = table3;
|
||||
} else {
|
||||
if (length - i < 5) {
|
||||
break;
|
||||
}
|
||||
int a3 = a(zArr, i, 5);
|
||||
int i3 = i + 5;
|
||||
if (a3 == 0) {
|
||||
if (length - i3 < 11) {
|
||||
break;
|
||||
}
|
||||
a3 = a(zArr, i3, 11) + 31;
|
||||
i3 += 11;
|
||||
}
|
||||
int i4 = i3;
|
||||
int i5 = 0;
|
||||
while (true) {
|
||||
if (i5 >= a3) {
|
||||
i = i4;
|
||||
break;
|
||||
}
|
||||
if (length - i4 < 8) {
|
||||
i = length;
|
||||
break;
|
||||
}
|
||||
sb.append((char) a(zArr, i4, 8));
|
||||
i4 += 8;
|
||||
i5++;
|
||||
}
|
||||
table2 = table3;
|
||||
}
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public DecoderResult a(AztecDetectorResult aztecDetectorResult) throws FormatException {
|
||||
this.a = aztecDetectorResult;
|
||||
boolean[] b2 = b(a(aztecDetectorResult.a()));
|
||||
DecoderResult decoderResult = new DecoderResult(a(b2), c(b2), null, null);
|
||||
decoderResult.a(b2.length);
|
||||
return decoderResult;
|
||||
}
|
||||
|
||||
private static Table a(char c2) {
|
||||
if (c2 == 'B') {
|
||||
return Table.BINARY;
|
||||
}
|
||||
if (c2 == 'D') {
|
||||
return Table.DIGIT;
|
||||
}
|
||||
if (c2 == 'P') {
|
||||
return Table.PUNCT;
|
||||
}
|
||||
if (c2 == 'L') {
|
||||
return Table.LOWER;
|
||||
}
|
||||
if (c2 != 'M') {
|
||||
return Table.UPPER;
|
||||
}
|
||||
return Table.MIXED;
|
||||
}
|
||||
|
||||
private static String a(Table table, int i) {
|
||||
int i2 = AnonymousClass1.a[table.ordinal()];
|
||||
if (i2 == 1) {
|
||||
return b[i];
|
||||
}
|
||||
if (i2 == 2) {
|
||||
return c[i];
|
||||
}
|
||||
if (i2 == 3) {
|
||||
return d[i];
|
||||
}
|
||||
if (i2 == 4) {
|
||||
return e[i];
|
||||
}
|
||||
if (i2 == 5) {
|
||||
return f[i];
|
||||
}
|
||||
throw new IllegalStateException("Bad table");
|
||||
}
|
||||
|
||||
private boolean[] a(BitMatrix bitMatrix) {
|
||||
boolean e2 = this.a.e();
|
||||
int d2 = this.a.d();
|
||||
int i = (e2 ? 11 : 14) + (d2 << 2);
|
||||
int[] iArr = new int[i];
|
||||
boolean[] zArr = new boolean[a(d2, e2)];
|
||||
int i2 = 2;
|
||||
if (e2) {
|
||||
for (int i3 = 0; i3 < iArr.length; i3++) {
|
||||
iArr[i3] = i3;
|
||||
}
|
||||
} else {
|
||||
int i4 = i / 2;
|
||||
int i5 = ((i + 1) + (((i4 - 1) / 15) * 2)) / 2;
|
||||
for (int i6 = 0; i6 < i4; i6++) {
|
||||
iArr[(i4 - i6) - 1] = (i5 - r12) - 1;
|
||||
iArr[i4 + i6] = (i6 / 15) + i6 + i5 + 1;
|
||||
}
|
||||
}
|
||||
int i7 = 0;
|
||||
int i8 = 0;
|
||||
while (i7 < d2) {
|
||||
int i9 = ((d2 - i7) << i2) + (e2 ? 9 : 12);
|
||||
int i10 = i7 << 1;
|
||||
int i11 = (i - 1) - i10;
|
||||
int i12 = 0;
|
||||
while (i12 < i9) {
|
||||
int i13 = i12 << 1;
|
||||
int i14 = 0;
|
||||
while (i14 < i2) {
|
||||
int i15 = i10 + i14;
|
||||
int i16 = i10 + i12;
|
||||
zArr[i8 + i13 + i14] = bitMatrix.b(iArr[i15], iArr[i16]);
|
||||
int i17 = iArr[i16];
|
||||
int i18 = i11 - i14;
|
||||
zArr[(i9 * 2) + i8 + i13 + i14] = bitMatrix.b(i17, iArr[i18]);
|
||||
int i19 = i11 - i12;
|
||||
zArr[(i9 * 4) + i8 + i13 + i14] = bitMatrix.b(iArr[i18], iArr[i19]);
|
||||
zArr[(i9 * 6) + i8 + i13 + i14] = bitMatrix.b(iArr[i19], iArr[i15]);
|
||||
i14++;
|
||||
d2 = d2;
|
||||
e2 = e2;
|
||||
i2 = 2;
|
||||
}
|
||||
i12++;
|
||||
i2 = 2;
|
||||
}
|
||||
i8 += i9 << 3;
|
||||
i7++;
|
||||
i2 = 2;
|
||||
}
|
||||
return zArr;
|
||||
}
|
||||
|
||||
private static int a(boolean[] zArr, int i, int i2) {
|
||||
int i3 = 0;
|
||||
for (int i4 = i; i4 < i + i2; i4++) {
|
||||
i3 <<= 1;
|
||||
if (zArr[i4]) {
|
||||
i3 |= 1;
|
||||
}
|
||||
}
|
||||
return i3;
|
||||
}
|
||||
|
||||
private static byte a(boolean[] zArr, int i) {
|
||||
int a;
|
||||
int length = zArr.length - i;
|
||||
if (length >= 8) {
|
||||
a = a(zArr, i, 8);
|
||||
} else {
|
||||
a = a(zArr, i, length) << (8 - length);
|
||||
}
|
||||
return (byte) a;
|
||||
}
|
||||
|
||||
static byte[] a(boolean[] zArr) {
|
||||
byte[] bArr = new byte[(zArr.length + 7) / 8];
|
||||
for (int i = 0; i < bArr.length; i++) {
|
||||
bArr[i] = a(zArr, i << 3);
|
||||
}
|
||||
return bArr;
|
||||
}
|
||||
}
|
357
sources/com/google/zxing/aztec/detector/Detector.java
Normal file
357
sources/com/google/zxing/aztec/detector/Detector.java
Normal file
@@ -0,0 +1,357 @@
|
||||
package com.google.zxing.aztec.detector;
|
||||
|
||||
import com.google.zxing.NotFoundException;
|
||||
import com.google.zxing.ResultPoint;
|
||||
import com.google.zxing.aztec.AztecDetectorResult;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.common.GridSampler;
|
||||
import com.google.zxing.common.detector.MathUtils;
|
||||
import com.google.zxing.common.detector.WhiteRectangleDetector;
|
||||
import com.google.zxing.common.reedsolomon.GenericGF;
|
||||
import com.google.zxing.common.reedsolomon.ReedSolomonDecoder;
|
||||
import com.google.zxing.common.reedsolomon.ReedSolomonException;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Detector {
|
||||
private static final int[] g = {3808, 476, 2107, 1799};
|
||||
private final BitMatrix a;
|
||||
private boolean b;
|
||||
private int c;
|
||||
private int d;
|
||||
private int e;
|
||||
private int f;
|
||||
|
||||
static final class Point {
|
||||
private final int a;
|
||||
private final int b;
|
||||
|
||||
Point(int i, int i2) {
|
||||
this.a = i;
|
||||
this.b = i2;
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
int b() {
|
||||
return this.b;
|
||||
}
|
||||
|
||||
ResultPoint c() {
|
||||
return new ResultPoint(a(), b());
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return "<" + this.a + ' ' + this.b + '>';
|
||||
}
|
||||
}
|
||||
|
||||
public Detector(BitMatrix bitMatrix) {
|
||||
this.a = bitMatrix;
|
||||
}
|
||||
|
||||
private Point b() {
|
||||
ResultPoint c;
|
||||
ResultPoint resultPoint;
|
||||
ResultPoint resultPoint2;
|
||||
ResultPoint resultPoint3;
|
||||
ResultPoint c2;
|
||||
ResultPoint c3;
|
||||
ResultPoint c4;
|
||||
ResultPoint c5;
|
||||
try {
|
||||
ResultPoint[] a = new WhiteRectangleDetector(this.a).a();
|
||||
resultPoint2 = a[0];
|
||||
resultPoint3 = a[1];
|
||||
resultPoint = a[2];
|
||||
c = a[3];
|
||||
} catch (NotFoundException unused) {
|
||||
int k = this.a.k() / 2;
|
||||
int i = this.a.i() / 2;
|
||||
int i2 = k + 7;
|
||||
int i3 = i - 7;
|
||||
ResultPoint c6 = a(new Point(i2, i3), false, 1, -1).c();
|
||||
int i4 = i + 7;
|
||||
ResultPoint c7 = a(new Point(i2, i4), false, 1, 1).c();
|
||||
int i5 = k - 7;
|
||||
ResultPoint c8 = a(new Point(i5, i4), false, -1, 1).c();
|
||||
c = a(new Point(i5, i3), false, -1, -1).c();
|
||||
resultPoint = c8;
|
||||
resultPoint2 = c6;
|
||||
resultPoint3 = c7;
|
||||
}
|
||||
int a2 = MathUtils.a((((resultPoint2.a() + c.a()) + resultPoint3.a()) + resultPoint.a()) / 4.0f);
|
||||
int a3 = MathUtils.a((((resultPoint2.b() + c.b()) + resultPoint3.b()) + resultPoint.b()) / 4.0f);
|
||||
try {
|
||||
ResultPoint[] a4 = new WhiteRectangleDetector(this.a, 15, a2, a3).a();
|
||||
c2 = a4[0];
|
||||
c3 = a4[1];
|
||||
c4 = a4[2];
|
||||
c5 = a4[3];
|
||||
} catch (NotFoundException unused2) {
|
||||
int i6 = a2 + 7;
|
||||
int i7 = a3 - 7;
|
||||
c2 = a(new Point(i6, i7), false, 1, -1).c();
|
||||
int i8 = a3 + 7;
|
||||
c3 = a(new Point(i6, i8), false, 1, 1).c();
|
||||
int i9 = a2 - 7;
|
||||
c4 = a(new Point(i9, i8), false, -1, 1).c();
|
||||
c5 = a(new Point(i9, i7), false, -1, -1).c();
|
||||
}
|
||||
return new Point(MathUtils.a((((c2.a() + c5.a()) + c3.a()) + c4.a()) / 4.0f), MathUtils.a((((c2.b() + c5.b()) + c3.b()) + c4.b()) / 4.0f));
|
||||
}
|
||||
|
||||
public AztecDetectorResult a(boolean z) throws NotFoundException {
|
||||
ResultPoint[] a = a(b());
|
||||
if (z) {
|
||||
ResultPoint resultPoint = a[0];
|
||||
a[0] = a[2];
|
||||
a[2] = resultPoint;
|
||||
}
|
||||
a(a);
|
||||
BitMatrix bitMatrix = this.a;
|
||||
int i = this.f;
|
||||
return new AztecDetectorResult(a(bitMatrix, a[i % 4], a[(i + 1) % 4], a[(i + 2) % 4], a[(i + 3) % 4]), b(a), this.b, this.d, this.c);
|
||||
}
|
||||
|
||||
private void a(ResultPoint[] resultPointArr) throws NotFoundException {
|
||||
long j;
|
||||
long j2;
|
||||
if (a(resultPointArr[0]) && a(resultPointArr[1]) && a(resultPointArr[2]) && a(resultPointArr[3])) {
|
||||
int i = this.e * 2;
|
||||
int[] iArr = {a(resultPointArr[0], resultPointArr[1], i), a(resultPointArr[1], resultPointArr[2], i), a(resultPointArr[2], resultPointArr[3], i), a(resultPointArr[3], resultPointArr[0], i)};
|
||||
this.f = a(iArr, i);
|
||||
long j3 = 0;
|
||||
for (int i2 = 0; i2 < 4; i2++) {
|
||||
int i3 = iArr[(this.f + i2) % 4];
|
||||
if (this.b) {
|
||||
j = j3 << 7;
|
||||
j2 = (i3 >> 1) & 127;
|
||||
} else {
|
||||
j = j3 << 10;
|
||||
j2 = ((i3 >> 2) & 992) + ((i3 >> 1) & 31);
|
||||
}
|
||||
j3 = j + j2;
|
||||
}
|
||||
int a = a(j3, this.b);
|
||||
if (this.b) {
|
||||
this.c = (a >> 6) + 1;
|
||||
this.d = (a & 63) + 1;
|
||||
return;
|
||||
} else {
|
||||
this.c = (a >> 11) + 1;
|
||||
this.d = (a & 2047) + 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
|
||||
private ResultPoint[] b(ResultPoint[] resultPointArr) {
|
||||
return a(resultPointArr, this.e * 2, a());
|
||||
}
|
||||
|
||||
private int b(Point point, Point point2) {
|
||||
float a = a(point, point2);
|
||||
float a2 = (point2.a() - point.a()) / a;
|
||||
float b = (point2.b() - point.b()) / a;
|
||||
float a3 = point.a();
|
||||
float b2 = point.b();
|
||||
boolean b3 = this.a.b(point.a(), point.b());
|
||||
int ceil = (int) Math.ceil(a);
|
||||
float f = a3;
|
||||
float f2 = b2;
|
||||
int i = 0;
|
||||
for (int i2 = 0; i2 < ceil; i2++) {
|
||||
f += a2;
|
||||
f2 += b;
|
||||
if (this.a.b(MathUtils.a(f), MathUtils.a(f2)) != b3) {
|
||||
i++;
|
||||
}
|
||||
}
|
||||
float f3 = i / a;
|
||||
if (f3 <= 0.1f || f3 >= 0.9f) {
|
||||
return (f3 <= 0.1f) == b3 ? 1 : -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private static int a(int[] iArr, int i) throws NotFoundException {
|
||||
int i2 = 0;
|
||||
for (int i3 : iArr) {
|
||||
i2 = (i2 << 3) + ((i3 >> (i - 2)) << 1) + (i3 & 1);
|
||||
}
|
||||
int i4 = ((i2 & 1) << 11) + (i2 >> 1);
|
||||
for (int i5 = 0; i5 < 4; i5++) {
|
||||
if (Integer.bitCount(g[i5] ^ i4) <= 2) {
|
||||
return i5;
|
||||
}
|
||||
}
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
|
||||
private static int a(long j, boolean z) throws NotFoundException {
|
||||
int i;
|
||||
int i2;
|
||||
if (z) {
|
||||
i = 7;
|
||||
i2 = 2;
|
||||
} else {
|
||||
i = 10;
|
||||
i2 = 4;
|
||||
}
|
||||
int i3 = i - i2;
|
||||
int[] iArr = new int[i];
|
||||
for (int i4 = i - 1; i4 >= 0; i4--) {
|
||||
iArr[i4] = ((int) j) & 15;
|
||||
j >>= 4;
|
||||
}
|
||||
try {
|
||||
new ReedSolomonDecoder(GenericGF.k).a(iArr, i3);
|
||||
int i5 = 0;
|
||||
for (int i6 = 0; i6 < i2; i6++) {
|
||||
i5 = (i5 << 4) + iArr[i6];
|
||||
}
|
||||
return i5;
|
||||
} catch (ReedSolomonException unused) {
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
}
|
||||
|
||||
private ResultPoint[] a(Point point) throws NotFoundException {
|
||||
this.e = 1;
|
||||
Point point2 = point;
|
||||
Point point3 = point2;
|
||||
Point point4 = point3;
|
||||
Point point5 = point4;
|
||||
boolean z = true;
|
||||
while (this.e < 9) {
|
||||
Point a = a(point2, z, 1, -1);
|
||||
Point a2 = a(point3, z, 1, 1);
|
||||
Point a3 = a(point4, z, -1, 1);
|
||||
Point a4 = a(point5, z, -1, -1);
|
||||
if (this.e > 2) {
|
||||
double a5 = (a(a4, a) * this.e) / (a(point5, point2) * (this.e + 2));
|
||||
if (a5 < 0.75d || a5 > 1.25d || !a(a, a2, a3, a4)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
z = !z;
|
||||
this.e++;
|
||||
point5 = a4;
|
||||
point2 = a;
|
||||
point3 = a2;
|
||||
point4 = a3;
|
||||
}
|
||||
int i = this.e;
|
||||
if (i != 5 && i != 7) {
|
||||
throw NotFoundException.getNotFoundInstance();
|
||||
}
|
||||
this.b = this.e == 5;
|
||||
ResultPoint[] resultPointArr = {new ResultPoint(point2.a() + 0.5f, point2.b() - 0.5f), new ResultPoint(point3.a() + 0.5f, point3.b() + 0.5f), new ResultPoint(point4.a() - 0.5f, point4.b() + 0.5f), new ResultPoint(point5.a() - 0.5f, point5.b() - 0.5f)};
|
||||
int i2 = this.e;
|
||||
return a(resultPointArr, (i2 * 2) - 3, i2 * 2);
|
||||
}
|
||||
|
||||
private BitMatrix a(BitMatrix bitMatrix, ResultPoint resultPoint, ResultPoint resultPoint2, ResultPoint resultPoint3, ResultPoint resultPoint4) throws NotFoundException {
|
||||
GridSampler a = GridSampler.a();
|
||||
int a2 = a();
|
||||
float f = a2 / 2.0f;
|
||||
int i = this.e;
|
||||
float f2 = f - i;
|
||||
float f3 = f + i;
|
||||
return a.a(bitMatrix, a2, a2, f2, f2, f3, f2, f3, f3, f2, f3, resultPoint.a(), resultPoint.b(), resultPoint2.a(), resultPoint2.b(), resultPoint3.a(), resultPoint3.b(), resultPoint4.a(), resultPoint4.b());
|
||||
}
|
||||
|
||||
private int a(ResultPoint resultPoint, ResultPoint resultPoint2, int i) {
|
||||
float a = a(resultPoint, resultPoint2);
|
||||
float f = a / i;
|
||||
float a2 = resultPoint.a();
|
||||
float b = resultPoint.b();
|
||||
float a3 = ((resultPoint2.a() - resultPoint.a()) * f) / a;
|
||||
float b2 = (f * (resultPoint2.b() - resultPoint.b())) / a;
|
||||
int i2 = 0;
|
||||
for (int i3 = 0; i3 < i; i3++) {
|
||||
float f2 = i3;
|
||||
if (this.a.b(MathUtils.a((f2 * a3) + a2), MathUtils.a((f2 * b2) + b))) {
|
||||
i2 |= 1 << ((i - i3) - 1);
|
||||
}
|
||||
}
|
||||
return i2;
|
||||
}
|
||||
|
||||
private boolean a(Point point, Point point2, Point point3, Point point4) {
|
||||
Point point5 = new Point(point.a() - 3, point.b() + 3);
|
||||
Point point6 = new Point(point2.a() - 3, point2.b() - 3);
|
||||
Point point7 = new Point(point3.a() + 3, point3.b() - 3);
|
||||
Point point8 = new Point(point4.a() + 3, point4.b() + 3);
|
||||
int b = b(point8, point5);
|
||||
return b != 0 && b(point5, point6) == b && b(point6, point7) == b && b(point7, point8) == b;
|
||||
}
|
||||
|
||||
private Point a(Point point, boolean z, int i, int i2) {
|
||||
int a = point.a() + i;
|
||||
int b = point.b();
|
||||
while (true) {
|
||||
b += i2;
|
||||
if (!a(a, b) || this.a.b(a, b) != z) {
|
||||
break;
|
||||
}
|
||||
a += i;
|
||||
}
|
||||
int i3 = a - i;
|
||||
int i4 = b - i2;
|
||||
while (a(i3, i4) && this.a.b(i3, i4) == z) {
|
||||
i3 += i;
|
||||
}
|
||||
int i5 = i3 - i;
|
||||
while (a(i5, i4) && this.a.b(i5, i4) == z) {
|
||||
i4 += i2;
|
||||
}
|
||||
return new Point(i5, i4 - i2);
|
||||
}
|
||||
|
||||
private static ResultPoint[] a(ResultPoint[] resultPointArr, int i, int i2) {
|
||||
float f = i2 / (i * 2.0f);
|
||||
float a = resultPointArr[0].a() - resultPointArr[2].a();
|
||||
float b = resultPointArr[0].b() - resultPointArr[2].b();
|
||||
float a2 = (resultPointArr[0].a() + resultPointArr[2].a()) / 2.0f;
|
||||
float b2 = (resultPointArr[0].b() + resultPointArr[2].b()) / 2.0f;
|
||||
float f2 = a * f;
|
||||
float f3 = b * f;
|
||||
ResultPoint resultPoint = new ResultPoint(a2 + f2, b2 + f3);
|
||||
ResultPoint resultPoint2 = new ResultPoint(a2 - f2, b2 - f3);
|
||||
float a3 = resultPointArr[1].a() - resultPointArr[3].a();
|
||||
float b3 = resultPointArr[1].b() - resultPointArr[3].b();
|
||||
float a4 = (resultPointArr[1].a() + resultPointArr[3].a()) / 2.0f;
|
||||
float b4 = (resultPointArr[1].b() + resultPointArr[3].b()) / 2.0f;
|
||||
float f4 = a3 * f;
|
||||
float f5 = f * b3;
|
||||
return new ResultPoint[]{resultPoint, new ResultPoint(a4 + f4, b4 + f5), resultPoint2, new ResultPoint(a4 - f4, b4 - f5)};
|
||||
}
|
||||
|
||||
private boolean a(int i, int i2) {
|
||||
return i >= 0 && i < this.a.k() && i2 > 0 && i2 < this.a.i();
|
||||
}
|
||||
|
||||
private boolean a(ResultPoint resultPoint) {
|
||||
return a(MathUtils.a(resultPoint.a()), MathUtils.a(resultPoint.b()));
|
||||
}
|
||||
|
||||
private static float a(Point point, Point point2) {
|
||||
return MathUtils.a(point.a(), point.b(), point2.a(), point2.b());
|
||||
}
|
||||
|
||||
private static float a(ResultPoint resultPoint, ResultPoint resultPoint2) {
|
||||
return MathUtils.a(resultPoint.a(), resultPoint.b(), resultPoint2.a(), resultPoint2.b());
|
||||
}
|
||||
|
||||
private int a() {
|
||||
if (this.b) {
|
||||
return (this.c * 4) + 11;
|
||||
}
|
||||
int i = this.c;
|
||||
return i <= 4 ? (i * 4) + 15 : (i * 4) + ((((i - 4) / 8) + 1) * 2) + 15;
|
||||
}
|
||||
}
|
28
sources/com/google/zxing/aztec/encoder/AztecCode.java
Normal file
28
sources/com/google/zxing/aztec/encoder/AztecCode.java
Normal file
@@ -0,0 +1,28 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class AztecCode {
|
||||
private BitMatrix a;
|
||||
|
||||
public BitMatrix a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public void a(int i) {
|
||||
}
|
||||
|
||||
public void a(boolean z) {
|
||||
}
|
||||
|
||||
public void b(int i) {
|
||||
}
|
||||
|
||||
public void c(int i) {
|
||||
}
|
||||
|
||||
public void a(BitMatrix bitMatrix) {
|
||||
this.a = bitMatrix;
|
||||
}
|
||||
}
|
48
sources/com/google/zxing/aztec/encoder/BinaryShiftToken.java
Normal file
48
sources/com/google/zxing/aztec/encoder/BinaryShiftToken.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.google.zxing.common.BitArray;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class BinaryShiftToken extends Token {
|
||||
private final short c;
|
||||
private final short d;
|
||||
|
||||
BinaryShiftToken(Token token, int i, int i2) {
|
||||
super(token);
|
||||
this.c = (short) i;
|
||||
this.d = (short) i2;
|
||||
}
|
||||
|
||||
@Override // com.google.zxing.aztec.encoder.Token
|
||||
public void a(BitArray bitArray, byte[] bArr) {
|
||||
int i = 0;
|
||||
while (true) {
|
||||
short s = this.d;
|
||||
if (i >= s) {
|
||||
return;
|
||||
}
|
||||
if (i == 0 || (i == 31 && s <= 62)) {
|
||||
bitArray.a(31, 5);
|
||||
short s2 = this.d;
|
||||
if (s2 > 62) {
|
||||
bitArray.a(s2 - 31, 16);
|
||||
} else if (i == 0) {
|
||||
bitArray.a(Math.min((int) s2, 31), 5);
|
||||
} else {
|
||||
bitArray.a(s2 - 31, 5);
|
||||
}
|
||||
}
|
||||
bitArray.a(bArr[this.c + i], 8);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("<");
|
||||
sb.append((int) this.c);
|
||||
sb.append("::");
|
||||
sb.append((this.c + this.d) - 1);
|
||||
sb.append('>');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
317
sources/com/google/zxing/aztec/encoder/Encoder.java
Normal file
317
sources/com/google/zxing/aztec/encoder/Encoder.java
Normal file
@@ -0,0 +1,317 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.google.zxing.common.BitArray;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.common.reedsolomon.GenericGF;
|
||||
import com.google.zxing.common.reedsolomon.ReedSolomonEncoder;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class Encoder {
|
||||
private static final int[] a = {4, 6, 6, 8, 8, 8, 8, 8, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12};
|
||||
|
||||
private static int a(int i, boolean z) {
|
||||
return ((z ? 88 : 112) + (i << 4)) * i;
|
||||
}
|
||||
|
||||
public static AztecCode a(byte[] bArr, int i, int i2) {
|
||||
int i3;
|
||||
BitArray a2;
|
||||
BitArray bitArray;
|
||||
boolean z;
|
||||
int i4;
|
||||
int i5;
|
||||
int i6;
|
||||
BitArray a3 = new HighLevelEncoder(bArr).a();
|
||||
int h = ((a3.h() * i) / 100) + 11;
|
||||
int h2 = a3.h() + h;
|
||||
int i7 = 0;
|
||||
int i8 = 1;
|
||||
if (i2 == 0) {
|
||||
BitArray bitArray2 = null;
|
||||
int i9 = 0;
|
||||
int i10 = 0;
|
||||
while (i9 <= 32) {
|
||||
boolean z2 = i9 <= 3;
|
||||
int i11 = z2 ? i9 + 1 : i9;
|
||||
int a4 = a(i11, z2);
|
||||
if (h2 <= a4) {
|
||||
if (bitArray2 == null || i10 != a[i11]) {
|
||||
i3 = a[i11];
|
||||
a2 = a(a3, i3);
|
||||
} else {
|
||||
int i12 = i10;
|
||||
a2 = bitArray2;
|
||||
i3 = i12;
|
||||
}
|
||||
int i13 = a4 - (a4 % i3);
|
||||
if ((!z2 || a2.h() <= (i3 << 6)) && a2.h() + h <= i13) {
|
||||
bitArray = a2;
|
||||
z = z2;
|
||||
i4 = i11;
|
||||
i5 = a4;
|
||||
} else {
|
||||
BitArray bitArray3 = a2;
|
||||
i10 = i3;
|
||||
bitArray2 = bitArray3;
|
||||
}
|
||||
}
|
||||
i9++;
|
||||
i7 = 0;
|
||||
i8 = 1;
|
||||
}
|
||||
throw new IllegalArgumentException("Data too large for an Aztec code");
|
||||
}
|
||||
z = i2 < 0;
|
||||
i4 = Math.abs(i2);
|
||||
if (i4 > (z ? 4 : 32)) {
|
||||
throw new IllegalArgumentException(String.format("Illegal value %s for layers", Integer.valueOf(i2)));
|
||||
}
|
||||
i5 = a(i4, z);
|
||||
i3 = a[i4];
|
||||
int i14 = i5 - (i5 % i3);
|
||||
bitArray = a(a3, i3);
|
||||
if (bitArray.h() + h > i14) {
|
||||
throw new IllegalArgumentException("Data to large for user specified layer");
|
||||
}
|
||||
if (z && bitArray.h() > (i3 << 6)) {
|
||||
throw new IllegalArgumentException("Data to large for user specified layer");
|
||||
}
|
||||
BitArray b = b(bitArray, i5, i3);
|
||||
int h3 = bitArray.h() / i3;
|
||||
BitArray a5 = a(z, i4, h3);
|
||||
int i15 = (z ? 11 : 14) + (i4 << 2);
|
||||
int[] iArr = new int[i15];
|
||||
int i16 = 2;
|
||||
if (z) {
|
||||
for (int i17 = 0; i17 < iArr.length; i17++) {
|
||||
iArr[i17] = i17;
|
||||
}
|
||||
i6 = i15;
|
||||
} else {
|
||||
int i18 = i15 / 2;
|
||||
i6 = i15 + 1 + (((i18 - 1) / 15) * 2);
|
||||
int i19 = i6 / 2;
|
||||
for (int i20 = 0; i20 < i18; i20++) {
|
||||
iArr[(i18 - i20) - i8] = (i19 - r14) - 1;
|
||||
iArr[i18 + i20] = (i20 / 15) + i20 + i19 + i8;
|
||||
}
|
||||
}
|
||||
BitMatrix bitMatrix = new BitMatrix(i6);
|
||||
int i21 = 0;
|
||||
int i22 = 0;
|
||||
while (i21 < i4) {
|
||||
int i23 = ((i4 - i21) << i16) + (z ? 9 : 12);
|
||||
int i24 = 0;
|
||||
while (i24 < i23) {
|
||||
int i25 = i24 << 1;
|
||||
while (i7 < i16) {
|
||||
if (b.a(i22 + i25 + i7)) {
|
||||
int i26 = i21 << 1;
|
||||
bitMatrix.c(iArr[i26 + i7], iArr[i26 + i24]);
|
||||
}
|
||||
if (b.a((i23 << 1) + i22 + i25 + i7)) {
|
||||
int i27 = i21 << 1;
|
||||
bitMatrix.c(iArr[i27 + i24], iArr[((i15 - 1) - i27) - i7]);
|
||||
}
|
||||
if (b.a((i23 << 2) + i22 + i25 + i7)) {
|
||||
int i28 = (i15 - 1) - (i21 << 1);
|
||||
bitMatrix.c(iArr[i28 - i7], iArr[i28 - i24]);
|
||||
}
|
||||
if (b.a((i23 * 6) + i22 + i25 + i7)) {
|
||||
int i29 = i21 << 1;
|
||||
bitMatrix.c(iArr[((i15 - 1) - i29) - i24], iArr[i29 + i7]);
|
||||
}
|
||||
i7++;
|
||||
i16 = 2;
|
||||
}
|
||||
i24++;
|
||||
i7 = 0;
|
||||
i16 = 2;
|
||||
}
|
||||
i22 += i23 << 3;
|
||||
i21++;
|
||||
i7 = 0;
|
||||
i16 = 2;
|
||||
}
|
||||
a(bitMatrix, z, i6, a5);
|
||||
if (z) {
|
||||
a(bitMatrix, i6 / 2, 5);
|
||||
} else {
|
||||
int i30 = i6 / 2;
|
||||
a(bitMatrix, i30, 7);
|
||||
int i31 = 0;
|
||||
int i32 = 0;
|
||||
while (i31 < (i15 / 2) - 1) {
|
||||
for (int i33 = i30 & 1; i33 < i6; i33 += 2) {
|
||||
int i34 = i30 - i32;
|
||||
bitMatrix.c(i34, i33);
|
||||
int i35 = i30 + i32;
|
||||
bitMatrix.c(i35, i33);
|
||||
bitMatrix.c(i33, i34);
|
||||
bitMatrix.c(i33, i35);
|
||||
}
|
||||
i31 += 15;
|
||||
i32 += 16;
|
||||
}
|
||||
}
|
||||
AztecCode aztecCode = new AztecCode();
|
||||
aztecCode.a(z);
|
||||
aztecCode.c(i6);
|
||||
aztecCode.b(i4);
|
||||
aztecCode.a(h3);
|
||||
aztecCode.a(bitMatrix);
|
||||
return aztecCode;
|
||||
}
|
||||
|
||||
private static BitArray b(BitArray bitArray, int i, int i2) {
|
||||
int h = bitArray.h() / i2;
|
||||
ReedSolomonEncoder reedSolomonEncoder = new ReedSolomonEncoder(a(i2));
|
||||
int i3 = i / i2;
|
||||
int[] a2 = a(bitArray, i2, i3);
|
||||
reedSolomonEncoder.a(a2, i3 - h);
|
||||
BitArray bitArray2 = new BitArray();
|
||||
bitArray2.a(0, i % i2);
|
||||
for (int i4 : a2) {
|
||||
bitArray2.a(i4, i2);
|
||||
}
|
||||
return bitArray2;
|
||||
}
|
||||
|
||||
private static void a(BitMatrix bitMatrix, int i, int i2) {
|
||||
for (int i3 = 0; i3 < i2; i3 += 2) {
|
||||
int i4 = i - i3;
|
||||
int i5 = i4;
|
||||
while (true) {
|
||||
int i6 = i + i3;
|
||||
if (i5 <= i6) {
|
||||
bitMatrix.c(i5, i4);
|
||||
bitMatrix.c(i5, i6);
|
||||
bitMatrix.c(i4, i5);
|
||||
bitMatrix.c(i6, i5);
|
||||
i5++;
|
||||
}
|
||||
}
|
||||
}
|
||||
int i7 = i - i2;
|
||||
bitMatrix.c(i7, i7);
|
||||
int i8 = i7 + 1;
|
||||
bitMatrix.c(i8, i7);
|
||||
bitMatrix.c(i7, i8);
|
||||
int i9 = i + i2;
|
||||
bitMatrix.c(i9, i7);
|
||||
bitMatrix.c(i9, i8);
|
||||
bitMatrix.c(i9, i9 - 1);
|
||||
}
|
||||
|
||||
static BitArray a(boolean z, int i, int i2) {
|
||||
BitArray bitArray = new BitArray();
|
||||
if (z) {
|
||||
bitArray.a(i - 1, 2);
|
||||
bitArray.a(i2 - 1, 6);
|
||||
return b(bitArray, 28, 4);
|
||||
}
|
||||
bitArray.a(i - 1, 5);
|
||||
bitArray.a(i2 - 1, 11);
|
||||
return b(bitArray, 40, 4);
|
||||
}
|
||||
|
||||
private static void a(BitMatrix bitMatrix, boolean z, int i, BitArray bitArray) {
|
||||
int i2 = i / 2;
|
||||
int i3 = 0;
|
||||
if (z) {
|
||||
while (i3 < 7) {
|
||||
int i4 = (i2 - 3) + i3;
|
||||
if (bitArray.a(i3)) {
|
||||
bitMatrix.c(i4, i2 - 5);
|
||||
}
|
||||
if (bitArray.a(i3 + 7)) {
|
||||
bitMatrix.c(i2 + 5, i4);
|
||||
}
|
||||
if (bitArray.a(20 - i3)) {
|
||||
bitMatrix.c(i4, i2 + 5);
|
||||
}
|
||||
if (bitArray.a(27 - i3)) {
|
||||
bitMatrix.c(i2 - 5, i4);
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
while (i3 < 10) {
|
||||
int i5 = (i2 - 5) + i3 + (i3 / 5);
|
||||
if (bitArray.a(i3)) {
|
||||
bitMatrix.c(i5, i2 - 7);
|
||||
}
|
||||
if (bitArray.a(i3 + 10)) {
|
||||
bitMatrix.c(i2 + 7, i5);
|
||||
}
|
||||
if (bitArray.a(29 - i3)) {
|
||||
bitMatrix.c(i5, i2 + 7);
|
||||
}
|
||||
if (bitArray.a(39 - i3)) {
|
||||
bitMatrix.c(i2 - 7, i5);
|
||||
}
|
||||
i3++;
|
||||
}
|
||||
}
|
||||
|
||||
private static int[] a(BitArray bitArray, int i, int i2) {
|
||||
int[] iArr = new int[i2];
|
||||
int h = bitArray.h() / i;
|
||||
for (int i3 = 0; i3 < h; i3++) {
|
||||
int i4 = 0;
|
||||
for (int i5 = 0; i5 < i; i5++) {
|
||||
i4 |= bitArray.a((i3 * i) + i5) ? 1 << ((i - i5) - 1) : 0;
|
||||
}
|
||||
iArr[i3] = i4;
|
||||
}
|
||||
return iArr;
|
||||
}
|
||||
|
||||
private static GenericGF a(int i) {
|
||||
if (i == 4) {
|
||||
return GenericGF.k;
|
||||
}
|
||||
if (i == 6) {
|
||||
return GenericGF.j;
|
||||
}
|
||||
if (i == 8) {
|
||||
return GenericGF.n;
|
||||
}
|
||||
if (i == 10) {
|
||||
return GenericGF.i;
|
||||
}
|
||||
if (i == 12) {
|
||||
return GenericGF.h;
|
||||
}
|
||||
throw new IllegalArgumentException("Unsupported word size ".concat(String.valueOf(i)));
|
||||
}
|
||||
|
||||
static BitArray a(BitArray bitArray, int i) {
|
||||
BitArray bitArray2 = new BitArray();
|
||||
int h = bitArray.h();
|
||||
int i2 = (1 << i) - 2;
|
||||
int i3 = 0;
|
||||
while (i3 < h) {
|
||||
int i4 = 0;
|
||||
for (int i5 = 0; i5 < i; i5++) {
|
||||
int i6 = i3 + i5;
|
||||
if (i6 >= h || bitArray.a(i6)) {
|
||||
i4 |= 1 << ((i - 1) - i5);
|
||||
}
|
||||
}
|
||||
int i7 = i4 & i2;
|
||||
if (i7 == i2) {
|
||||
bitArray2.a(i7, i);
|
||||
} else if (i7 == 0) {
|
||||
bitArray2.a(i4 | 1, i);
|
||||
} else {
|
||||
bitArray2.a(i4, i);
|
||||
i3 += i;
|
||||
}
|
||||
i3--;
|
||||
i3 += i;
|
||||
}
|
||||
return bitArray2;
|
||||
}
|
||||
}
|
222
sources/com/google/zxing/aztec/encoder/HighLevelEncoder.java
Normal file
222
sources/com/google/zxing/aztec/encoder/HighLevelEncoder.java
Normal file
@@ -0,0 +1,222 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.ijm.dataencryption.de.DataDecryptTool;
|
||||
import java.lang.reflect.Array;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
public final class HighLevelEncoder {
|
||||
static final String[] b = {"UPPER", "LOWER", "DIGIT", "MIXED", "PUNCT"};
|
||||
static final int[][] c = {new int[]{0, 327708, 327710, 327709, 656318}, new int[]{590318, 0, 327710, 327709, 656318}, new int[]{262158, 590300, 0, 590301, 932798}, new int[]{327709, 327708, 656318, 0, 327710}, new int[]{327711, 656380, 656382, 656381, 0}};
|
||||
private static final int[][] d;
|
||||
static final int[][] e;
|
||||
private final byte[] a;
|
||||
|
||||
static {
|
||||
int[][] iArr = (int[][]) Array.newInstance((Class<?>) int.class, 5, DataDecryptTool.DECRYPT_ALL_FILE);
|
||||
d = iArr;
|
||||
iArr[0][32] = 1;
|
||||
for (int i = 65; i <= 90; i++) {
|
||||
d[0][i] = (i - 65) + 2;
|
||||
}
|
||||
d[1][32] = 1;
|
||||
for (int i2 = 97; i2 <= 122; i2++) {
|
||||
d[1][i2] = (i2 - 97) + 2;
|
||||
}
|
||||
d[2][32] = 1;
|
||||
for (int i3 = 48; i3 <= 57; i3++) {
|
||||
d[2][i3] = (i3 - 48) + 2;
|
||||
}
|
||||
int[][] iArr2 = d;
|
||||
iArr2[2][44] = 12;
|
||||
iArr2[2][46] = 13;
|
||||
int[] iArr3 = {0, 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 27, 28, 29, 30, 31, 64, 92, 94, 95, 96, 124, 126, 127};
|
||||
for (int i4 = 0; i4 < 28; i4++) {
|
||||
d[3][iArr3[i4]] = i4;
|
||||
}
|
||||
int[] iArr4 = {0, 13, 0, 0, 0, 0, 33, 39, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 58, 59, 60, 61, 62, 63, 91, 93, 123, 125};
|
||||
for (int i5 = 0; i5 < 31; i5++) {
|
||||
if (iArr4[i5] > 0) {
|
||||
d[4][iArr4[i5]] = i5;
|
||||
}
|
||||
}
|
||||
int[][] iArr5 = (int[][]) Array.newInstance((Class<?>) int.class, 6, 6);
|
||||
e = iArr5;
|
||||
for (int[] iArr6 : iArr5) {
|
||||
Arrays.fill(iArr6, -1);
|
||||
}
|
||||
int[][] iArr7 = e;
|
||||
iArr7[0][4] = 0;
|
||||
iArr7[1][4] = 0;
|
||||
iArr7[1][0] = 28;
|
||||
iArr7[3][4] = 0;
|
||||
iArr7[2][4] = 0;
|
||||
iArr7[2][0] = 15;
|
||||
}
|
||||
|
||||
public HighLevelEncoder(byte[] bArr) {
|
||||
this.a = bArr;
|
||||
}
|
||||
|
||||
/* JADX WARN: Removed duplicated region for block: B:17:0x0042 */
|
||||
/* JADX WARN: Removed duplicated region for block: B:20:0x0049 */
|
||||
/*
|
||||
Code decompiled incorrectly, please refer to instructions dump.
|
||||
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
||||
*/
|
||||
public com.google.zxing.common.BitArray a() {
|
||||
/*
|
||||
r8 = this;
|
||||
com.google.zxing.aztec.encoder.State r0 = com.google.zxing.aztec.encoder.State.e
|
||||
java.util.List r0 = java.util.Collections.singletonList(r0)
|
||||
r1 = 0
|
||||
r2 = r0
|
||||
r0 = 0
|
||||
L9:
|
||||
byte[] r3 = r8.a
|
||||
int r4 = r3.length
|
||||
if (r0 >= r4) goto L50
|
||||
int r4 = r0 + 1
|
||||
int r5 = r3.length
|
||||
if (r4 >= r5) goto L16
|
||||
r3 = r3[r4]
|
||||
goto L17
|
||||
L16:
|
||||
r3 = 0
|
||||
L17:
|
||||
byte[] r5 = r8.a
|
||||
r5 = r5[r0]
|
||||
r6 = 13
|
||||
if (r5 == r6) goto L3b
|
||||
r6 = 44
|
||||
r7 = 32
|
||||
if (r5 == r6) goto L37
|
||||
r6 = 46
|
||||
if (r5 == r6) goto L33
|
||||
r6 = 58
|
||||
if (r5 == r6) goto L2f
|
||||
L2d:
|
||||
r3 = 0
|
||||
goto L40
|
||||
L2f:
|
||||
if (r3 != r7) goto L2d
|
||||
r3 = 5
|
||||
goto L40
|
||||
L33:
|
||||
if (r3 != r7) goto L2d
|
||||
r3 = 3
|
||||
goto L40
|
||||
L37:
|
||||
if (r3 != r7) goto L2d
|
||||
r3 = 4
|
||||
goto L40
|
||||
L3b:
|
||||
r5 = 10
|
||||
if (r3 != r5) goto L2d
|
||||
r3 = 2
|
||||
L40:
|
||||
if (r3 <= 0) goto L49
|
||||
java.util.Collection r0 = a(r2, r0, r3)
|
||||
r2 = r0
|
||||
r0 = r4
|
||||
goto L4d
|
||||
L49:
|
||||
java.util.Collection r2 = r8.a(r2, r0)
|
||||
L4d:
|
||||
int r0 = r0 + 1
|
||||
goto L9
|
||||
L50:
|
||||
com.google.zxing.aztec.encoder.HighLevelEncoder$1 r0 = new com.google.zxing.aztec.encoder.HighLevelEncoder$1
|
||||
r0.<init>(r8)
|
||||
java.lang.Object r0 = java.util.Collections.min(r2, r0)
|
||||
com.google.zxing.aztec.encoder.State r0 = (com.google.zxing.aztec.encoder.State) r0
|
||||
byte[] r1 = r8.a
|
||||
com.google.zxing.common.BitArray r0 = r0.a(r1)
|
||||
return r0
|
||||
*/
|
||||
throw new UnsupportedOperationException("Method not decompiled: com.google.zxing.aztec.encoder.HighLevelEncoder.a():com.google.zxing.common.BitArray");
|
||||
}
|
||||
|
||||
private Collection<State> a(Iterable<State> iterable, int i) {
|
||||
LinkedList linkedList = new LinkedList();
|
||||
Iterator<State> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
a(it.next(), i, linkedList);
|
||||
}
|
||||
return a(linkedList);
|
||||
}
|
||||
|
||||
private void a(State state, int i, Collection<State> collection) {
|
||||
char c2 = (char) (this.a[i] & 255);
|
||||
boolean z = d[state.c()][c2] > 0;
|
||||
State state2 = null;
|
||||
for (int i2 = 0; i2 <= 4; i2++) {
|
||||
int i3 = d[i2][c2];
|
||||
if (i3 > 0) {
|
||||
if (state2 == null) {
|
||||
state2 = state.b(i);
|
||||
}
|
||||
if (!z || i2 == state.c() || i2 == 2) {
|
||||
collection.add(state2.a(i2, i3));
|
||||
}
|
||||
if (!z && e[state.c()][i2] >= 0) {
|
||||
collection.add(state2.b(i2, i3));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (state.a() > 0 || d[state.c()][c2] == 0) {
|
||||
collection.add(state.a(i));
|
||||
}
|
||||
}
|
||||
|
||||
private static Collection<State> a(Iterable<State> iterable, int i, int i2) {
|
||||
LinkedList linkedList = new LinkedList();
|
||||
Iterator<State> it = iterable.iterator();
|
||||
while (it.hasNext()) {
|
||||
a(it.next(), i, i2, linkedList);
|
||||
}
|
||||
return a(linkedList);
|
||||
}
|
||||
|
||||
private static void a(State state, int i, int i2, Collection<State> collection) {
|
||||
State b2 = state.b(i);
|
||||
collection.add(b2.a(4, i2));
|
||||
if (state.c() != 4) {
|
||||
collection.add(b2.b(4, i2));
|
||||
}
|
||||
if (i2 == 3 || i2 == 4) {
|
||||
collection.add(b2.a(2, 16 - i2).a(2, 1));
|
||||
}
|
||||
if (state.a() > 0) {
|
||||
collection.add(state.a(i).a(i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
private static Collection<State> a(Iterable<State> iterable) {
|
||||
LinkedList linkedList = new LinkedList();
|
||||
for (State state : iterable) {
|
||||
boolean z = true;
|
||||
Iterator it = linkedList.iterator();
|
||||
while (true) {
|
||||
if (!it.hasNext()) {
|
||||
break;
|
||||
}
|
||||
State state2 = (State) it.next();
|
||||
if (state2.a(state)) {
|
||||
z = false;
|
||||
break;
|
||||
}
|
||||
if (state.a(state2)) {
|
||||
it.remove();
|
||||
}
|
||||
}
|
||||
if (z) {
|
||||
linkedList.add(state);
|
||||
}
|
||||
}
|
||||
return linkedList;
|
||||
}
|
||||
}
|
26
sources/com/google/zxing/aztec/encoder/SimpleToken.java
Normal file
26
sources/com/google/zxing/aztec/encoder/SimpleToken.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.google.zxing.common.BitArray;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class SimpleToken extends Token {
|
||||
private final short c;
|
||||
private final short d;
|
||||
|
||||
SimpleToken(Token token, int i, int i2) {
|
||||
super(token);
|
||||
this.c = (short) i;
|
||||
this.d = (short) i2;
|
||||
}
|
||||
|
||||
@Override // com.google.zxing.aztec.encoder.Token
|
||||
void a(BitArray bitArray, byte[] bArr) {
|
||||
bitArray.a(this.c, this.d);
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
short s = this.c;
|
||||
short s2 = this.d;
|
||||
return "<" + Integer.toBinaryString((s & ((1 << s2) - 1)) | (1 << s2) | (1 << this.d)).substring(1) + '>';
|
||||
}
|
||||
}
|
103
sources/com/google/zxing/aztec/encoder/State.java
Normal file
103
sources/com/google/zxing/aztec/encoder/State.java
Normal file
@@ -0,0 +1,103 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.google.zxing.common.BitArray;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
final class State {
|
||||
static final State e = new State(Token.b, 0, 0, 0);
|
||||
private final int a;
|
||||
private final Token b;
|
||||
private final int c;
|
||||
private final int d;
|
||||
|
||||
private State(Token token, int i, int i2, int i3) {
|
||||
this.b = token;
|
||||
this.a = i;
|
||||
this.c = i2;
|
||||
this.d = i3;
|
||||
}
|
||||
|
||||
int a() {
|
||||
return this.c;
|
||||
}
|
||||
|
||||
int b() {
|
||||
return this.d;
|
||||
}
|
||||
|
||||
int c() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
return String.format("%s bits=%d bytes=%d", HighLevelEncoder.b[this.a], Integer.valueOf(this.d), Integer.valueOf(this.c));
|
||||
}
|
||||
|
||||
State a(int i, int i2) {
|
||||
int i3 = this.d;
|
||||
Token token = this.b;
|
||||
int i4 = this.a;
|
||||
if (i != i4) {
|
||||
int i5 = HighLevelEncoder.c[i4][i];
|
||||
int i6 = 65535 & i5;
|
||||
int i7 = i5 >> 16;
|
||||
token = token.a(i6, i7);
|
||||
i3 += i7;
|
||||
}
|
||||
int i8 = i == 2 ? 4 : 5;
|
||||
return new State(token.a(i2, i8), i, 0, i3 + i8);
|
||||
}
|
||||
|
||||
State b(int i, int i2) {
|
||||
Token token = this.b;
|
||||
int i3 = this.a == 2 ? 4 : 5;
|
||||
return new State(token.a(HighLevelEncoder.e[this.a][i], i3).a(i2, 5), this.a, 0, this.d + i3 + 5);
|
||||
}
|
||||
|
||||
State b(int i) {
|
||||
int i2 = this.c;
|
||||
return i2 == 0 ? this : new State(this.b.b(i - i2, i2), this.a, 0, this.d);
|
||||
}
|
||||
|
||||
State a(int i) {
|
||||
Token token = this.b;
|
||||
int i2 = this.a;
|
||||
int i3 = this.d;
|
||||
if (i2 == 4 || i2 == 2) {
|
||||
int i4 = HighLevelEncoder.c[i2][0];
|
||||
int i5 = 65535 & i4;
|
||||
int i6 = i4 >> 16;
|
||||
token = token.a(i5, i6);
|
||||
i3 += i6;
|
||||
i2 = 0;
|
||||
}
|
||||
int i7 = this.c;
|
||||
State state = new State(token, i2, this.c + 1, i3 + ((i7 == 0 || i7 == 31) ? 18 : i7 == 62 ? 9 : 8));
|
||||
return state.c == 2078 ? state.b(i + 1) : state;
|
||||
}
|
||||
|
||||
boolean a(State state) {
|
||||
int i;
|
||||
int i2 = this.d + (HighLevelEncoder.c[this.a][state.a] >> 16);
|
||||
int i3 = state.c;
|
||||
if (i3 > 0 && ((i = this.c) == 0 || i > i3)) {
|
||||
i2 += 10;
|
||||
}
|
||||
return i2 <= state.d;
|
||||
}
|
||||
|
||||
BitArray a(byte[] bArr) {
|
||||
LinkedList linkedList = new LinkedList();
|
||||
for (Token token = b(bArr.length).b; token != null; token = token.a()) {
|
||||
linkedList.addFirst(token);
|
||||
}
|
||||
BitArray bitArray = new BitArray();
|
||||
Iterator it = linkedList.iterator();
|
||||
while (it.hasNext()) {
|
||||
((Token) it.next()).a(bitArray, bArr);
|
||||
}
|
||||
return bitArray;
|
||||
}
|
||||
}
|
27
sources/com/google/zxing/aztec/encoder/Token.java
Normal file
27
sources/com/google/zxing/aztec/encoder/Token.java
Normal file
@@ -0,0 +1,27 @@
|
||||
package com.google.zxing.aztec.encoder;
|
||||
|
||||
import com.google.zxing.common.BitArray;
|
||||
|
||||
/* loaded from: classes.dex */
|
||||
abstract class Token {
|
||||
static final Token b = new SimpleToken(null, 0, 0);
|
||||
private final Token a;
|
||||
|
||||
Token(Token token) {
|
||||
this.a = token;
|
||||
}
|
||||
|
||||
final Token a() {
|
||||
return this.a;
|
||||
}
|
||||
|
||||
abstract void a(BitArray bitArray, byte[] bArr);
|
||||
|
||||
final Token b(int i, int i2) {
|
||||
return new BinaryShiftToken(this, i, i2);
|
||||
}
|
||||
|
||||
final Token a(int i, int i2) {
|
||||
return new SimpleToken(this, i, i2);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user