- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
581 lines
22 KiB
Java
581 lines
22 KiB
Java
package com.fyber.inneractive.sdk.protobuf;
|
|
|
|
import com.applovin.exoplayer2.common.base.Ascii;
|
|
import com.fyber.inneractive.sdk.protobuf.p1;
|
|
import com.mbridge.msdk.playercommon.exoplayer2.extractor.ts.PsExtractor;
|
|
import java.nio.ByteBuffer;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class q1 {
|
|
public static final b a;
|
|
|
|
public static abstract class b {
|
|
public static String a(ByteBuffer byteBuffer, int i, int i2) throws z {
|
|
if ((i | i2 | ((byteBuffer.limit() - i) - i2)) < 0) {
|
|
throw new ArrayIndexOutOfBoundsException(String.format("buffer limit=%d, index=%d, limit=%d", Integer.valueOf(byteBuffer.limit()), Integer.valueOf(i), Integer.valueOf(i2)));
|
|
}
|
|
int i3 = i + i2;
|
|
char[] cArr = new char[i2];
|
|
int i4 = 0;
|
|
while (i < i3) {
|
|
byte b = byteBuffer.get(i);
|
|
if (!a.a(b)) {
|
|
break;
|
|
}
|
|
i++;
|
|
cArr[i4] = (char) b;
|
|
i4++;
|
|
}
|
|
int i5 = i4;
|
|
while (i < i3) {
|
|
int i6 = i + 1;
|
|
byte b2 = byteBuffer.get(i);
|
|
if (a.a(b2)) {
|
|
cArr[i5] = (char) b2;
|
|
i5++;
|
|
i = i6;
|
|
while (i < i3) {
|
|
byte b3 = byteBuffer.get(i);
|
|
if (!a.a(b3)) {
|
|
break;
|
|
}
|
|
i++;
|
|
cArr[i5] = (char) b3;
|
|
i5++;
|
|
}
|
|
} else if (a.b(b2)) {
|
|
if (i6 >= i3) {
|
|
throw z.c();
|
|
}
|
|
i += 2;
|
|
a.a(b2, byteBuffer.get(i6), cArr, i5);
|
|
i5++;
|
|
} else if (a.c(b2)) {
|
|
if (i6 >= i3 - 1) {
|
|
throw z.c();
|
|
}
|
|
int i7 = i + 2;
|
|
i += 3;
|
|
a.a(b2, byteBuffer.get(i6), byteBuffer.get(i7), cArr, i5);
|
|
i5++;
|
|
} else {
|
|
if (i6 >= i3 - 2) {
|
|
throw z.c();
|
|
}
|
|
byte b4 = byteBuffer.get(i6);
|
|
int i8 = i + 3;
|
|
byte b5 = byteBuffer.get(i + 2);
|
|
i += 4;
|
|
a.a(b2, b4, b5, byteBuffer.get(i8), cArr, i5);
|
|
i5 += 2;
|
|
}
|
|
}
|
|
return new String(cArr, 0, i5);
|
|
}
|
|
|
|
public abstract int a(int i, int i2, int i3, byte[] bArr);
|
|
|
|
public abstract int a(CharSequence charSequence, byte[] bArr, int i, int i2);
|
|
|
|
public abstract String a(byte[] bArr, int i, int i2) throws z;
|
|
|
|
public abstract String b(ByteBuffer byteBuffer, int i, int i2) throws z;
|
|
|
|
public final boolean b(byte[] bArr, int i, int i2) {
|
|
return a(0, i, i2, bArr) == 0;
|
|
}
|
|
}
|
|
|
|
public static class d extends IllegalArgumentException {
|
|
public d(int i, int i2) {
|
|
super("Unpaired surrogate at index " + i + " of " + i2);
|
|
}
|
|
}
|
|
|
|
static {
|
|
a = (p1.e && p1.d && !com.fyber.inneractive.sdk.protobuf.d.a()) ? new e() : new c();
|
|
}
|
|
|
|
public static int a(int i, int i2) {
|
|
if (i > -12 || i2 > -65) {
|
|
return -1;
|
|
}
|
|
return i ^ (i2 << 8);
|
|
}
|
|
|
|
public static int a(int i, int i2, int i3) {
|
|
if (i > -12 || i2 > -65 || i3 > -65) {
|
|
return -1;
|
|
}
|
|
return (i ^ (i2 << 8)) ^ (i3 << 16);
|
|
}
|
|
|
|
public static int a(CharSequence charSequence) {
|
|
int length = charSequence.length();
|
|
int i = 0;
|
|
int i2 = 0;
|
|
while (i2 < length && charSequence.charAt(i2) < 128) {
|
|
i2++;
|
|
}
|
|
int i3 = length;
|
|
while (true) {
|
|
if (i2 >= length) {
|
|
break;
|
|
}
|
|
char charAt = charSequence.charAt(i2);
|
|
if (charAt < 2048) {
|
|
i3 += (127 - charAt) >>> 31;
|
|
i2++;
|
|
} else {
|
|
int length2 = charSequence.length();
|
|
while (i2 < length2) {
|
|
char charAt2 = charSequence.charAt(i2);
|
|
if (charAt2 < 2048) {
|
|
i += (127 - charAt2) >>> 31;
|
|
} else {
|
|
i += 2;
|
|
if (55296 <= charAt2 && charAt2 <= 57343) {
|
|
if (Character.codePointAt(charSequence, i2) < 65536) {
|
|
throw new d(i2, length2);
|
|
}
|
|
i2++;
|
|
}
|
|
}
|
|
i2++;
|
|
}
|
|
i3 += i;
|
|
}
|
|
}
|
|
if (i3 >= length) {
|
|
return i3;
|
|
}
|
|
throw new IllegalArgumentException("UTF-8 length does not fit in int: " + (i3 + 4294967296L));
|
|
}
|
|
|
|
public static class a {
|
|
public static void a(byte b, byte b2, char[] cArr, int i) throws z {
|
|
if (b < -62 || d(b2)) {
|
|
throw z.c();
|
|
}
|
|
cArr[i] = (char) (((b & Ascii.US) << 6) | (b2 & 63));
|
|
}
|
|
|
|
public static boolean a(byte b) {
|
|
return b >= 0;
|
|
}
|
|
|
|
public static boolean b(byte b) {
|
|
return b < -32;
|
|
}
|
|
|
|
public static boolean c(byte b) {
|
|
return b < -16;
|
|
}
|
|
|
|
public static boolean d(byte b) {
|
|
return b > -65;
|
|
}
|
|
|
|
public static void a(byte b, byte b2, byte b3, char[] cArr, int i) throws z {
|
|
if (!d(b2) && ((b != -32 || b2 >= -96) && ((b != -19 || b2 < -96) && !d(b3)))) {
|
|
cArr[i] = (char) (((b & Ascii.SI) << 12) | ((b2 & 63) << 6) | (b3 & 63));
|
|
return;
|
|
}
|
|
throw z.c();
|
|
}
|
|
|
|
public static void a(byte b, byte b2, byte b3, byte b4, char[] cArr, int i) throws z {
|
|
if (!d(b2)) {
|
|
if ((((b2 + 112) + (b << Ascii.FS)) >> 30) == 0 && !d(b3) && !d(b4)) {
|
|
int i2 = ((b & 7) << 18) | ((b2 & 63) << 12) | ((b3 & 63) << 6) | (b4 & 63);
|
|
cArr[i] = (char) ((i2 >>> 10) + 55232);
|
|
cArr[i + 1] = (char) ((i2 & 1023) + 56320);
|
|
return;
|
|
}
|
|
}
|
|
throw z.c();
|
|
}
|
|
}
|
|
|
|
public static final class c extends b {
|
|
/* JADX WARN: Code restructure failed: missing block: B:26:0x004f, code lost:
|
|
|
|
if (r21[r0] > (-65)) goto L29;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:47:0x0090, code lost:
|
|
|
|
if (r21[r0] > (-65)) goto L50;
|
|
*/
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final int a(int r18, int r19, int r20, byte[] r21) {
|
|
/*
|
|
Method dump skipped, instructions count: 325
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.protobuf.q1.c.a(int, int, int, byte[]):int");
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
public final String b(ByteBuffer byteBuffer, int i, int i2) throws z {
|
|
return b.a(byteBuffer, i, i2);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
public final String a(byte[] bArr, int i, int i2) throws z {
|
|
if ((i | i2 | ((bArr.length - i) - i2)) >= 0) {
|
|
int i3 = i + i2;
|
|
char[] cArr = new char[i2];
|
|
int i4 = 0;
|
|
while (i < i3) {
|
|
byte b = bArr[i];
|
|
if (!a.a(b)) {
|
|
break;
|
|
}
|
|
i++;
|
|
cArr[i4] = (char) b;
|
|
i4++;
|
|
}
|
|
int i5 = i4;
|
|
while (i < i3) {
|
|
int i6 = i + 1;
|
|
byte b2 = bArr[i];
|
|
if (a.a(b2)) {
|
|
cArr[i5] = (char) b2;
|
|
i5++;
|
|
i = i6;
|
|
while (i < i3) {
|
|
byte b3 = bArr[i];
|
|
if (!a.a(b3)) {
|
|
break;
|
|
}
|
|
i++;
|
|
cArr[i5] = (char) b3;
|
|
i5++;
|
|
}
|
|
} else if (a.b(b2)) {
|
|
if (i6 < i3) {
|
|
i += 2;
|
|
a.a(b2, bArr[i6], cArr, i5);
|
|
i5++;
|
|
} else {
|
|
throw z.c();
|
|
}
|
|
} else if (a.c(b2)) {
|
|
if (i6 < i3 - 1) {
|
|
int i7 = i + 2;
|
|
i += 3;
|
|
a.a(b2, bArr[i6], bArr[i7], cArr, i5);
|
|
i5++;
|
|
} else {
|
|
throw z.c();
|
|
}
|
|
} else if (i6 < i3 - 2) {
|
|
byte b4 = bArr[i6];
|
|
int i8 = i + 3;
|
|
byte b5 = bArr[i + 2];
|
|
i += 4;
|
|
a.a(b2, b4, b5, bArr[i8], cArr, i5);
|
|
i5 += 2;
|
|
} else {
|
|
throw z.c();
|
|
}
|
|
}
|
|
return new String(cArr, 0, i5);
|
|
}
|
|
throw new ArrayIndexOutOfBoundsException(String.format("buffer length=%d, index=%d, size=%d", Integer.valueOf(bArr.length), Integer.valueOf(i), Integer.valueOf(i2)));
|
|
}
|
|
|
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x001d, code lost:
|
|
|
|
return r10 + r0;
|
|
*/
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final int a(java.lang.CharSequence r8, byte[] r9, int r10, int r11) {
|
|
/*
|
|
Method dump skipped, instructions count: 251
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.protobuf.q1.c.a(java.lang.CharSequence, byte[], int, int):int");
|
|
}
|
|
}
|
|
|
|
public static final class e extends b {
|
|
/* JADX WARN: Code restructure failed: missing block: B:101:?, code lost:
|
|
|
|
return r1;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:128:0x017d, code lost:
|
|
|
|
if (r1 > (-12)) goto L130;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:13:0x0034, code lost:
|
|
|
|
if (com.fyber.inneractive.sdk.protobuf.p1.a(r26, r4) > (-65)) goto L16;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:30:0x0065, code lost:
|
|
|
|
if (com.fyber.inneractive.sdk.protobuf.p1.a(r26, r4) > (-65)) goto L32;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:50:0x00a9, code lost:
|
|
|
|
if (com.fyber.inneractive.sdk.protobuf.p1.a(r26, r4) > (-65)) goto L53;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:99:0x012e, code lost:
|
|
|
|
if (r1 > (-12)) goto L130;
|
|
*/
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct add '--show-bad-code' argument
|
|
*/
|
|
public final int a(int r23, int r24, int r25, byte[] r26) {
|
|
/*
|
|
Method dump skipped, instructions count: 456
|
|
To view this dump add '--comments-level debug' option
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: com.fyber.inneractive.sdk.protobuf.q1.e.a(int, int, int, byte[]):int");
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
public final String b(ByteBuffer byteBuffer, int i, int i2) throws z {
|
|
long j;
|
|
if ((i | i2 | ((byteBuffer.limit() - i) - i2)) < 0) {
|
|
throw new ArrayIndexOutOfBoundsException(String.format("buffer limit=%d, index=%d, limit=%d", Integer.valueOf(byteBuffer.limit()), Integer.valueOf(i), Integer.valueOf(i2)));
|
|
}
|
|
long a = p1.a(byteBuffer) + i;
|
|
long j2 = i2 + a;
|
|
char[] cArr = new char[i2];
|
|
int i3 = 0;
|
|
while (true) {
|
|
j = 1;
|
|
if (a >= j2) {
|
|
break;
|
|
}
|
|
byte a2 = p1.c.a(a);
|
|
if (!a.a(a2)) {
|
|
break;
|
|
}
|
|
a++;
|
|
cArr[i3] = (char) a2;
|
|
i3++;
|
|
}
|
|
int i4 = i3;
|
|
while (a < j2) {
|
|
long j3 = a + j;
|
|
p1.d dVar = p1.c;
|
|
byte a3 = dVar.a(a);
|
|
if (a.a(a3)) {
|
|
cArr[i4] = (char) a3;
|
|
i4++;
|
|
a = j3;
|
|
while (a < j2) {
|
|
byte a4 = p1.c.a(a);
|
|
if (!a.a(a4)) {
|
|
break;
|
|
}
|
|
a += j;
|
|
cArr[i4] = (char) a4;
|
|
i4++;
|
|
}
|
|
} else if (a.b(a3)) {
|
|
if (j3 >= j2) {
|
|
throw z.c();
|
|
}
|
|
a += 2;
|
|
a.a(a3, dVar.a(j3), cArr, i4);
|
|
i4++;
|
|
} else if (a.c(a3)) {
|
|
if (j3 >= j2 - j) {
|
|
throw z.c();
|
|
}
|
|
long j4 = a + 2;
|
|
a += 3;
|
|
a.a(a3, dVar.a(j3), dVar.a(j4), cArr, i4);
|
|
i4++;
|
|
} else {
|
|
if (j3 >= j2 - 2) {
|
|
throw z.c();
|
|
}
|
|
byte a5 = dVar.a(j3);
|
|
long j5 = a + 3;
|
|
byte a6 = dVar.a(a + 2);
|
|
a += 4;
|
|
a.a(a3, a5, a6, dVar.a(j5), cArr, i4);
|
|
i4 += 2;
|
|
j = 1;
|
|
}
|
|
}
|
|
return new String(cArr, 0, i4);
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
public final String a(byte[] bArr, int i, int i2) throws z {
|
|
if ((i | i2 | ((bArr.length - i) - i2)) >= 0) {
|
|
int i3 = i + i2;
|
|
char[] cArr = new char[i2];
|
|
int i4 = 0;
|
|
while (i < i3) {
|
|
byte a = p1.a(bArr, i);
|
|
if (!a.a(a)) {
|
|
break;
|
|
}
|
|
i++;
|
|
cArr[i4] = (char) a;
|
|
i4++;
|
|
}
|
|
int i5 = i4;
|
|
while (i < i3) {
|
|
int i6 = i + 1;
|
|
byte a2 = p1.a(bArr, i);
|
|
if (a.a(a2)) {
|
|
cArr[i5] = (char) a2;
|
|
i5++;
|
|
i = i6;
|
|
while (i < i3) {
|
|
byte a3 = p1.a(bArr, i);
|
|
if (!a.a(a3)) {
|
|
break;
|
|
}
|
|
i++;
|
|
cArr[i5] = (char) a3;
|
|
i5++;
|
|
}
|
|
} else if (a.b(a2)) {
|
|
if (i6 < i3) {
|
|
i += 2;
|
|
a.a(a2, p1.a(bArr, i6), cArr, i5);
|
|
i5++;
|
|
} else {
|
|
throw z.c();
|
|
}
|
|
} else if (a.c(a2)) {
|
|
if (i6 < i3 - 1) {
|
|
int i7 = i + 2;
|
|
i += 3;
|
|
a.a(a2, p1.a(bArr, i6), p1.a(bArr, i7), cArr, i5);
|
|
i5++;
|
|
} else {
|
|
throw z.c();
|
|
}
|
|
} else if (i6 < i3 - 2) {
|
|
byte a4 = p1.a(bArr, i6);
|
|
int i8 = i + 3;
|
|
byte a5 = p1.a(bArr, i + 2);
|
|
i += 4;
|
|
a.a(a2, a4, a5, p1.a(bArr, i8), cArr, i5);
|
|
i5 += 2;
|
|
} else {
|
|
throw z.c();
|
|
}
|
|
}
|
|
return new String(cArr, 0, i5);
|
|
}
|
|
throw new ArrayIndexOutOfBoundsException(String.format("buffer length=%d, index=%d, size=%d", Integer.valueOf(bArr.length), Integer.valueOf(i), Integer.valueOf(i2)));
|
|
}
|
|
|
|
@Override // com.fyber.inneractive.sdk.protobuf.q1.b
|
|
public final int a(CharSequence charSequence, byte[] bArr, int i, int i2) {
|
|
long j;
|
|
String str;
|
|
String str2;
|
|
int i3;
|
|
long j2;
|
|
long j3;
|
|
char charAt;
|
|
long j4 = i;
|
|
long j5 = i2 + j4;
|
|
int length = charSequence.length();
|
|
String str3 = " at index ";
|
|
String str4 = "Failed writing ";
|
|
if (length > i2 || bArr.length - i2 < i) {
|
|
throw new ArrayIndexOutOfBoundsException("Failed writing " + charSequence.charAt(length - 1) + " at index " + (i + i2));
|
|
}
|
|
int i4 = 0;
|
|
while (true) {
|
|
j = 1;
|
|
if (i4 >= length || (charAt = charSequence.charAt(i4)) >= 128) {
|
|
break;
|
|
}
|
|
p1.a(bArr, j4, (byte) charAt);
|
|
i4++;
|
|
j4 = 1 + j4;
|
|
}
|
|
if (i4 == length) {
|
|
return (int) j4;
|
|
}
|
|
while (i4 < length) {
|
|
char charAt2 = charSequence.charAt(i4);
|
|
if (charAt2 >= 128 || j4 >= j5) {
|
|
if (charAt2 >= 2048 || j4 > j5 - 2) {
|
|
str = str3;
|
|
str2 = str4;
|
|
if ((charAt2 >= 55296 && 57343 >= charAt2) || j4 > j5 - 3) {
|
|
if (j4 <= j5 - 4) {
|
|
int i5 = i4 + 1;
|
|
if (i5 != length) {
|
|
char charAt3 = charSequence.charAt(i5);
|
|
if (Character.isSurrogatePair(charAt2, charAt3)) {
|
|
int codePoint = Character.toCodePoint(charAt2, charAt3);
|
|
j2 = 1;
|
|
p1.a(bArr, j4, (byte) ((codePoint >>> 18) | PsExtractor.VIDEO_STREAM_MASK));
|
|
j3 = j5;
|
|
p1.a(bArr, j4 + 1, (byte) (((codePoint >>> 12) & 63) | 128));
|
|
long j6 = j4 + 3;
|
|
p1.a(bArr, j4 + 2, (byte) (((codePoint >>> 6) & 63) | 128));
|
|
j4 += 4;
|
|
p1.a(bArr, j6, (byte) ((codePoint & 63) | 128));
|
|
i4 = i5;
|
|
} else {
|
|
i4 = i5;
|
|
}
|
|
}
|
|
throw new d(i4 - 1, length);
|
|
}
|
|
if (55296 <= charAt2 && charAt2 <= 57343 && ((i3 = i4 + 1) == length || !Character.isSurrogatePair(charAt2, charSequence.charAt(i3)))) {
|
|
throw new d(i4, length);
|
|
}
|
|
throw new ArrayIndexOutOfBoundsException(str2 + charAt2 + str + j4);
|
|
}
|
|
p1.a(bArr, j4, (byte) ((charAt2 >>> '\f') | 480));
|
|
long j7 = j4 + 2;
|
|
p1.a(bArr, j4 + 1, (byte) (((charAt2 >>> 6) & 63) | 128));
|
|
j4 += 3;
|
|
p1.a(bArr, j7, (byte) ((charAt2 & '?') | 128));
|
|
} else {
|
|
str = str3;
|
|
str2 = str4;
|
|
long j8 = j4 + j;
|
|
p1.a(bArr, j4, (byte) ((charAt2 >>> 6) | 960));
|
|
j4 += 2;
|
|
p1.a(bArr, j8, (byte) ((charAt2 & '?') | 128));
|
|
}
|
|
j3 = j5;
|
|
j2 = 1;
|
|
} else {
|
|
p1.a(bArr, j4, (byte) charAt2);
|
|
j3 = j5;
|
|
str2 = str4;
|
|
j2 = j;
|
|
j4 += j;
|
|
str = str3;
|
|
}
|
|
i4++;
|
|
str3 = str;
|
|
str4 = str2;
|
|
j = j2;
|
|
j5 = j3;
|
|
}
|
|
return (int) j4;
|
|
}
|
|
}
|
|
}
|