- 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
111 lines
2.8 KiB
Java
111 lines
2.8 KiB
Java
package com.google.zxing.datamatrix.encoder;
|
|
|
|
import com.google.zxing.Dimension;
|
|
import java.nio.charset.StandardCharsets;
|
|
|
|
/* loaded from: classes3.dex */
|
|
public final class EncoderContext {
|
|
public final StringBuilder codewords;
|
|
public final String msg;
|
|
public int newEncoding;
|
|
public int pos;
|
|
public SymbolShapeHint shape;
|
|
public int skipAtEnd;
|
|
public SymbolInfo symbolInfo;
|
|
|
|
public StringBuilder getCodewords() {
|
|
return this.codewords;
|
|
}
|
|
|
|
public String getMessage() {
|
|
return this.msg;
|
|
}
|
|
|
|
public int getNewEncoding() {
|
|
return this.newEncoding;
|
|
}
|
|
|
|
public SymbolInfo getSymbolInfo() {
|
|
return this.symbolInfo;
|
|
}
|
|
|
|
public void resetEncoderSignal() {
|
|
this.newEncoding = -1;
|
|
}
|
|
|
|
public void resetSymbolInfo() {
|
|
this.symbolInfo = null;
|
|
}
|
|
|
|
public void setSizeConstraints(Dimension dimension, Dimension dimension2) {
|
|
}
|
|
|
|
public void setSkipAtEnd(int i) {
|
|
this.skipAtEnd = i;
|
|
}
|
|
|
|
public void setSymbolShape(SymbolShapeHint symbolShapeHint) {
|
|
this.shape = symbolShapeHint;
|
|
}
|
|
|
|
public void signalEncoderChange(int i) {
|
|
this.newEncoding = i;
|
|
}
|
|
|
|
public EncoderContext(String str) {
|
|
byte[] bytes = str.getBytes(StandardCharsets.ISO_8859_1);
|
|
StringBuilder sb = new StringBuilder(bytes.length);
|
|
int length = bytes.length;
|
|
for (int i = 0; i < length; i++) {
|
|
char c = (char) (bytes[i] & 255);
|
|
if (c == '?' && str.charAt(i) != '?') {
|
|
throw new IllegalArgumentException("Message contains characters outside ISO-8859-1 encoding.");
|
|
}
|
|
sb.append(c);
|
|
}
|
|
this.msg = sb.toString();
|
|
this.shape = SymbolShapeHint.FORCE_NONE;
|
|
this.codewords = new StringBuilder(str.length());
|
|
this.newEncoding = -1;
|
|
}
|
|
|
|
public char getCurrentChar() {
|
|
return this.msg.charAt(this.pos);
|
|
}
|
|
|
|
public void writeCodewords(String str) {
|
|
this.codewords.append(str);
|
|
}
|
|
|
|
public void writeCodeword(char c) {
|
|
this.codewords.append(c);
|
|
}
|
|
|
|
public int getCodewordCount() {
|
|
return this.codewords.length();
|
|
}
|
|
|
|
public boolean hasMoreCharacters() {
|
|
return this.pos < getTotalMessageCharCount();
|
|
}
|
|
|
|
public final int getTotalMessageCharCount() {
|
|
return this.msg.length() - this.skipAtEnd;
|
|
}
|
|
|
|
public int getRemainingCharacters() {
|
|
return getTotalMessageCharCount() - this.pos;
|
|
}
|
|
|
|
public void updateSymbolInfo() {
|
|
updateSymbolInfo(getCodewordCount());
|
|
}
|
|
|
|
public void updateSymbolInfo(int i) {
|
|
SymbolInfo symbolInfo = this.symbolInfo;
|
|
if (symbolInfo == null || i > symbolInfo.getDataCapacity()) {
|
|
this.symbolInfo = SymbolInfo.lookup(i, this.shape, null, null, true);
|
|
}
|
|
}
|
|
}
|