421 lines
14 KiB
Java
421 lines
14 KiB
Java
package o;
|
|
|
|
import com.google.zxing.WriterException;
|
|
import java.lang.reflect.Array;
|
|
import java.nio.charset.Charset;
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public final class YzJ {
|
|
final String a;
|
|
final C17668yld b;
|
|
final FVz c;
|
|
final boolean e;
|
|
|
|
/* loaded from: classes2.dex */
|
|
enum Sts {
|
|
SMALL("version 1-9"),
|
|
MEDIUM("version 10-26"),
|
|
LARGE("version 27-40");
|
|
|
|
private final String description;
|
|
|
|
Sts(String str) {
|
|
this.description = str;
|
|
}
|
|
|
|
@Override // java.lang.Enum
|
|
public final String toString() {
|
|
return this.description;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public YzJ(String str, Charset charset, boolean z, FVz fVz) {
|
|
this.a = str;
|
|
this.e = z;
|
|
this.b = new C17668yld(str, charset, -1);
|
|
this.c = fVz;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public static C0480Hnn a(Sts sts) {
|
|
int i = AnonymousClass5.e[sts.ordinal()];
|
|
if (i == 1) {
|
|
return C0480Hnn.a(9);
|
|
}
|
|
if (i == 2) {
|
|
return C0480Hnn.a(26);
|
|
}
|
|
return C0480Hnn.a(40);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* renamed from: o.YzJ$5, reason: invalid class name */
|
|
/* loaded from: classes2.dex */
|
|
public static /* synthetic */ class AnonymousClass5 {
|
|
static final int[] c;
|
|
static final int[] e;
|
|
|
|
static {
|
|
int[] iArr = new int[JLe.values().length];
|
|
c = iArr;
|
|
try {
|
|
iArr[JLe.KANJI.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused) {
|
|
}
|
|
try {
|
|
c[JLe.ALPHANUMERIC.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused2) {
|
|
}
|
|
try {
|
|
c[JLe.NUMERIC.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused3) {
|
|
}
|
|
try {
|
|
c[JLe.BYTE.ordinal()] = 4;
|
|
} catch (NoSuchFieldError unused4) {
|
|
}
|
|
try {
|
|
c[JLe.ECI.ordinal()] = 5;
|
|
} catch (NoSuchFieldError unused5) {
|
|
}
|
|
int[] iArr2 = new int[Sts.values().length];
|
|
e = iArr2;
|
|
try {
|
|
iArr2[Sts.SMALL.ordinal()] = 1;
|
|
} catch (NoSuchFieldError unused6) {
|
|
}
|
|
try {
|
|
e[Sts.MEDIUM.ordinal()] = 2;
|
|
} catch (NoSuchFieldError unused7) {
|
|
}
|
|
try {
|
|
e[Sts.LARGE.ordinal()] = 3;
|
|
} catch (NoSuchFieldError unused8) {
|
|
}
|
|
}
|
|
}
|
|
|
|
private static boolean c(JLe jLe, char c) {
|
|
int i = AnonymousClass5.c[jLe.ordinal()];
|
|
if (i != 1) {
|
|
return i != 2 ? i != 3 ? i == 4 : c >= '0' && c <= '9' : VNp.e(c) != -1;
|
|
}
|
|
return VNp.a(String.valueOf(c));
|
|
}
|
|
|
|
private static void b(RVV[][][] rvvArr, int i, RVV rvv) {
|
|
char c;
|
|
RVV rvv2;
|
|
RVV[] rvvArr2 = rvvArr[i + rvv.e][rvv.a];
|
|
JLe jLe = rvv.c;
|
|
if (jLe != null) {
|
|
int i2 = AnonymousClass5.c[jLe.ordinal()];
|
|
c = 1;
|
|
if (i2 != 1) {
|
|
if (i2 != 2) {
|
|
c = 3;
|
|
if (i2 == 3) {
|
|
c = 2;
|
|
} else if (i2 != 4) {
|
|
throw new IllegalStateException("Illegal mode ".concat(String.valueOf(jLe)));
|
|
}
|
|
}
|
|
rvv2 = rvvArr2[c];
|
|
if (rvv2 != null || rvv2.b > rvv.b) {
|
|
rvvArr2[c] = rvv;
|
|
}
|
|
return;
|
|
}
|
|
}
|
|
c = 0;
|
|
rvv2 = rvvArr2[c];
|
|
if (rvv2 != null) {
|
|
}
|
|
rvvArr2[c] = rvv;
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:17:0x0076 */
|
|
/* JADX WARN: Removed duplicated region for block: B:20:0x00a2 */
|
|
/* JADX WARN: Removed duplicated region for block: B:29:0x00da */
|
|
/* JADX WARN: Removed duplicated region for block: B:43:? A[RETURN, SYNTHETIC] */
|
|
/* JADX WARN: Removed duplicated region for block: B:8:0x0035 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private void d(o.C0480Hnn r17, o.YzJ.RVV[][][] r18, int r19, o.YzJ.RVV r20) {
|
|
/*
|
|
Method dump skipped, instructions count: 282
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: o.YzJ.d(o.Hnn, o.YzJ$RVV[][][], int, o.YzJ$RVV):void");
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final IeS c(C0480Hnn c0480Hnn) throws WriterException {
|
|
int length = this.a.length();
|
|
RVV[][][] rvvArr = (RVV[][][]) Array.newInstance((Class<?>) RVV.class, length + 1, this.b.e.length, 4);
|
|
d(c0480Hnn, rvvArr, 0, null);
|
|
for (int i = 1; i <= length; i++) {
|
|
for (int i2 = 0; i2 < this.b.e.length; i2++) {
|
|
for (int i3 = 0; i3 < 4; i3++) {
|
|
RVV rvv = rvvArr[i][i2][i3];
|
|
if (rvv != null && i < length) {
|
|
d(c0480Hnn, rvvArr, i, rvv);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
int i4 = -1;
|
|
int i5 = Integer.MAX_VALUE;
|
|
int i6 = -1;
|
|
for (int i7 = 0; i7 < this.b.e.length; i7++) {
|
|
for (int i8 = 0; i8 < 4; i8++) {
|
|
RVV rvv2 = rvvArr[length][i7][i8];
|
|
if (rvv2 != null && rvv2.b < i5) {
|
|
i5 = rvv2.b;
|
|
i4 = i7;
|
|
i6 = i8;
|
|
}
|
|
}
|
|
}
|
|
if (i4 < 0) {
|
|
StringBuilder sb = new StringBuilder("Internal error: failed to encode \"");
|
|
sb.append(this.a);
|
|
sb.append("\"");
|
|
throw new WriterException(sb.toString());
|
|
}
|
|
return new IeS(this, c0480Hnn, rvvArr[length][i4][i6]);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public final class RVV {
|
|
private final int a;
|
|
private final int b;
|
|
private final JLe c;
|
|
private final int d;
|
|
private final int e;
|
|
private final RVV h;
|
|
private YzJ i;
|
|
|
|
/* synthetic */ RVV(YzJ yzJ, JLe jLe, int i, int i2, int i3, RVV rvv, C0480Hnn c0480Hnn, byte b) {
|
|
this(yzJ, jLe, i, i2, i3, rvv, c0480Hnn);
|
|
}
|
|
|
|
private RVV(YzJ yzJ, JLe jLe, int i, int i2, int i3, RVV rvv, C0480Hnn c0480Hnn) {
|
|
this.i = yzJ;
|
|
this.c = jLe;
|
|
this.d = i;
|
|
int i4 = (jLe == JLe.BYTE || rvv == null) ? i2 : rvv.a;
|
|
this.a = i4;
|
|
this.e = i3;
|
|
this.h = rvv;
|
|
boolean z = false;
|
|
int i5 = rvv != null ? rvv.b : 0;
|
|
if ((jLe == JLe.BYTE && rvv == null && i4 != 0) || (rvv != null && i4 != rvv.a)) {
|
|
z = true;
|
|
}
|
|
i5 = (rvv == null || jLe != rvv.c || z) ? i5 + jLe.c(c0480Hnn) + 4 : i5;
|
|
int i6 = AnonymousClass5.c[jLe.ordinal()];
|
|
if (i6 == 1) {
|
|
i5 += 13;
|
|
} else if (i6 == 2) {
|
|
i5 += i3 == 1 ? 6 : 11;
|
|
} else if (i6 == 3) {
|
|
i5 += i3 != 1 ? i3 == 2 ? 7 : 10 : 4;
|
|
} else if (i6 == 4) {
|
|
i5 += yzJ.a.substring(i, i3 + i).getBytes(yzJ.b.e[i2].charset()).length << 3;
|
|
if (z) {
|
|
i5 += 12;
|
|
}
|
|
}
|
|
this.b = i5;
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public final class IeS {
|
|
final List<Sts> a = new ArrayList();
|
|
final YzJ c;
|
|
final C0480Hnn e;
|
|
|
|
IeS(YzJ yzJ, C0480Hnn c0480Hnn, RVV rvv) {
|
|
int i;
|
|
Sts sts;
|
|
this.c = yzJ;
|
|
int i2 = 0;
|
|
boolean z = false;
|
|
while (true) {
|
|
i = 1;
|
|
if (rvv == null) {
|
|
break;
|
|
}
|
|
int i3 = i2 + rvv.e;
|
|
RVV rvv2 = rvv.h;
|
|
boolean z2 = (rvv.c == JLe.BYTE && rvv2 == null && rvv.a != 0) || !(rvv2 == null || rvv.a == rvv2.a);
|
|
z = z2 ? true : z;
|
|
if (rvv2 == null || rvv2.c != rvv.c || z2) {
|
|
this.a.add(0, new Sts(this, rvv.c, rvv.d, rvv.a, i3));
|
|
i3 = 0;
|
|
}
|
|
if (z2) {
|
|
this.a.add(0, new Sts(this, JLe.ECI, rvv.d, rvv.a, 0));
|
|
}
|
|
rvv = rvv2;
|
|
i2 = i3;
|
|
}
|
|
if (yzJ.e) {
|
|
Sts sts2 = this.a.get(0);
|
|
if (sts2 != null && sts2.e != JLe.ECI && z) {
|
|
this.a.add(0, new Sts(this, JLe.ECI, 0, 0, 0));
|
|
}
|
|
this.a.add(this.a.get(0).e == JLe.ECI ? 1 : 0, new Sts(this, JLe.FNC1_FIRST_POSITION, 0, 0, 0));
|
|
}
|
|
int i4 = c0480Hnn.e;
|
|
int[] iArr = AnonymousClass5.e;
|
|
int i5 = 26;
|
|
if (c0480Hnn.e <= 9) {
|
|
sts = Sts.SMALL;
|
|
} else {
|
|
sts = c0480Hnn.e <= 26 ? Sts.MEDIUM : Sts.LARGE;
|
|
}
|
|
int i6 = iArr[sts.ordinal()];
|
|
if (i6 == 1) {
|
|
i5 = 9;
|
|
} else if (i6 != 2) {
|
|
i = 27;
|
|
i5 = 40;
|
|
} else {
|
|
i = 10;
|
|
}
|
|
int b = b(c0480Hnn);
|
|
while (i4 < i5 && !VNp.b(b, C0480Hnn.a(i4), yzJ.c)) {
|
|
i4++;
|
|
}
|
|
while (i4 > i && VNp.b(b, C0480Hnn.a(i4 - 1), yzJ.c)) {
|
|
i4--;
|
|
}
|
|
this.e = C0480Hnn.a(i4);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final int b(C0480Hnn c0480Hnn) {
|
|
Iterator<Sts> it = this.a.iterator();
|
|
int i = 0;
|
|
while (it.hasNext()) {
|
|
i += it.next().e(c0480Hnn);
|
|
}
|
|
return i;
|
|
}
|
|
|
|
public final String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
Sts sts = null;
|
|
for (Sts sts2 : this.a) {
|
|
if (sts != null) {
|
|
sb.append(",");
|
|
}
|
|
sb.append(sts2.toString());
|
|
sts = sts2;
|
|
}
|
|
return sb.toString();
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
/* loaded from: classes2.dex */
|
|
public final class Sts {
|
|
final int a;
|
|
final IeS b;
|
|
final int c;
|
|
final int d;
|
|
final JLe e;
|
|
|
|
Sts(IeS ieS, JLe jLe, int i, int i2, int i3) {
|
|
this.b = ieS;
|
|
this.e = jLe;
|
|
this.c = i;
|
|
this.d = i2;
|
|
this.a = i3;
|
|
}
|
|
|
|
final int e(C0480Hnn c0480Hnn) {
|
|
int i;
|
|
int i2;
|
|
int c = this.e.c(c0480Hnn);
|
|
int i3 = c + 4;
|
|
int i4 = AnonymousClass5.c[this.e.ordinal()];
|
|
if (i4 != 1) {
|
|
int i5 = 0;
|
|
if (i4 == 2) {
|
|
int i6 = this.a;
|
|
i2 = i3 + ((i6 / 2) * 11);
|
|
if (i6 % 2 == 1) {
|
|
i5 = 6;
|
|
}
|
|
} else if (i4 == 3) {
|
|
int i7 = this.a;
|
|
i2 = i3 + ((i7 / 3) * 10);
|
|
int i8 = i7 % 3;
|
|
if (i8 == 1) {
|
|
i5 = 4;
|
|
} else if (i8 == 2) {
|
|
i5 = 7;
|
|
}
|
|
} else {
|
|
if (i4 != 4) {
|
|
return i4 != 5 ? i3 : c + 12;
|
|
}
|
|
i = b() << 3;
|
|
}
|
|
return i2 + i5;
|
|
}
|
|
i = this.a * 13;
|
|
return i3 + i;
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
public final int b() {
|
|
if (this.e != JLe.BYTE) {
|
|
return this.a;
|
|
}
|
|
C17668yld c17668yld = this.b.c.b;
|
|
String str = this.b.c.a;
|
|
int i = this.c;
|
|
return str.substring(i, this.a + i).getBytes(c17668yld.e[this.d].charset()).length;
|
|
}
|
|
|
|
public final String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this.e);
|
|
sb.append('(');
|
|
if (this.e == JLe.ECI) {
|
|
C17668yld c17668yld = this.b.c.b;
|
|
sb.append(c17668yld.e[this.d].charset().displayName());
|
|
} else {
|
|
String str = this.b.c.a;
|
|
int i = this.c;
|
|
String substring = str.substring(i, this.a + i);
|
|
StringBuilder sb2 = new StringBuilder();
|
|
for (int i2 = 0; i2 < substring.length(); i2++) {
|
|
if (substring.charAt(i2) < ' ' || substring.charAt(i2) > '~') {
|
|
sb2.append('.');
|
|
} else {
|
|
sb2.append(substring.charAt(i2));
|
|
}
|
|
}
|
|
sb.append(sb2.toString());
|
|
}
|
|
sb.append(')');
|
|
return sb.toString();
|
|
}
|
|
}
|
|
}
|
|
}
|