Add decompiled APK source code (JADX)

- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
2026-02-18 14:52:23 -08:00
parent cc210a65ea
commit f9d20bb3fc
26991 changed files with 2541449 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
package com.mbridge.msdk.playercommon.exoplayer2.upstream.crypto;
import com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink;
import com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSpec;
import java.io.IOException;
/* loaded from: classes4.dex */
public final class AesCipherDataSink implements DataSink {
private AesFlushingCipher cipher;
private final byte[] scratch;
private final byte[] secretKey;
private final DataSink wrappedDataSink;
public AesCipherDataSink(byte[] bArr, DataSink dataSink) {
this(bArr, dataSink, null);
}
public AesCipherDataSink(byte[] bArr, DataSink dataSink, byte[] bArr2) {
this.wrappedDataSink = dataSink;
this.secretKey = bArr;
this.scratch = bArr2;
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink
public final void open(DataSpec dataSpec) throws IOException {
this.wrappedDataSink.open(dataSpec);
this.cipher = new AesFlushingCipher(1, this.secretKey, CryptoUtil.getFNV64Hash(dataSpec.key), dataSpec.absoluteStreamPosition);
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink
public final void write(byte[] bArr, int i, int i2) throws IOException {
if (this.scratch == null) {
this.cipher.updateInPlace(bArr, i, i2);
this.wrappedDataSink.write(bArr, i, i2);
return;
}
int i3 = 0;
while (i3 < i2) {
int min = Math.min(i2 - i3, this.scratch.length);
this.cipher.update(bArr, i + i3, min, this.scratch, 0);
this.wrappedDataSink.write(this.scratch, 0, min);
i3 += min;
}
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSink
public final void close() throws IOException {
this.cipher = null;
this.wrappedDataSink.close();
}
}

View File

@@ -0,0 +1,49 @@
package com.mbridge.msdk.playercommon.exoplayer2.upstream.crypto;
import android.net.Uri;
import com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSource;
import com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSpec;
import java.io.IOException;
/* loaded from: classes4.dex */
public final class AesCipherDataSource implements DataSource {
private AesFlushingCipher cipher;
private final byte[] secretKey;
private final DataSource upstream;
public AesCipherDataSource(byte[] bArr, DataSource dataSource) {
this.upstream = dataSource;
this.secretKey = bArr;
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSource
public final long open(DataSpec dataSpec) throws IOException {
long open = this.upstream.open(dataSpec);
this.cipher = new AesFlushingCipher(2, this.secretKey, CryptoUtil.getFNV64Hash(dataSpec.key), dataSpec.absoluteStreamPosition);
return open;
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSource
public final int read(byte[] bArr, int i, int i2) throws IOException {
if (i2 == 0) {
return 0;
}
int read = this.upstream.read(bArr, i, i2);
if (read == -1) {
return -1;
}
this.cipher.updateInPlace(bArr, i, read);
return read;
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSource
public final void close() throws IOException {
this.cipher = null;
this.upstream.close();
}
@Override // com.mbridge.msdk.playercommon.exoplayer2.upstream.DataSource
public final Uri getUri() {
return this.upstream.getUri();
}
}

View File

@@ -0,0 +1,89 @@
package com.mbridge.msdk.playercommon.exoplayer2.upstream.crypto;
import com.mbridge.msdk.playercommon.exoplayer2.util.Assertions;
import com.mbridge.msdk.playercommon.exoplayer2.util.Util;
import java.nio.ByteBuffer;
import java.security.InvalidAlgorithmParameterException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import javax.crypto.Cipher;
import javax.crypto.NoSuchPaddingException;
import javax.crypto.ShortBufferException;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/* loaded from: classes4.dex */
public final class AesFlushingCipher {
private final int blockSize;
private final Cipher cipher;
private final byte[] flushedBlock;
private int pendingXorBytes;
private final byte[] zerosBlock;
public AesFlushingCipher(int i, byte[] bArr, long j, long j2) {
try {
Cipher cipher = Cipher.getInstance("AES/CTR/NoPadding");
this.cipher = cipher;
int blockSize = cipher.getBlockSize();
this.blockSize = blockSize;
this.zerosBlock = new byte[blockSize];
this.flushedBlock = new byte[blockSize];
long j3 = j2 / blockSize;
int i2 = (int) (j2 % blockSize);
cipher.init(i, new SecretKeySpec(bArr, Util.splitAtFirst(cipher.getAlgorithm(), "/")[0]), new IvParameterSpec(getInitializationVector(j, j3)));
if (i2 != 0) {
updateInPlace(new byte[i2], 0, i2);
}
} catch (InvalidAlgorithmParameterException | InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException e) {
throw new RuntimeException(e);
}
}
public final void updateInPlace(byte[] bArr, int i, int i2) {
update(bArr, i, i2, bArr, i);
}
public final void update(byte[] bArr, int i, int i2, byte[] bArr2, int i3) {
int i4 = i;
do {
int i5 = this.pendingXorBytes;
if (i5 > 0) {
bArr2[i3] = (byte) (bArr[i4] ^ this.flushedBlock[this.blockSize - i5]);
i3++;
i4++;
this.pendingXorBytes = i5 - 1;
i2--;
} else {
int nonFlushingUpdate = nonFlushingUpdate(bArr, i4, i2, bArr2, i3);
if (i2 == nonFlushingUpdate) {
return;
}
int i6 = i2 - nonFlushingUpdate;
int i7 = 0;
Assertions.checkState(i6 < this.blockSize);
int i8 = i3 + nonFlushingUpdate;
int i9 = this.blockSize - i6;
this.pendingXorBytes = i9;
Assertions.checkState(nonFlushingUpdate(this.zerosBlock, 0, i9, this.flushedBlock, 0) == this.blockSize);
while (i7 < i6) {
bArr2[i8] = this.flushedBlock[i7];
i7++;
i8++;
}
return;
}
} while (i2 != 0);
}
private int nonFlushingUpdate(byte[] bArr, int i, int i2, byte[] bArr2, int i3) {
try {
return this.cipher.update(bArr, i, i2, bArr2, i3);
} catch (ShortBufferException e) {
throw new RuntimeException(e);
}
}
private byte[] getInitializationVector(long j, long j2) {
return ByteBuffer.allocate(16).putLong(j).putLong(j2).array();
}
}

View File

@@ -0,0 +1,19 @@
package com.mbridge.msdk.playercommon.exoplayer2.upstream.crypto;
/* loaded from: classes4.dex */
final class CryptoUtil {
private CryptoUtil() {
}
public static long getFNV64Hash(String str) {
long j = 0;
if (str == null) {
return 0L;
}
for (int i = 0; i < str.length(); i++) {
long charAt = j ^ str.charAt(i);
j = charAt + (charAt << 1) + (charAt << 4) + (charAt << 5) + (charAt << 7) + (charAt << 8) + (charAt << 40);
}
return j;
}
}