295 lines
7.7 KiB
Smali
295 lines
7.7 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 = {}
|
|
d1 = {
|
|
"\u00000\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\t\n\u0000\n\u0002\u0018\u0002\n\u0002\u0008\u0007\n\u0002\u0010\u0008\n\u0002\u0008\u0006\u0008\u0086\u0003\u0018\u00002\u00020\u0001B\t\u0008\u0002\u00a2\u0006\u0004\u0008\u0016\u0010\u0017J&\u0010\u000b\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u00022\u0006\u0010\u0005\u001a\u00020\u00042\u0006\u0010\u0007\u001a\u00020\u00062\u0006\u0010\t\u001a\u00020\u0008J\u000e\u0010\u000c\u001a\u00020\n2\u0006\u0010\u0003\u001a\u00020\u0002R\u0014\u0010\r\u001a\u00020\u00088\u0002X\u0082T\u00a2\u0006\u0006\n\u0004\u0008\r\u0010\u000eR\u0014\u0010\u000f\u001a\u00020\u00068\u0006X\u0087\u0004\u00a2\u0006\u0006\n\u0004\u0008\u000f\u0010\u0010R\u0014\u0010\u0011\u001a\u00020\u00068\u0006X\u0087\u0004\u00a2\u0006\u0006\n\u0004\u0008\u0011\u0010\u0010R\u0014\u0010\u0013\u001a\u00020\u00128\u0002X\u0082T\u00a2\u0006\u0006\n\u0004\u0008\u0013\u0010\u0014R\u0014\u0010\u0015\u001a\u00020\u00128\u0002X\u0082T\u00a2\u0006\u0006\n\u0004\u0008\u0015\u0010\u0014\u00a8\u0006\u0018"
|
|
}
|
|
d2 = {
|
|
"Lokhttp3/internal/cache2/Relay$Companion;",
|
|
"",
|
|
"Ljava/io/File;",
|
|
"file",
|
|
"Lzj/m0;",
|
|
"upstream",
|
|
"Lokio/ByteString;",
|
|
"metadata",
|
|
"",
|
|
"bufferMaxSize",
|
|
"Lokhttp3/internal/cache2/Relay;",
|
|
"edit",
|
|
"read",
|
|
"FILE_HEADER_SIZE",
|
|
"J",
|
|
"PREFIX_CLEAN",
|
|
"Lokio/ByteString;",
|
|
"PREFIX_DIRTY",
|
|
"",
|
|
"SOURCE_FILE",
|
|
"I",
|
|
"SOURCE_UPSTREAM",
|
|
"<init>",
|
|
"()V",
|
|
"okhttp"
|
|
}
|
|
k = 0x1
|
|
mv = {
|
|
0x1,
|
|
0x4,
|
|
0x0
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method private constructor <init>()V
|
|
.locals 0
|
|
|
|
.line 1
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lkotlin/jvm/internal/u;)V
|
|
.locals 0
|
|
|
|
.line 2
|
|
invoke-direct {p0}, Lokhttp3/internal/cache2/Relay$Companion;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final edit(Ljava/io/File;Lzj/m0;Lokio/ByteString;J)Lokhttp3/internal/cache2/Relay;
|
|
.locals 10
|
|
.param p1 # Ljava/io/File;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.param p2 # Lzj/m0;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.param p3 # Lokio/ByteString;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
const-string v0, "file"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "upstream"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "metadata"
|
|
|
|
invoke-static {p3, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 1
|
|
new-instance v0, Ljava/io/RandomAccessFile;
|
|
|
|
const-string v1, "rw"
|
|
|
|
invoke-direct {v0, p1, v1}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
.line 2
|
|
new-instance p1, Lokhttp3/internal/cache2/Relay;
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
const/4 v9, 0x0
|
|
|
|
move-object v1, p1
|
|
|
|
move-object v2, v0
|
|
|
|
move-object v3, p2
|
|
|
|
move-object v6, p3
|
|
|
|
move-wide v7, p4
|
|
|
|
invoke-direct/range {v1 .. v9}, Lokhttp3/internal/cache2/Relay;-><init>(Ljava/io/RandomAccessFile;Lzj/m0;JLokio/ByteString;JLkotlin/jvm/internal/u;)V
|
|
|
|
const-wide/16 p2, 0x0
|
|
|
|
.line 3
|
|
invoke-virtual {v0, p2, p3}, Ljava/io/RandomAccessFile;->setLength(J)V
|
|
|
|
.line 4
|
|
sget-object v3, Lokhttp3/internal/cache2/Relay;->PREFIX_DIRTY:Lokio/ByteString;
|
|
|
|
const-wide/16 v4, -0x1
|
|
|
|
const-wide/16 v6, -0x1
|
|
|
|
move-object v2, p1
|
|
|
|
invoke-static/range {v2 .. v7}, 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 11
|
|
.param p1 # Ljava/io/File;
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
.end param
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.annotation build Lorg/jetbrains/annotations/NotNull;
|
|
.end annotation
|
|
|
|
const-string v0, "file"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/f0;->p(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
.line 1
|
|
new-instance v2, Ljava/io/RandomAccessFile;
|
|
|
|
const-string v0, "rw"
|
|
|
|
invoke-direct {v2, p1, v0}, Ljava/io/RandomAccessFile;-><init>(Ljava/io/File;Ljava/lang/String;)V
|
|
|
|
.line 2
|
|
new-instance p1, Lokhttp3/internal/cache2/FileOperator;
|
|
|
|
invoke-virtual {v2}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "randomAccessFile.channel"
|
|
|
|
invoke-static {v0, v1}, Lkotlin/jvm/internal/f0;->o(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-direct {p1, v0}, Lokhttp3/internal/cache2/FileOperator;-><init>(Ljava/nio/channels/FileChannel;)V
|
|
|
|
.line 3
|
|
new-instance v0, Lzj/m;
|
|
|
|
invoke-direct {v0}, Lzj/m;-><init>()V
|
|
|
|
const-wide/16 v4, 0x0
|
|
|
|
const-wide/16 v7, 0x20
|
|
|
|
move-object v3, p1
|
|
|
|
move-object v6, v0
|
|
|
|
.line 4
|
|
invoke-virtual/range {v3 .. v8}, Lokhttp3/internal/cache2/FileOperator;->read(JLzj/m;J)V
|
|
|
|
.line 5
|
|
sget-object v1, Lokhttp3/internal/cache2/Relay;->PREFIX_CLEAN:Lokio/ByteString;
|
|
|
|
invoke-virtual {v1}, Lokio/ByteString;->size()I
|
|
|
|
move-result v3
|
|
|
|
int-to-long v3, v3
|
|
|
|
invoke-virtual {v0, v3, v4}, Lzj/m;->v0(J)Lokio/ByteString;
|
|
|
|
move-result-object v3
|
|
|
|
.line 6
|
|
invoke-static {v3, v1}, Lkotlin/jvm/internal/f0;->g(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v1
|
|
|
|
xor-int/lit8 v1, v1, 0x1
|
|
|
|
if-nez v1, :cond_0
|
|
|
|
.line 7
|
|
invoke-virtual {v0}, Lzj/m;->readLong()J
|
|
|
|
move-result-wide v9
|
|
|
|
.line 8
|
|
invoke-virtual {v0}, Lzj/m;->readLong()J
|
|
|
|
move-result-wide v7
|
|
|
|
.line 9
|
|
new-instance v0, Lzj/m;
|
|
|
|
invoke-direct {v0}, Lzj/m;-><init>()V
|
|
|
|
const-wide/16 v3, 0x20
|
|
|
|
add-long v4, v9, v3
|
|
|
|
move-object v3, p1
|
|
|
|
move-object v6, v0
|
|
|
|
.line 10
|
|
invoke-virtual/range {v3 .. v8}, Lokhttp3/internal/cache2/FileOperator;->read(JLzj/m;J)V
|
|
|
|
.line 11
|
|
invoke-virtual {v0}, Lzj/m;->d1()Lokio/ByteString;
|
|
|
|
move-result-object v6
|
|
|
|
.line 12
|
|
new-instance p1, Lokhttp3/internal/cache2/Relay;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const-wide/16 v7, 0x0
|
|
|
|
const/4 v0, 0x0
|
|
|
|
move-object v1, p1
|
|
|
|
move-wide v4, v9
|
|
|
|
move-object v9, v0
|
|
|
|
invoke-direct/range {v1 .. v9}, Lokhttp3/internal/cache2/Relay;-><init>(Ljava/io/RandomAccessFile;Lzj/m0;JLokio/ByteString;JLkotlin/jvm/internal/u;)V
|
|
|
|
return-object p1
|
|
|
|
.line 13
|
|
:cond_0
|
|
new-instance p1, Ljava/io/IOException;
|
|
|
|
const-string v0, "unreadable cache file"
|
|
|
|
invoke-direct {p1, v0}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|