239 lines
9.9 KiB
Java
239 lines
9.9 KiB
Java
package com.google.android.gms.internal.firebase_ml;
|
|
|
|
import com.google.common.base.Ascii;
|
|
import net.sf.scuba.smartcards.ISO7816;
|
|
import net.sf.scuba.smartcards.ISOFileInfo;
|
|
import org.jmrtd.lds.CVCAFile;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class zzgt extends zzgu {
|
|
private static final byte[] zzxh = {13, 10};
|
|
private static final byte[] zzxi = {65, CVCAFile.CAR_TAG, 67, ISO7816.INS_REHABILITATE_CHV, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, ISOFileInfo.FCP_BYTE, 99, ISOFileInfo.FMD_BYTE, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, ISOFileInfo.FCI_BYTE, ISO7816.INS_MANAGE_CHANNEL, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, ISO7816.INS_DECREASE, 49, ISO7816.INS_INCREASE, 51, ISO7816.INS_DECREASE_STAMPED, 53, 54, 55, 56, 57, 43, 47};
|
|
private static final byte[] zzxj = {65, CVCAFile.CAR_TAG, 67, ISO7816.INS_REHABILITATE_CHV, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 97, ISOFileInfo.FCP_BYTE, 99, ISOFileInfo.FMD_BYTE, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, ISOFileInfo.FCI_BYTE, ISO7816.INS_MANAGE_CHANNEL, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, ISO7816.INS_DECREASE, 49, ISO7816.INS_INCREASE, 51, ISO7816.INS_DECREASE_STAMPED, 53, 54, 55, 56, 57, 45, 95};
|
|
private static final byte[] zzxk = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 62, -1, 62, -1, 63, ISO7816.INS_DECREASE_STAMPED, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, -1, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, Ascii.DC2, 19, Ascii.DC4, Ascii.NAK, Ascii.SYN, Ascii.ETB, Ascii.CAN, Ascii.EM, -1, -1, -1, -1, 63, -1, Ascii.SUB, Ascii.ESC, 28, 29, 30, Ascii.US, 32, 33, ISO7816.INS_MSE, 35, ISO7816.INS_CHANGE_CHV, 37, 38, 39, 40, 41, ISO7816.INS_PSO, 43, ISO7816.INS_UNBLOCK_CHV, 45, 46, 47, ISO7816.INS_DECREASE, 49, ISO7816.INS_INCREASE, 51};
|
|
private final byte[] zzxl;
|
|
private final byte[] zzxm;
|
|
private final byte[] zzxn;
|
|
private final int zzxo;
|
|
private final int zzxp;
|
|
|
|
public zzgt() {
|
|
this(0);
|
|
}
|
|
|
|
private zzgt(int i) {
|
|
this(0, zzxh);
|
|
}
|
|
|
|
private zzgt(int i, byte[] bArr) {
|
|
this(0, bArr, false);
|
|
}
|
|
|
|
/* JADX WARN: Removed duplicated region for block: B:24:0x0060 */
|
|
/* JADX WARN: Removed duplicated region for block: B:27:0x0063 */
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
private zzgt(int r8, byte[] r9, boolean r10) {
|
|
/*
|
|
r7 = this;
|
|
r0 = 0
|
|
if (r9 != 0) goto L5
|
|
r1 = r0
|
|
goto L6
|
|
L5:
|
|
int r1 = r9.length
|
|
L6:
|
|
r2 = 3
|
|
r3 = 4
|
|
r7.<init>(r2, r3, r8, r1)
|
|
byte[] r1 = com.google.android.gms.internal.firebase_ml.zzgt.zzxk
|
|
r7.zzxm = r1
|
|
r1 = 0
|
|
if (r9 == 0) goto L54
|
|
if (r9 == 0) goto L44
|
|
int r2 = r9.length
|
|
r4 = r0
|
|
L16:
|
|
if (r4 >= r2) goto L44
|
|
r5 = r9[r4]
|
|
byte r6 = r7.zzxr
|
|
if (r6 == r5) goto L27
|
|
boolean r5 = r7.zza(r5)
|
|
if (r5 != 0) goto L27
|
|
int r4 = r4 + 1
|
|
goto L16
|
|
L27:
|
|
java.lang.String r8 = com.google.android.gms.internal.firebase_ml.zzgw.zzd(r9)
|
|
java.lang.IllegalArgumentException r9 = new java.lang.IllegalArgumentException
|
|
java.lang.StringBuilder r10 = new java.lang.StringBuilder
|
|
java.lang.String r0 = "lineSeparator must not contain base64 characters: ["
|
|
r10.<init>(r0)
|
|
r10.append(r8)
|
|
java.lang.String r8 = "]"
|
|
r10.append(r8)
|
|
java.lang.String r8 = r10.toString()
|
|
r9.<init>(r8)
|
|
throw r9
|
|
L44:
|
|
if (r8 <= 0) goto L54
|
|
int r8 = r9.length
|
|
int r8 = r8 + r3
|
|
r7.zzxp = r8
|
|
int r8 = r9.length
|
|
byte[] r8 = new byte[r8]
|
|
r7.zzxn = r8
|
|
int r1 = r9.length
|
|
java.lang.System.arraycopy(r9, r0, r8, r0, r1)
|
|
goto L58
|
|
L54:
|
|
r7.zzxp = r3
|
|
r7.zzxn = r1
|
|
L58:
|
|
int r8 = r7.zzxp
|
|
int r8 = r8 + (-1)
|
|
r7.zzxo = r8
|
|
if (r10 == 0) goto L63
|
|
byte[] r8 = com.google.android.gms.internal.firebase_ml.zzgt.zzxj
|
|
goto L65
|
|
L63:
|
|
byte[] r8 = com.google.android.gms.internal.firebase_ml.zzgt.zzxi
|
|
L65:
|
|
r7.zzxl = r8
|
|
return
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.firebase_ml.zzgt.<init>(int, byte[], boolean):void");
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Override // com.google.android.gms.internal.firebase_ml.zzgu
|
|
public final void zza(byte[] bArr, int i, int i2, zzgv zzgvVar) {
|
|
if (zzgvVar.eof) {
|
|
return;
|
|
}
|
|
if (i2 >= 0) {
|
|
int i3 = 0;
|
|
while (i3 < i2) {
|
|
byte[] zza = zza(this.zzxp, zzgvVar);
|
|
zzgvVar.zzxz = (zzgvVar.zzxz + 1) % 3;
|
|
int i4 = bArr[i];
|
|
if (i4 < 0) {
|
|
i4 += 256;
|
|
}
|
|
zzgvVar.zzxw = (zzgvVar.zzxw << 8) + i4;
|
|
if (zzgvVar.zzxz == 0) {
|
|
int i5 = zzgvVar.pos;
|
|
zzgvVar.pos = i5 + 1;
|
|
zza[i5] = this.zzxl[(zzgvVar.zzxw >> 18) & 63];
|
|
int i6 = zzgvVar.pos;
|
|
zzgvVar.pos = i6 + 1;
|
|
zza[i6] = this.zzxl[(zzgvVar.zzxw >> 12) & 63];
|
|
int i7 = zzgvVar.pos;
|
|
zzgvVar.pos = i7 + 1;
|
|
zza[i7] = this.zzxl[(zzgvVar.zzxw >> 6) & 63];
|
|
int i8 = zzgvVar.pos;
|
|
zzgvVar.pos = i8 + 1;
|
|
zza[i8] = this.zzxl[zzgvVar.zzxw & 63];
|
|
zzgvVar.zzxy += 4;
|
|
if (this.zzxu > 0 && this.zzxu <= zzgvVar.zzxy) {
|
|
System.arraycopy(this.zzxn, 0, zza, zzgvVar.pos, this.zzxn.length);
|
|
zzgvVar.pos += this.zzxn.length;
|
|
zzgvVar.zzxy = 0;
|
|
}
|
|
}
|
|
i3++;
|
|
i++;
|
|
}
|
|
return;
|
|
}
|
|
zzgvVar.eof = true;
|
|
if (zzgvVar.zzxz == 0 && this.zzxu == 0) {
|
|
return;
|
|
}
|
|
byte[] zza2 = zza(this.zzxp, zzgvVar);
|
|
int i9 = zzgvVar.pos;
|
|
int i10 = zzgvVar.zzxz;
|
|
if (i10 != 0) {
|
|
if (i10 == 1) {
|
|
int i11 = zzgvVar.pos;
|
|
zzgvVar.pos = i11 + 1;
|
|
zza2[i11] = this.zzxl[(zzgvVar.zzxw >> 2) & 63];
|
|
int i12 = zzgvVar.pos;
|
|
zzgvVar.pos = i12 + 1;
|
|
zza2[i12] = this.zzxl[(zzgvVar.zzxw << 4) & 63];
|
|
if (this.zzxl == zzxi) {
|
|
int i13 = zzgvVar.pos;
|
|
zzgvVar.pos = i13 + 1;
|
|
zza2[i13] = this.zzxr;
|
|
int i14 = zzgvVar.pos;
|
|
zzgvVar.pos = i14 + 1;
|
|
zza2[i14] = this.zzxr;
|
|
}
|
|
} else if (i10 == 2) {
|
|
int i15 = zzgvVar.pos;
|
|
zzgvVar.pos = i15 + 1;
|
|
zza2[i15] = this.zzxl[(zzgvVar.zzxw >> 10) & 63];
|
|
int i16 = zzgvVar.pos;
|
|
zzgvVar.pos = i16 + 1;
|
|
zza2[i16] = this.zzxl[(zzgvVar.zzxw >> 4) & 63];
|
|
int i17 = zzgvVar.pos;
|
|
zzgvVar.pos = i17 + 1;
|
|
zza2[i17] = this.zzxl[(zzgvVar.zzxw << 2) & 63];
|
|
if (this.zzxl == zzxi) {
|
|
int i18 = zzgvVar.pos;
|
|
zzgvVar.pos = i18 + 1;
|
|
zza2[i18] = this.zzxr;
|
|
}
|
|
} else {
|
|
throw new IllegalStateException("Impossible modulus " + zzgvVar.zzxz);
|
|
}
|
|
}
|
|
zzgvVar.zzxy += zzgvVar.pos - i9;
|
|
if (this.zzxu <= 0 || zzgvVar.zzxy <= 0) {
|
|
return;
|
|
}
|
|
System.arraycopy(this.zzxn, 0, zza2, zzgvVar.pos, this.zzxn.length);
|
|
zzgvVar.pos += this.zzxn.length;
|
|
}
|
|
|
|
public static String zzb(byte[] bArr) {
|
|
if (bArr != null && bArr.length != 0) {
|
|
zzgt zzgtVar = new zzgt(0, zzxh, true);
|
|
long zzc = zzgtVar.zzc(bArr);
|
|
if (zzc > 2147483647L) {
|
|
throw new IllegalArgumentException("Input array too big, the output array would be bigger (" + zzc + ") than the specified maximum size of 2147483647");
|
|
}
|
|
if (bArr != null && bArr.length != 0) {
|
|
zzgv zzgvVar = new zzgv();
|
|
zzgtVar.zza(bArr, 0, bArr.length, zzgvVar);
|
|
zzgtVar.zza(bArr, 0, -1, zzgvVar);
|
|
int i = zzgvVar.pos - zzgvVar.zzxx;
|
|
byte[] bArr2 = new byte[i];
|
|
if (zzgvVar.buffer != null) {
|
|
int min = Math.min(zzgvVar.buffer != null ? zzgvVar.pos - zzgvVar.zzxx : 0, i);
|
|
System.arraycopy(zzgvVar.buffer, zzgvVar.zzxx, bArr2, 0, min);
|
|
zzgvVar.zzxx += min;
|
|
if (zzgvVar.zzxx >= zzgvVar.pos) {
|
|
zzgvVar.buffer = null;
|
|
}
|
|
} else {
|
|
boolean z = zzgvVar.eof;
|
|
}
|
|
bArr = bArr2;
|
|
}
|
|
}
|
|
return zzgw.zzd(bArr);
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: protected */
|
|
@Override // com.google.android.gms.internal.firebase_ml.zzgu
|
|
public final boolean zza(byte b) {
|
|
if (b < 0) {
|
|
return false;
|
|
}
|
|
byte[] bArr = this.zzxm;
|
|
return b < bArr.length && bArr[b] != -1;
|
|
}
|
|
}
|