- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
146 lines
5.8 KiB
Java
146 lines
5.8 KiB
Java
package com.google.zxing.datamatrix.encoder;
|
|
|
|
import com.google.zxing.Dimension;
|
|
import com.ironsource.mediationsdk.utils.IronSourceConstants;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public class SymbolInfo {
|
|
public static final SymbolInfo[] PROD_SYMBOLS;
|
|
public static SymbolInfo[] symbols;
|
|
public final int dataCapacity;
|
|
public final int dataRegions;
|
|
public final int errorCodewords;
|
|
public final int matrixHeight;
|
|
public final int matrixWidth;
|
|
public final boolean rectangular;
|
|
public final int rsBlockData;
|
|
public final int rsBlockError;
|
|
|
|
public final int getDataCapacity() {
|
|
return this.dataCapacity;
|
|
}
|
|
|
|
public int getDataLengthForInterleavedBlock(int i) {
|
|
return this.rsBlockData;
|
|
}
|
|
|
|
public final int getErrorCodewords() {
|
|
return this.errorCodewords;
|
|
}
|
|
|
|
public final int getErrorLengthForInterleavedBlock(int i) {
|
|
return this.rsBlockError;
|
|
}
|
|
|
|
static {
|
|
SymbolInfo[] symbolInfoArr = {new SymbolInfo(false, 3, 5, 8, 8, 1), new SymbolInfo(false, 5, 7, 10, 10, 1), new SymbolInfo(true, 5, 7, 16, 6, 1), new SymbolInfo(false, 8, 10, 12, 12, 1), new SymbolInfo(true, 10, 11, 14, 6, 2), new SymbolInfo(false, 12, 12, 14, 14, 1), new SymbolInfo(true, 16, 14, 24, 10, 1), new SymbolInfo(false, 18, 14, 16, 16, 1), new SymbolInfo(false, 22, 18, 18, 18, 1), new SymbolInfo(true, 22, 18, 16, 10, 2), new SymbolInfo(false, 30, 20, 20, 20, 1), new SymbolInfo(true, 32, 24, 16, 14, 2), new SymbolInfo(false, 36, 24, 22, 22, 1), new SymbolInfo(false, 44, 28, 24, 24, 1), new SymbolInfo(true, 49, 28, 22, 14, 2), new SymbolInfo(false, 62, 36, 14, 14, 4), new SymbolInfo(false, 86, 42, 16, 16, 4), new SymbolInfo(false, 114, 48, 18, 18, 4), new SymbolInfo(false, 144, 56, 20, 20, 4), new SymbolInfo(false, 174, 68, 22, 22, 4), new SymbolInfo(false, 204, 84, 24, 24, 4, 102, 42), new SymbolInfo(false, 280, 112, 14, 14, 16, IronSourceConstants.USING_CACHE_FOR_INIT_EVENT, 56), new SymbolInfo(false, 368, 144, 16, 16, 16, 92, 36), new SymbolInfo(false, 456, PsExtractor.AUDIO_STREAM, 18, 18, 16, 114, 48), new SymbolInfo(false, 576, 224, 20, 20, 16, 144, 56), new SymbolInfo(false, 696, 272, 22, 22, 16, 174, 68), new SymbolInfo(false, 816, 336, 24, 24, 16, 136, 56), new SymbolInfo(false, 1050, 408, 18, 18, 36, 175, 68), new SymbolInfo(false, 1304, 496, 20, 20, 36, 163, 62), new DataMatrixSymbolInfo144()};
|
|
PROD_SYMBOLS = symbolInfoArr;
|
|
symbols = symbolInfoArr;
|
|
}
|
|
|
|
public SymbolInfo(boolean z, int i, int i2, int i3, int i4, int i5) {
|
|
this(z, i, i2, i3, i4, i5, i, i2);
|
|
}
|
|
|
|
public SymbolInfo(boolean z, int i, int i2, int i3, int i4, int i5, int i6, int i7) {
|
|
this.rectangular = z;
|
|
this.dataCapacity = i;
|
|
this.errorCodewords = i2;
|
|
this.matrixWidth = i3;
|
|
this.matrixHeight = i4;
|
|
this.dataRegions = i5;
|
|
this.rsBlockData = i6;
|
|
this.rsBlockError = i7;
|
|
}
|
|
|
|
public static SymbolInfo lookup(int i, SymbolShapeHint symbolShapeHint, Dimension dimension, Dimension dimension2, boolean z) {
|
|
for (SymbolInfo symbolInfo : symbols) {
|
|
if (!(symbolShapeHint == SymbolShapeHint.FORCE_SQUARE && symbolInfo.rectangular) && ((symbolShapeHint != SymbolShapeHint.FORCE_RECTANGLE || symbolInfo.rectangular) && i <= symbolInfo.dataCapacity)) {
|
|
return symbolInfo;
|
|
}
|
|
}
|
|
if (z) {
|
|
throw new IllegalArgumentException("Can't find a symbol arrangement that matches the message. Data codewords: ".concat(String.valueOf(i)));
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public final int getHorizontalDataRegions() {
|
|
int i = this.dataRegions;
|
|
int i2 = 1;
|
|
if (i != 1) {
|
|
i2 = 2;
|
|
if (i != 2 && i != 4) {
|
|
if (i == 16) {
|
|
return 4;
|
|
}
|
|
if (i == 36) {
|
|
return 6;
|
|
}
|
|
throw new IllegalStateException("Cannot handle this number of data regions");
|
|
}
|
|
}
|
|
return i2;
|
|
}
|
|
|
|
public final int getVerticalDataRegions() {
|
|
int i = this.dataRegions;
|
|
if (i == 1 || i == 2) {
|
|
return 1;
|
|
}
|
|
if (i == 4) {
|
|
return 2;
|
|
}
|
|
if (i == 16) {
|
|
return 4;
|
|
}
|
|
if (i == 36) {
|
|
return 6;
|
|
}
|
|
throw new IllegalStateException("Cannot handle this number of data regions");
|
|
}
|
|
|
|
public final int getSymbolDataWidth() {
|
|
return getHorizontalDataRegions() * this.matrixWidth;
|
|
}
|
|
|
|
public final int getSymbolDataHeight() {
|
|
return getVerticalDataRegions() * this.matrixHeight;
|
|
}
|
|
|
|
public final int getSymbolWidth() {
|
|
return getSymbolDataWidth() + (getHorizontalDataRegions() << 1);
|
|
}
|
|
|
|
public final int getSymbolHeight() {
|
|
return getSymbolDataHeight() + (getVerticalDataRegions() << 1);
|
|
}
|
|
|
|
public int getInterleavedBlockCount() {
|
|
return this.dataCapacity / this.rsBlockData;
|
|
}
|
|
|
|
public final String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.rectangular ? "Rectangular Symbol:" : "Square Symbol:");
|
|
sb.append(" data region ");
|
|
sb.append(this.matrixWidth);
|
|
sb.append('x');
|
|
sb.append(this.matrixHeight);
|
|
sb.append(", symbol size ");
|
|
sb.append(getSymbolWidth());
|
|
sb.append('x');
|
|
sb.append(getSymbolHeight());
|
|
sb.append(", symbol data size ");
|
|
sb.append(getSymbolDataWidth());
|
|
sb.append('x');
|
|
sb.append(getSymbolDataHeight());
|
|
sb.append(", codewords ");
|
|
sb.append(this.dataCapacity);
|
|
sb.append('+');
|
|
sb.append(this.errorCodewords);
|
|
return sb.toString();
|
|
}
|
|
}
|