CrackMe.apk
Download file
package com.google.android.exoplayer2.extractor.ts;
import com.google.android.exoplayer2.extractor.ExtractorOutput;
import com.google.android.exoplayer2.extractor.ts.TsPayloadReader;
import com.google.android.exoplayer2.util.ParsableByteArray;
import com.google.android.exoplayer2.util.TimestampAdjuster;
import com.google.android.exoplayer2.util.Util;
public final class SectionReader implements TsPayloadReader {
private static final int DEFAULT_SECTION_BUFFER_LENGTH = 32;
private static final int MAX_SECTION_LENGTH = 4098;
private static final int SECTION_HEADER_LENGTH = 3;
private int bytesRead;
private final SectionPayloadReader reader;
private final ParsableByteArray sectionData = new ParsableByteArray(32);
private boolean sectionSyntaxIndicator;
private int totalSectionLength;
private boolean waitingForPayloadStart;
public SectionReader(SectionPayloadReader sectionPayloadReader) {
this.reader = sectionPayloadReader;
}
public void init(TimestampAdjuster timestampAdjuster, ExtractorOutput extractorOutput, TsPayloadReader.TrackIdGenerator trackIdGenerator) {
this.reader.init(timestampAdjuster, extractorOutput, trackIdGenerator);
this.waitingForPayloadStart = true;
}
public void seek() {
this.waitingForPayloadStart = true;
}
public void consume(ParsableByteArray parsableByteArray, int i) {
boolean z = (i & 1) != 0;
int position = z ? parsableByteArray.getPosition() + parsableByteArray.readUnsignedByte() : -1;
if (this.waitingForPayloadStart) {
if (z) {
this.waitingForPayloadStart = false;
parsableByteArray.setPosition(position);
this.bytesRead = 0;
} else {
return;
}
}
while (parsableByteArray.bytesLeft() > 0) {
int i2 = this.bytesRead;
if (i2 < 3) {
if (i2 == 0) {
int readUnsignedByte = parsableByteArray.readUnsignedByte();
parsableByteArray.setPosition(parsableByteArray.getPosition() - 1);
if (readUnsignedByte == 255) {
this.waitingForPayloadStart = true;
return;
}
}
int min = Math.min(parsableByteArray.bytesLeft(), 3 - this.bytesRead);
parsableByteArray.readBytes(this.sectionData.getData(), this.bytesRead, min);
int i3 = this.bytesRead + min;
this.bytesRead = i3;
if (i3 == 3) {
this.sectionData.setPosition(0);
this.sectionData.setLimit(3);
this.sectionData.skipBytes(1);
int readUnsignedByte2 = this.sectionData.readUnsignedByte();
int readUnsignedByte3 = this.sectionData.readUnsignedByte();
this.sectionSyntaxIndicator = (readUnsignedByte2 & 128) != 0;
this.totalSectionLength = (((readUnsignedByte2 & 15) << 8) | readUnsignedByte3) + 3;
int capacity = this.sectionData.capacity();
int i4 = this.totalSectionLength;
if (capacity < i4) {
this.sectionData.ensureCapacity(Math.min(4098, Math.max(i4, this.sectionData.capacity() * 2)));
}
}
} else {
int min2 = Math.min(parsableByteArray.bytesLeft(), this.totalSectionLength - this.bytesRead);
parsableByteArray.readBytes(this.sectionData.getData(), this.bytesRead, min2);
int i5 = this.bytesRead + min2;
this.bytesRead = i5;
int i6 = this.totalSectionLength;
if (i5 != i6) {
continue;
} else {
if (!this.sectionSyntaxIndicator) {
this.sectionData.setLimit(i6);
} else if (Util.crc32(this.sectionData.getData(), 0, this.totalSectionLength, -1) != 0) {
this.waitingForPayloadStart = true;
return;
} else {
this.sectionData.setLimit(this.totalSectionLength - 4);
}
this.sectionData.setPosition(0);
this.reader.consume(this.sectionData);
this.bytesRead = 0;
}
}
}
}
}
Download file