CrackMe.apk
Download file
package com.google.android.exoplayer2.util;
import androidx.core.view.MotionEventCompat;
import com.google.common.base.Charsets;
import java.nio.charset.Charset;
public final class ParsableBitArray {
private int bitOffset;
private int byteLimit;
private int byteOffset;
public byte[] data;
public ParsableBitArray() {
this.data = Util.EMPTY_BYTE_ARRAY;
}
public ParsableBitArray(byte[] bArr) {
this(bArr, bArr.length);
}
public ParsableBitArray(byte[] bArr, int i) {
this.data = bArr;
this.byteLimit = i;
}
public void reset(byte[] bArr) {
reset(bArr, bArr.length);
}
public void reset(ParsableByteArray parsableByteArray) {
reset(parsableByteArray.getData(), parsableByteArray.limit());
setPosition(parsableByteArray.getPosition() * 8);
}
public void reset(byte[] bArr, int i) {
this.data = bArr;
this.byteOffset = 0;
this.bitOffset = 0;
this.byteLimit = i;
}
public int bitsLeft() {
return ((this.byteLimit - this.byteOffset) * 8) - this.bitOffset;
}
public int getPosition() {
return (this.byteOffset * 8) + this.bitOffset;
}
public int getBytePosition() {
Assertions.checkState(this.bitOffset == 0);
return this.byteOffset;
}
public void setPosition(int i) {
int i2 = i / 8;
this.byteOffset = i2;
this.bitOffset = i - (i2 * 8);
assertValidOffset();
}
public void skipBit() {
int i = this.bitOffset + 1;
this.bitOffset = i;
if (i == 8) {
this.bitOffset = 0;
this.byteOffset++;
}
assertValidOffset();
}
public void skipBits(int i) {
int i2 = i / 8;
int i3 = this.byteOffset + i2;
this.byteOffset = i3;
int i4 = this.bitOffset + (i - (i2 * 8));
this.bitOffset = i4;
if (i4 > 7) {
this.byteOffset = i3 + 1;
this.bitOffset = i4 - 8;
}
assertValidOffset();
}
public boolean readBit() {
boolean z = (this.data[this.byteOffset] & (128 >> this.bitOffset)) != 0;
skipBit();
return z;
}
public int readBits(int i) {
int i2;
if (i == 0) {
return 0;
}
this.bitOffset += i;
int i3 = 0;
while (true) {
i2 = this.bitOffset;
if (i2 <= 8) {
break;
}
int i4 = i2 - 8;
this.bitOffset = i4;
byte[] bArr = this.data;
int i5 = this.byteOffset;
this.byteOffset = i5 + 1;
i3 |= (bArr[i5] & 255) << i4;
}
byte[] bArr2 = this.data;
int i6 = this.byteOffset;
int i7 = (-1 >>> (32 - i)) & (i3 | ((bArr2[i6] & 255) >> (8 - i2)));
if (i2 == 8) {
this.bitOffset = 0;
this.byteOffset = i6 + 1;
}
assertValidOffset();
return i7;
}
public long readBitsToLong(int i) {
if (i <= 32) {
return Util.toUnsignedLong(readBits(i));
}
return Util.toLong(readBits(i - 32), readBits(32));
}
public void readBits(byte[] bArr, int i, int i2) {
int i3 = (i2 >> 3) + i;
while (i < i3) {
byte[] bArr2 = this.data;
int i4 = this.byteOffset;
int i5 = i4 + 1;
this.byteOffset = i5;
byte b = bArr2[i4];
int i6 = this.bitOffset;
bArr[i] = (byte) (b << i6);
bArr[i] = (byte) (((255 & bArr2[i5]) >> (8 - i6)) | bArr[i]);
i++;
}
int i7 = i2 & 7;
if (i7 != 0) {
bArr[i3] = (byte) (bArr[i3] & (255 >> i7));
int i8 = this.bitOffset;
if (i8 + i7 > 8) {
byte b2 = bArr[i3];
byte[] bArr3 = this.data;
int i9 = this.byteOffset;
this.byteOffset = i9 + 1;
bArr[i3] = (byte) (b2 | ((bArr3[i9] & 255) << i8));
this.bitOffset = i8 - 8;
}
int i10 = this.bitOffset + i7;
this.bitOffset = i10;
byte[] bArr4 = this.data;
int i11 = this.byteOffset;
bArr[i3] = (byte) (((byte) (((255 & bArr4[i11]) >> (8 - i10)) << (8 - i7))) | bArr[i3]);
if (i10 == 8) {
this.bitOffset = 0;
this.byteOffset = i11 + 1;
}
assertValidOffset();
}
}
public void byteAlign() {
if (this.bitOffset != 0) {
this.bitOffset = 0;
this.byteOffset++;
assertValidOffset();
}
}
public void readBytes(byte[] bArr, int i, int i2) {
Assertions.checkState(this.bitOffset == 0);
System.arraycopy(this.data, this.byteOffset, bArr, i, i2);
this.byteOffset += i2;
assertValidOffset();
}
public void skipBytes(int i) {
Assertions.checkState(this.bitOffset == 0);
this.byteOffset += i;
assertValidOffset();
}
public String readBytesAsString(int i) {
return readBytesAsString(i, Charsets.UTF_8);
}
public String readBytesAsString(int i, Charset charset) {
byte[] bArr = new byte[i];
readBytes(bArr, 0, i);
return new String(bArr, charset);
}
public void putInt(int i, int i2) {
if (i2 < 32) {
i &= (1 << i2) - 1;
}
int min = Math.min(8 - this.bitOffset, i2);
int i3 = this.bitOffset;
int i4 = (8 - i3) - min;
byte b = (MotionEventCompat.ACTION_POINTER_INDEX_MASK >> i3) | ((1 << i4) - 1);
byte[] bArr = this.data;
int i5 = this.byteOffset;
bArr[i5] = (byte) (b & bArr[i5]);
int i6 = i2 - min;
bArr[i5] = (byte) (((i >>> i6) << i4) | bArr[i5]);
int i7 = i5 + 1;
while (i6 > 8) {
this.data[i7] = (byte) (i >>> (i6 - 8));
i6 -= 8;
i7++;
}
int i8 = 8 - i6;
byte[] bArr2 = this.data;
bArr2[i7] = (byte) (bArr2[i7] & ((1 << i8) - 1));
bArr2[i7] = (byte) (((i & ((1 << i6) - 1)) << i8) | bArr2[i7]);
skipBits(i2);
assertValidOffset();
}
/* JADX WARNING: Code restructure failed: missing block: B:2:0x0004, code lost:
r1 = r2.byteLimit;
*/
/* Code decompiled incorrectly, please refer to instructions dump. */
private void assertValidOffset() {
/*
r2 = this;
int r0 = r2.byteOffset
if (r0 < 0) goto L_0x0010
int r1 = r2.byteLimit
if (r0 < r1) goto L_0x000e
if (r0 != r1) goto L_0x0010
int r0 = r2.bitOffset
if (r0 != 0) goto L_0x0010
L_0x000e:
r0 = 1
goto L_0x0011
L_0x0010:
r0 = 0
L_0x0011:
com.google.android.exoplayer2.util.Assertions.checkState(r0)
return
*/
throw new UnsupportedOperationException("Method not decompiled: com.google.android.exoplayer2.util.ParsableBitArray.assertValidOffset():void");
}
}
Download file