Rabbit-R1/original r1/smali/smali_classes3/okhttp3/internal/cache2/Relay$Companion.smali
2024-05-21 17:08:36 -04:00

276 lines
7.4 KiB
Smali

.class public final Lokhttp3/internal/cache2/Relay$Companion;
.super Ljava/lang/Object;
.source "Relay.kt"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lokhttp3/internal/cache2/Relay;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x19
name = "Companion"
.end annotation
.annotation runtime Lkotlin/Metadata;
bv = {
0x1,
0x0,
0x3
}
d1 = {
"\u00006\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0008\u0002\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0002\n\u0002\u0010\u0008\n\u0002\u0008\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0004\u0008\u0086\u0003\u0018\u00002\u00020\u0001B\u0007\u0008\u0002\u00a2\u0006\u0002\u0010\u0002J&\u0010\u000b\u001a\u00020\u000c2\u0006\u0010\r\u001a\u00020\u000e2\u0006\u0010\u000f\u001a\u00020\u00102\u0006\u0010\u0011\u001a\u00020\u00062\u0006\u0010\u0012\u001a\u00020\u0004J\u000e\u0010\u0013\u001a\u00020\u000c2\u0006\u0010\r\u001a\u00020\u000eR\u000e\u0010\u0003\u001a\u00020\u0004X\u0082T\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0005\u001a\u00020\u00068\u0006X\u0087\u0004\u00a2\u0006\u0002\n\u0000R\u0010\u0010\u0007\u001a\u00020\u00068\u0006X\u0087\u0004\u00a2\u0006\u0002\n\u0000R\u000e\u0010\u0008\u001a\u00020\tX\u0082T\u00a2\u0006\u0002\n\u0000R\u000e\u0010\n\u001a\u00020\tX\u0082T\u00a2\u0006\u0002\n\u0000\u00a8\u0006\u0014"
}
d2 = {
"Lokhttp3/internal/cache2/Relay$Companion;",
"",
"()V",
"FILE_HEADER_SIZE",
"",
"PREFIX_CLEAN",
"Lokio/ByteString;",
"PREFIX_DIRTY",
"SOURCE_FILE",
"",
"SOURCE_UPSTREAM",
"edit",
"Lokhttp3/internal/cache2/Relay;",
"file",
"Ljava/io/File;",
"upstream",
"Lokio/Source;",
"metadata",
"bufferMaxSize",
"read",
"okhttp"
}
k = 0x1
mv = {
0x1,
0x4,
0x0
}
.end annotation
# direct methods
.method private constructor <init>()V
.locals 0
.line 292
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
.method public synthetic constructor <init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
.locals 0
.line 292
invoke-direct {p0}, Lokhttp3/internal/cache2/Relay$Companion;-><init>()V
return-void
.end method
# virtual methods
.method public final edit(Ljava/io/File;Lokio/Source;Lokio/ByteString;J)Lokhttp3/internal/cache2/Relay;
.locals 9
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string p0, "file"
invoke-static {p1, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string p0, "upstream"
invoke-static {p2, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
const-string p0, "metadata"
invoke-static {p3, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 317
new-instance p0, Ljava/io/RandomAccessFile;
const-string v0, "rw"
invoke-direct {p0, p1, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
.line 318
new-instance p1, Lokhttp3/internal/cache2/Relay;
const-wide/16 v3, 0x0
const/4 v8, 0x0
move-object v0, p1
move-object v1, p0
move-object v2, p2
move-object v5, p3
move-wide v6, p4
invoke-direct/range {v0 .. v8}, Lokhttp3/internal/cache2/Relay;-><init>(Ljava/io/RandomAccessFile;Lokio/Source;JLokio/ByteString;JLkotlin/jvm/internal/DefaultConstructorMarker;)V
const-wide/16 p2, 0x0
.line 321
invoke-virtual {p0, p2, p3}, Ljava/io/RandomAccessFile;->setLength(J)V
.line 322
sget-object v2, Lokhttp3/internal/cache2/Relay;->PREFIX_DIRTY:Lokio/ByteString;
const-wide/16 v3, -0x1
const-wide/16 v5, -0x1
move-object v1, p1
invoke-static/range {v1 .. v6}, Lokhttp3/internal/cache2/Relay;->access$writeHeader(Lokhttp3/internal/cache2/Relay;Lokio/ByteString;JJ)V
return-object p1
.end method
.method public final read(Ljava/io/File;)Lokhttp3/internal/cache2/Relay;
.locals 10
.annotation system Ldalvik/annotation/Throws;
value = {
Ljava/io/IOException;
}
.end annotation
const-string p0, "file"
invoke-static {p1, p0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
.line 335
new-instance v1, Ljava/io/RandomAccessFile;
const-string p0, "rw"
invoke-direct {v1, p1, p0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
.line 336
new-instance p0, Lokhttp3/internal/cache2/FileOperator;
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
move-result-object p1
const-string v0, "randomAccessFile.channel"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
invoke-direct {p0, p1}, Lokhttp3/internal/cache2/FileOperator;-><init>(Ljava/nio/channels/FileChannel;)V
.line 339
new-instance p1, Lokio/Buffer;
invoke-direct {p1}, Lokio/Buffer;-><init>()V
const-wide/16 v3, 0x0
const-wide/16 v6, 0x20
move-object v2, p0
move-object v5, p1
.line 340
invoke-virtual/range {v2 .. v7}, Lokhttp3/internal/cache2/FileOperator;->read(JLokio/Buffer;J)V
.line 341
sget-object v0, Lokhttp3/internal/cache2/Relay;->PREFIX_CLEAN:Lokio/ByteString;
invoke-virtual {v0}, Lokio/ByteString;->size()I
move-result v0
int-to-long v2, v0
invoke-virtual {p1, v2, v3}, Lokio/Buffer;->readByteString(J)Lokio/ByteString;
move-result-object v0
.line 342
sget-object v2, Lokhttp3/internal/cache2/Relay;->PREFIX_CLEAN:Lokio/ByteString;
invoke-static {v0, v2}, Lkotlin/jvm/internal/Intrinsics;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v0
xor-int/lit8 v0, v0, 0x1
if-nez v0, :cond_0
.line 343
invoke-virtual {p1}, Lokio/Buffer;->readLong()J
move-result-wide v8
.line 344
invoke-virtual {p1}, Lokio/Buffer;->readLong()J
move-result-wide v6
.line 347
new-instance p1, Lokio/Buffer;
invoke-direct {p1}, Lokio/Buffer;-><init>()V
const-wide/16 v2, 0x20
add-long v3, v8, v2
move-object v2, p0
move-object v5, p1
.line 348
invoke-virtual/range {v2 .. v7}, Lokhttp3/internal/cache2/FileOperator;->read(JLokio/Buffer;J)V
.line 349
invoke-virtual {p1}, Lokio/Buffer;->readByteString()Lokio/ByteString;
move-result-object v5
.line 352
new-instance p0, Lokhttp3/internal/cache2/Relay;
const/4 v2, 0x0
const-wide/16 v6, 0x0
const/4 p1, 0x0
move-object v0, p0
move-wide v3, v8
move-object v8, p1
invoke-direct/range {v0 .. v8}, Lokhttp3/internal/cache2/Relay;-><init>(Ljava/io/RandomAccessFile;Lokio/Source;JLokio/ByteString;JLkotlin/jvm/internal/DefaultConstructorMarker;)V
return-object p0
.line 342
:cond_0
new-instance p0, Ljava/io/IOException;
const-string p1, "unreadable cache file"
invoke-direct {p0, p1}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
check-cast p0, Ljava/lang/Throwable;
throw p0
.end method