263 lines
5.8 KiB
Smali
263 lines
5.8 KiB
Smali
.class final Lokhttp3/internal/cache2/Relay;
|
|
.super Ljava/lang/Object;
|
|
.source "Relay.java"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokhttp3/internal/cache2/Relay$RelaySource;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final a:Lokio/ByteString;
|
|
|
|
.field static final b:Lokio/ByteString;
|
|
|
|
|
|
# instance fields
|
|
.field c:Ljava/io/RandomAccessFile;
|
|
|
|
.field d:Ljava/lang/Thread;
|
|
|
|
.field e:Lokio/Source;
|
|
|
|
.field final f:Lokio/Buffer;
|
|
|
|
.field g:J
|
|
|
|
.field h:Z
|
|
|
|
.field final i:Lokio/Buffer;
|
|
|
|
.field final j:J
|
|
|
|
.field k:I
|
|
|
|
.field private final l:Lokio/ByteString;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
const-string v0, "OkHttp cache v1\n"
|
|
|
|
.line 45
|
|
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokhttp3/internal/cache2/Relay;->a:Lokio/ByteString;
|
|
|
|
const-string v0, "OkHttp DIRTY :(\n"
|
|
|
|
.line 46
|
|
invoke-static {v0}, Lokio/ByteString;->encodeUtf8(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokhttp3/internal/cache2/Relay;->b:Lokio/ByteString;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private a(Lokio/ByteString;JJ)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 166
|
|
new-instance v3, Lokio/Buffer;
|
|
|
|
invoke-direct {v3}, Lokio/Buffer;-><init>()V
|
|
|
|
.line 167
|
|
invoke-virtual {v3, p1}, Lokio/Buffer;->write(Lokio/ByteString;)Lokio/Buffer;
|
|
|
|
.line 168
|
|
invoke-virtual {v3, p2, p3}, Lokio/Buffer;->writeLong(J)Lokio/Buffer;
|
|
|
|
.line 169
|
|
invoke-virtual {v3, p4, p5}, Lokio/Buffer;->writeLong(J)Lokio/Buffer;
|
|
|
|
.line 170
|
|
invoke-virtual {v3}, Lokio/Buffer;->size()J
|
|
|
|
move-result-wide p1
|
|
|
|
const-wide/16 p3, 0x20
|
|
|
|
cmp-long p5, p1, p3
|
|
|
|
if-nez p5, :cond_0
|
|
|
|
.line 172
|
|
new-instance v0, Lokhttp3/internal/cache2/FileOperator;
|
|
|
|
iget-object p1, p0, Lokhttp3/internal/cache2/Relay;->c:Ljava/io/RandomAccessFile;
|
|
|
|
invoke-virtual {p1}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, p1}, Lokhttp3/internal/cache2/FileOperator;-><init>(Ljava/nio/channels/FileChannel;)V
|
|
|
|
const-wide/16 v1, 0x0
|
|
|
|
const-wide/16 v4, 0x20
|
|
|
|
.line 173
|
|
invoke-virtual/range {v0 .. v5}, Lokhttp3/internal/cache2/FileOperator;->a(JLokio/Buffer;J)V
|
|
|
|
return-void
|
|
|
|
.line 170
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private b(J)V
|
|
.locals 6
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 177
|
|
new-instance v3, Lokio/Buffer;
|
|
|
|
invoke-direct {v3}, Lokio/Buffer;-><init>()V
|
|
|
|
.line 178
|
|
iget-object v0, p0, Lokhttp3/internal/cache2/Relay;->l:Lokio/ByteString;
|
|
|
|
invoke-virtual {v3, v0}, Lokio/Buffer;->write(Lokio/ByteString;)Lokio/Buffer;
|
|
|
|
.line 180
|
|
new-instance v0, Lokhttp3/internal/cache2/FileOperator;
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/cache2/Relay;->c:Ljava/io/RandomAccessFile;
|
|
|
|
invoke-virtual {v1}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Lokhttp3/internal/cache2/FileOperator;-><init>(Ljava/nio/channels/FileChannel;)V
|
|
|
|
const-wide/16 v1, 0x20
|
|
|
|
add-long/2addr v1, p1
|
|
|
|
.line 181
|
|
iget-object p1, p0, Lokhttp3/internal/cache2/Relay;->l:Lokio/ByteString;
|
|
|
|
invoke-virtual {p1}, Lokio/ByteString;->size()I
|
|
|
|
move-result p1
|
|
|
|
int-to-long v4, p1
|
|
|
|
invoke-virtual/range {v0 .. v5}, Lokhttp3/internal/cache2/FileOperator;->a(JLokio/Buffer;J)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method a(J)V
|
|
.locals 8
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
.line 186
|
|
invoke-direct {p0, p1, p2}, Lokhttp3/internal/cache2/Relay;->b(J)V
|
|
|
|
.line 187
|
|
iget-object v0, p0, Lokhttp3/internal/cache2/Relay;->c:Ljava/io/RandomAccessFile;
|
|
|
|
invoke-virtual {v0}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, v1}, Ljava/nio/channels/FileChannel;->force(Z)V
|
|
|
|
.line 190
|
|
sget-object v3, Lokhttp3/internal/cache2/Relay;->a:Lokio/ByteString;
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/cache2/Relay;->l:Lokio/ByteString;
|
|
|
|
invoke-virtual {v0}, Lokio/ByteString;->size()I
|
|
|
|
move-result v0
|
|
|
|
int-to-long v6, v0
|
|
|
|
move-object v2, p0
|
|
|
|
move-wide v4, p1
|
|
|
|
invoke-direct/range {v2 .. v7}, Lokhttp3/internal/cache2/Relay;->a(Lokio/ByteString;JJ)V
|
|
|
|
.line 191
|
|
iget-object p1, p0, Lokhttp3/internal/cache2/Relay;->c:Ljava/io/RandomAccessFile;
|
|
|
|
invoke-virtual {p1}, Ljava/io/RandomAccessFile;->getChannel()Ljava/nio/channels/FileChannel;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, v1}, Ljava/nio/channels/FileChannel;->force(Z)V
|
|
|
|
.line 194
|
|
monitor-enter p0
|
|
|
|
const/4 p1, 0x1
|
|
|
|
.line 195
|
|
:try_start_0
|
|
iput-boolean p1, p0, Lokhttp3/internal/cache2/Relay;->h:Z
|
|
|
|
.line 196
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
.line 198
|
|
iget-object p1, p0, Lokhttp3/internal/cache2/Relay;->e:Lokio/Source;
|
|
|
|
invoke-static {p1}, Lokhttp3/internal/Util;->a(Ljava/io/Closeable;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
.line 199
|
|
iput-object p1, p0, Lokhttp3/internal/cache2/Relay;->e:Lokio/Source;
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
.line 196
|
|
:try_start_1
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|