what-the-bank/sources/com/google/android/gms/internal/gtm/zzue.java

315 lines
12 KiB
Java

package com.google.android.gms.internal.gtm;
import com.kofax.mobile.sdk._internal.impl.camera.h;
import java.nio.ByteBuffer;
/* loaded from: classes2.dex */
final class zzue extends zzub {
/* JADX WARN: Code restructure failed: missing block: B:71:0x0055, code lost:
return -1;
*/
@Override // com.google.android.gms.internal.gtm.zzub
/*
Code decompiled incorrectly, please refer to instructions dump.
To view partially-correct add '--show-bad-code' argument
*/
final int zzb(int r12, byte[] r13, int r14, int r15) {
/*
Method dump skipped, instructions count: 207
To view this dump add '--comments-level debug' option
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.gms.internal.gtm.zzue.zzb(int, byte[], int, int):int");
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.android.gms.internal.gtm.zzub
public final String zzh(byte[] bArr, int i, int i2) throws zzrk {
boolean zzd;
boolean zzd2;
boolean zze;
boolean zzf;
boolean zzd3;
if ((i | i2 | ((bArr.length - i) - i2)) < 0) {
throw new ArrayIndexOutOfBoundsException(String.format("buffer length=%d, index=%d, size=%d", Integer.valueOf(bArr.length), Integer.valueOf(i), Integer.valueOf(i2)));
}
int i3 = i + i2;
char[] cArr = new char[i2];
int i4 = 0;
while (i < i3) {
byte zza = zztx.zza(bArr, i);
zzd3 = zzua.zzd(zza);
if (!zzd3) {
break;
}
i++;
zzua.zza(zza, cArr, i4);
i4++;
}
int i5 = i4;
while (i < i3) {
int i6 = i + 1;
byte zza2 = zztx.zza(bArr, i);
zzd = zzua.zzd(zza2);
if (zzd) {
zzua.zza(zza2, cArr, i5);
i5++;
i = i6;
while (i < i3) {
byte zza3 = zztx.zza(bArr, i);
zzd2 = zzua.zzd(zza3);
if (zzd2) {
i++;
zzua.zza(zza3, cArr, i5);
i5++;
}
}
} else {
zze = zzua.zze(zza2);
if (!zze) {
zzf = zzua.zzf(zza2);
if (zzf) {
if (i6 >= i3 - 1) {
throw zzrk.zzpw();
}
zzua.zza(zza2, zztx.zza(bArr, i6), zztx.zza(bArr, i + 2), cArr, i5);
i5++;
i += 3;
} else if (i6 < i3 - 2) {
zzua.zza(zza2, zztx.zza(bArr, i6), zztx.zza(bArr, i + 2), zztx.zza(bArr, i + 3), cArr, i5);
i5 += 2;
i += 4;
} else {
throw zzrk.zzpw();
}
} else if (i6 < i3) {
i += 2;
zzua.zza(zza2, zztx.zza(bArr, i6), cArr, i5);
i5++;
} else {
throw zzrk.zzpw();
}
}
}
return new String(cArr, 0, i5);
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.android.gms.internal.gtm.zzub
public final int zzb(CharSequence charSequence, byte[] bArr, int i, int i2) {
long j;
String str;
String str2;
long j2;
int i3;
char charAt;
long j3 = i;
long j4 = i2 + j3;
int length = charSequence.length();
String str3 = " at index ";
String str4 = "Failed writing ";
if (length > i2 || bArr.length - i2 < i) {
char charAt2 = charSequence.charAt(length - 1);
StringBuilder sb = new StringBuilder(37);
sb.append("Failed writing ");
sb.append(charAt2);
sb.append(" at index ");
sb.append(i + i2);
throw new ArrayIndexOutOfBoundsException(sb.toString());
}
int i4 = 0;
while (true) {
j = 1;
if (i4 >= length || (charAt = charSequence.charAt(i4)) >= 128) {
break;
}
zztx.zza(bArr, j3, (byte) charAt);
i4++;
j3++;
}
if (i4 == length) {
return (int) j3;
}
while (i4 < length) {
char charAt3 = charSequence.charAt(i4);
if (charAt3 >= 128 || j3 >= j4) {
if (charAt3 < 2048 && j3 <= j4 - 2) {
zztx.zza(bArr, j3, (byte) ((charAt3 >>> 6) | 960));
j2 = 2 + j3;
zztx.zza(bArr, j3 + j, (byte) ((charAt3 & '?') | 128));
str = str3;
str2 = str4;
} else {
if ((charAt3 >= 55296 && 57343 >= charAt3) || j3 > j4 - 3) {
str = str3;
str2 = str4;
if (j3 <= j4 - 4) {
int i5 = i4 + 1;
if (i5 != length) {
char charAt4 = charSequence.charAt(i5);
if (Character.isSurrogatePair(charAt3, charAt4)) {
int codePoint = Character.toCodePoint(charAt3, charAt4);
zztx.zza(bArr, j3, (byte) ((codePoint >>> 18) | 240));
zztx.zza(bArr, j3 + j, (byte) (((codePoint >>> 12) & 63) | 128));
zztx.zza(bArr, j3 + 2, (byte) (((codePoint >>> 6) & 63) | 128));
zztx.zza(bArr, j3 + 3, (byte) ((codePoint & 63) | 128));
j3 = 4 + j3;
i4 = i5;
} else {
i4 = i5;
}
}
throw new zzud(i4 - 1, length);
}
if (55296 <= charAt3 && charAt3 <= 57343 && ((i3 = i4 + 1) == length || !Character.isSurrogatePair(charAt3, charSequence.charAt(i3)))) {
throw new zzud(i4, length);
}
StringBuilder sb2 = new StringBuilder(46);
sb2.append(str2);
sb2.append(charAt3);
sb2.append(str);
sb2.append(j3);
throw new ArrayIndexOutOfBoundsException(sb2.toString());
}
zztx.zza(bArr, j3, (byte) ((charAt3 >>> '\f') | h.Az));
str = str3;
str2 = str4;
zztx.zza(bArr, j3 + j, (byte) (((charAt3 >>> 6) & 63) | 128));
j2 = j3 + 3;
zztx.zza(bArr, j3 + 2, (byte) ((charAt3 & '?') | 128));
}
j3 = j2;
} else {
zztx.zza(bArr, j3, (byte) charAt3);
j3 += j;
str = str3;
str2 = str4;
}
i4++;
str3 = str;
str4 = str2;
j = 1;
}
return (int) j3;
}
/* JADX INFO: Access modifiers changed from: package-private */
@Override // com.google.android.gms.internal.gtm.zzub
public final void zzb(CharSequence charSequence, ByteBuffer byteBuffer) {
long j;
char c;
long j2;
int i;
long j3;
char c2;
char charAt;
long zzb = zztx.zzb(byteBuffer);
long position = byteBuffer.position() + zzb;
long limit = byteBuffer.limit() + zzb;
int length = charSequence.length();
if (length > limit - position) {
char charAt2 = charSequence.charAt(length - 1);
int limit2 = byteBuffer.limit();
StringBuilder sb = new StringBuilder(37);
sb.append("Failed writing ");
sb.append(charAt2);
sb.append(" at index ");
sb.append(limit2);
throw new ArrayIndexOutOfBoundsException(sb.toString());
}
int i2 = 0;
while (true) {
j = 1;
c = 128;
if (i2 >= length || (charAt = charSequence.charAt(i2)) >= 128) {
break;
}
zztx.zza(position, (byte) charAt);
i2++;
position++;
}
if (i2 == length) {
byteBuffer.position((int) (position - zzb));
return;
}
while (i2 < length) {
char charAt3 = charSequence.charAt(i2);
if (charAt3 >= c || position >= limit) {
if (charAt3 < 2048 && position <= limit - 2) {
zztx.zza(position, (byte) ((charAt3 >>> 6) | 960));
j2 = position + 2;
zztx.zza(position + 1, (byte) ((charAt3 & '?') | c));
} else {
if ((charAt3 >= 55296 && 57343 >= charAt3) || position > limit - 3) {
if (position <= limit - 4) {
int i3 = i2 + 1;
if (i3 != length) {
char charAt4 = charSequence.charAt(i3);
if (Character.isSurrogatePair(charAt3, charAt4)) {
int codePoint = Character.toCodePoint(charAt3, charAt4);
zztx.zza(position, (byte) ((codePoint >>> 18) | 240));
j3 = limit;
zztx.zza(position + 1, (byte) (((codePoint >>> 12) & 63) | 128));
zztx.zza(position + 2, (byte) (((codePoint >>> 6) & 63) | 128));
c2 = 128;
zztx.zza(position + 3, (byte) ((codePoint & 63) | 128));
i2 = i3;
position += 4;
} else {
i2 = i3;
}
}
throw new zzud(i2 - 1, length);
}
if (55296 <= charAt3 && charAt3 <= 57343 && ((i = i2 + 1) == length || !Character.isSurrogatePair(charAt3, charSequence.charAt(i)))) {
throw new zzud(i2, length);
}
StringBuilder sb2 = new StringBuilder(46);
sb2.append("Failed writing ");
sb2.append(charAt3);
sb2.append(" at index ");
sb2.append(position);
throw new ArrayIndexOutOfBoundsException(sb2.toString());
}
zztx.zza(position, (byte) ((charAt3 >>> '\f') | h.Az));
zztx.zza(position + 1, (byte) (((charAt3 >>> 6) & 63) | c));
zztx.zza(position + 2, (byte) ((charAt3 & '?') | 128));
j2 = position + 3;
}
j3 = limit;
position = j2;
c2 = 128;
} else {
zztx.zza(position, (byte) charAt3);
position += j;
j3 = limit;
c2 = c;
}
i2++;
c = c2;
limit = j3;
j = 1;
}
byteBuffer.position((int) (position - zzb));
}
private static int zza(byte[] bArr, int i, long j, int i2) {
int zzbx;
int zzr;
int zzc;
if (i2 == 0) {
zzbx = zztz.zzbx(i);
return zzbx;
}
if (i2 == 1) {
zzr = zztz.zzr(i, zztx.zza(bArr, j));
return zzr;
}
if (i2 == 2) {
zzc = zztz.zzc(i, zztx.zza(bArr, j), zztx.zza(bArr, j + 1));
return zzc;
}
throw new AssertionError();
}
}