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,36 @@
package com.mbridge.msdk.thrid.okhttp.internal.cache2;
import com.mbridge.msdk.thrid.okio.Buffer;
import java.io.IOException;
import java.nio.channels.FileChannel;
/* loaded from: classes4.dex */
final class FileOperator {
private final FileChannel fileChannel;
public FileOperator(FileChannel fileChannel) {
this.fileChannel = fileChannel;
}
public void write(long j, Buffer buffer, long j2) throws IOException {
if (j2 < 0 || j2 > buffer.size()) {
throw new IndexOutOfBoundsException();
}
while (j2 > 0) {
long transferFrom = this.fileChannel.transferFrom(buffer, j, j2);
j += transferFrom;
j2 -= transferFrom;
}
}
public void read(long j, Buffer buffer, long j2) throws IOException {
if (j2 < 0) {
throw new IndexOutOfBoundsException();
}
while (j2 > 0) {
long transferTo = this.fileChannel.transferTo(j, j2, buffer);
j += transferTo;
j2 -= transferTo;
}
}
}

View File

@@ -0,0 +1,238 @@
package com.mbridge.msdk.thrid.okhttp.internal.cache2;
import com.mbridge.msdk.thrid.okhttp.internal.Util;
import com.mbridge.msdk.thrid.okio.Buffer;
import com.mbridge.msdk.thrid.okio.ByteString;
import com.mbridge.msdk.thrid.okio.Source;
import com.mbridge.msdk.thrid.okio.Timeout;
import csdk.gluads.Consts;
import java.io.File;
import java.io.IOException;
import java.io.RandomAccessFile;
/* loaded from: classes4.dex */
final class Relay {
private static final long FILE_HEADER_SIZE = 32;
static final ByteString PREFIX_CLEAN = ByteString.encodeUtf8("OkHttp cache v1\n");
static final ByteString PREFIX_DIRTY = ByteString.encodeUtf8("OkHttp DIRTY :(\n");
private static final int SOURCE_FILE = 2;
private static final int SOURCE_UPSTREAM = 1;
final long bufferMaxSize;
boolean complete;
RandomAccessFile file;
private final ByteString metadata;
int sourceCount;
Source upstream;
long upstreamPos;
Thread upstreamReader;
final Buffer upstreamBuffer = new Buffer();
final Buffer buffer = new Buffer();
public boolean isClosed() {
return this.file == null;
}
public ByteString metadata() {
return this.metadata;
}
private Relay(RandomAccessFile randomAccessFile, Source source, long j, ByteString byteString, long j2) {
this.file = randomAccessFile;
this.upstream = source;
this.complete = source == null;
this.upstreamPos = j;
this.metadata = byteString;
this.bufferMaxSize = j2;
}
public static Relay edit(File file, Source source, ByteString byteString, long j) throws IOException {
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
Relay relay = new Relay(randomAccessFile, source, 0L, byteString, j);
randomAccessFile.setLength(0L);
relay.writeHeader(PREFIX_DIRTY, -1L, -1L);
return relay;
}
public static Relay read(File file) throws IOException {
RandomAccessFile randomAccessFile = new RandomAccessFile(file, "rw");
FileOperator fileOperator = new FileOperator(randomAccessFile.getChannel());
Buffer buffer = new Buffer();
fileOperator.read(0L, buffer, 32L);
if (!buffer.readByteString(r2.size()).equals(PREFIX_CLEAN)) {
throw new IOException("unreadable cache file");
}
long readLong = buffer.readLong();
long readLong2 = buffer.readLong();
Buffer buffer2 = new Buffer();
fileOperator.read(readLong + 32, buffer2, readLong2);
return new Relay(randomAccessFile, null, readLong, buffer2.readByteString(), 0L);
}
private void writeHeader(ByteString byteString, long j, long j2) throws IOException {
Buffer buffer = new Buffer();
buffer.write(byteString);
buffer.writeLong(j);
buffer.writeLong(j2);
if (buffer.size() != 32) {
throw new IllegalArgumentException();
}
new FileOperator(this.file.getChannel()).write(0L, buffer, 32L);
}
private void writeMetadata(long j) throws IOException {
Buffer buffer = new Buffer();
buffer.write(this.metadata);
new FileOperator(this.file.getChannel()).write(32 + j, buffer, this.metadata.size());
}
public void commit(long j) throws IOException {
writeMetadata(j);
this.file.getChannel().force(false);
writeHeader(PREFIX_CLEAN, j, this.metadata.size());
this.file.getChannel().force(false);
synchronized (this) {
this.complete = true;
}
Util.closeQuietly(this.upstream);
this.upstream = null;
}
public Source newSource() {
synchronized (this) {
try {
if (this.file == null) {
return null;
}
this.sourceCount++;
return new RelaySource();
} catch (Throwable th) {
throw th;
}
}
}
public class RelaySource implements Source {
private FileOperator fileOperator;
private long sourcePos;
private final Timeout timeout = new Timeout();
@Override // com.mbridge.msdk.thrid.okio.Source
public Timeout timeout() {
return this.timeout;
}
public RelaySource() {
this.fileOperator = new FileOperator(Relay.this.file.getChannel());
}
@Override // com.mbridge.msdk.thrid.okio.Source
public long read(Buffer buffer, long j) throws IOException {
Relay relay;
if (this.fileOperator == null) {
throw new IllegalStateException(Consts.PLACEMENT_STATUS_CLOSED);
}
synchronized (Relay.this) {
while (true) {
try {
long j2 = this.sourcePos;
Relay relay2 = Relay.this;
long j3 = relay2.upstreamPos;
if (j2 != j3) {
long size = j3 - relay2.buffer.size();
long j4 = this.sourcePos;
if (j4 < size) {
long min = Math.min(j, j3 - j4);
this.fileOperator.read(this.sourcePos + 32, buffer, min);
this.sourcePos += min;
return min;
}
long min2 = Math.min(j, j3 - j4);
Relay.this.buffer.copyTo(buffer, this.sourcePos - size, min2);
this.sourcePos += min2;
return min2;
}
if (relay2.complete) {
return -1L;
}
if (relay2.upstreamReader == null) {
relay2.upstreamReader = Thread.currentThread();
try {
Relay relay3 = Relay.this;
long read = relay3.upstream.read(relay3.upstreamBuffer, relay3.bufferMaxSize);
if (read == -1) {
Relay.this.commit(j3);
synchronized (Relay.this) {
Relay relay4 = Relay.this;
relay4.upstreamReader = null;
relay4.notifyAll();
}
return -1L;
}
long min3 = Math.min(read, j);
Relay.this.upstreamBuffer.copyTo(buffer, 0L, min3);
this.sourcePos += min3;
this.fileOperator.write(j3 + 32, Relay.this.upstreamBuffer.m3722clone(), read);
synchronized (Relay.this) {
try {
Relay relay5 = Relay.this;
relay5.buffer.write(relay5.upstreamBuffer, read);
long size2 = Relay.this.buffer.size();
Relay relay6 = Relay.this;
if (size2 > relay6.bufferMaxSize) {
Buffer buffer2 = relay6.buffer;
buffer2.skip(buffer2.size() - Relay.this.bufferMaxSize);
}
relay = Relay.this;
relay.upstreamPos += read;
} finally {
}
}
synchronized (relay) {
Relay relay7 = Relay.this;
relay7.upstreamReader = null;
relay7.notifyAll();
}
return min3;
} catch (Throwable th) {
synchronized (Relay.this) {
Relay relay8 = Relay.this;
relay8.upstreamReader = null;
relay8.notifyAll();
throw th;
}
}
}
this.timeout.waitUntilNotified(relay2);
} finally {
}
}
}
}
@Override // com.mbridge.msdk.thrid.okio.Source, java.io.Closeable, java.lang.AutoCloseable
public void close() throws IOException {
if (this.fileOperator == null) {
return;
}
RandomAccessFile randomAccessFile = null;
this.fileOperator = null;
synchronized (Relay.this) {
try {
Relay relay = Relay.this;
int i = relay.sourceCount - 1;
relay.sourceCount = i;
if (i == 0) {
RandomAccessFile randomAccessFile2 = relay.file;
relay.file = null;
randomAccessFile = randomAccessFile2;
}
} catch (Throwable th) {
throw th;
}
}
if (randomAccessFile != null) {
Util.closeQuietly(randomAccessFile);
}
}
}
}