1283 lines
29 KiB
Smali
1283 lines
29 KiB
Smali
.class public final Lokhttp3/internal/i/a;
|
|
.super Ljava/lang/Object;
|
|
|
|
# interfaces
|
|
.implements Lokhttp3/WebSocket;
|
|
.implements Lokhttp3/internal/i/c$a;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lokhttp3/internal/i/a$a;,
|
|
Lokhttp3/internal/i/a$e;,
|
|
Lokhttp3/internal/i/a$b;,
|
|
Lokhttp3/internal/i/a$c;,
|
|
Lokhttp3/internal/i/a$d;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field static final synthetic $assertionsDisabled:Z
|
|
|
|
.field public static final cfD:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Lokhttp3/u;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field public final cae:Lokhttp3/w;
|
|
|
|
.field public cca:Lokhttp3/e;
|
|
|
|
.field cdP:Z
|
|
|
|
.field final cfE:Lokhttp3/WebSocketListener;
|
|
|
|
.field final cfF:J
|
|
|
|
.field private final cfG:Ljava/lang/Runnable;
|
|
|
|
.field private cfH:Lokhttp3/internal/i/c;
|
|
|
|
.field cfI:Lokhttp3/internal/i/d;
|
|
|
|
.field private cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
.field private final cfK:Ljava/util/ArrayDeque;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayDeque<",
|
|
"Lokio/ByteString;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private final cfL:Ljava/util/ArrayDeque;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/ArrayDeque<",
|
|
"Ljava/lang/Object;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private cfM:J
|
|
|
|
.field private cfN:Z
|
|
|
|
.field private cfO:Ljava/util/concurrent/ScheduledFuture;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/concurrent/ScheduledFuture<",
|
|
"*>;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field private cfP:I
|
|
|
|
.field private cfQ:Ljava/lang/String;
|
|
|
|
.field cfR:Z
|
|
|
|
.field cfS:I
|
|
|
|
.field private cfT:I
|
|
|
|
.field private cfU:I
|
|
|
|
.field public final key:Ljava/lang/String;
|
|
|
|
.field private nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
.field private final random:Ljava/util/Random;
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 1
|
|
|
|
sget-object v0, Lokhttp3/u;->bZV:Lokhttp3/u;
|
|
|
|
invoke-static {v0}, Ljava/util/Collections;->singletonList(Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object v0
|
|
|
|
sput-object v0, Lokhttp3/internal/i/a;->cfD:Ljava/util/List;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>(Lokhttp3/w;Lokhttp3/WebSocketListener;Ljava/util/Random;J)V
|
|
.locals 2
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
new-instance v0, Ljava/util/ArrayDeque;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/i/a;->cfK:Ljava/util/ArrayDeque;
|
|
|
|
new-instance v0, Ljava/util/ArrayDeque;
|
|
|
|
invoke-direct {v0}, Ljava/util/ArrayDeque;-><init>()V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
const/4 v0, -0x1
|
|
|
|
iput v0, p0, Lokhttp3/internal/i/a;->cfP:I
|
|
|
|
const-string v0, "GET"
|
|
|
|
iget-object v1, p1, Lokhttp3/w;->method:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iput-object p1, p0, Lokhttp3/internal/i/a;->cae:Lokhttp3/w;
|
|
|
|
iput-object p2, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
iput-object p3, p0, Lokhttp3/internal/i/a;->random:Ljava/util/Random;
|
|
|
|
iput-wide p4, p0, Lokhttp3/internal/i/a;->cfF:J
|
|
|
|
const/16 p1, 0x10
|
|
|
|
new-array p1, p1, [B
|
|
|
|
invoke-virtual {p3, p1}, Ljava/util/Random;->nextBytes([B)V
|
|
|
|
invoke-static {p1}, Lokio/ByteString;->O([B)Lokio/ByteString;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lokio/ByteString;->Jl()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lokhttp3/internal/i/a;->key:Ljava/lang/String;
|
|
|
|
new-instance p1, Lokhttp3/internal/i/a$1;
|
|
|
|
invoke-direct {p1, p0}, Lokhttp3/internal/i/a$1;-><init>(Lokhttp3/internal/i/a;)V
|
|
|
|
iput-object p1, p0, Lokhttp3/internal/i/a;->cfG:Ljava/lang/Runnable;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
new-instance p2, Ljava/lang/IllegalArgumentException;
|
|
|
|
new-instance p3, Ljava/lang/StringBuilder;
|
|
|
|
const-string p4, "Request must be GET: "
|
|
|
|
invoke-direct {p3, p4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object p1, p1, Lokhttp3/w;->method:Ljava/lang/String;
|
|
|
|
invoke-virtual {p3, p1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p2, p1}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p2
|
|
.end method
|
|
|
|
.method private IP()V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfG:Ljava/lang/Runnable;
|
|
|
|
invoke-interface {v0, v1}, Ljava/util/concurrent/ScheduledExecutorService;->execute(Ljava/lang/Runnable;)V
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private declared-synchronized f(Lokio/ByteString;)Z
|
|
.locals 6
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfR:Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-nez v0, :cond_2
|
|
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfN:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-wide v2, p0, Lokhttp3/internal/i/a;->cfM:J
|
|
|
|
invoke-virtual {p1}, Lokio/ByteString;->size()I
|
|
|
|
move-result v0
|
|
|
|
int-to-long v4, v0
|
|
|
|
add-long/2addr v2, v4
|
|
|
|
const-wide/32 v4, 0x1000000
|
|
|
|
cmp-long v0, v2, v4
|
|
|
|
if-lez v0, :cond_1
|
|
|
|
const/16 p1, 0x3e9
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-direct {p0, p1, v0}, Lokhttp3/internal/i/a;->j(ILjava/lang/String;)Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v1
|
|
|
|
:cond_1
|
|
:try_start_1
|
|
iget-wide v0, p0, Lokhttp3/internal/i/a;->cfM:J
|
|
|
|
invoke-virtual {p1}, Lokio/ByteString;->size()I
|
|
|
|
move-result v2
|
|
|
|
int-to-long v2, v2
|
|
|
|
add-long/2addr v0, v2
|
|
|
|
iput-wide v0, p0, Lokhttp3/internal/i/a;->cfM:J
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
new-instance v1, Lokhttp3/internal/i/a$c;
|
|
|
|
const/4 v2, 0x1
|
|
|
|
invoke-direct {v1, v2, p1}, Lokhttp3/internal/i/a$c;-><init>(ILokio/ByteString;)V
|
|
|
|
invoke-virtual {v0, v1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
|
|
|
|
invoke-direct {p0}, Lokhttp3/internal/i/a;->IP()V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v2
|
|
|
|
:cond_2
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return v1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method private declared-synchronized j(ILjava/lang/String;)Z
|
|
.locals 6
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
invoke-static {p1}, Lokhttp3/internal/i/b;->fp(I)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p2, :cond_1
|
|
|
|
invoke-static {p2}, Lokio/ByteString;->eM(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lokio/ByteString;->size()I
|
|
|
|
move-result v1
|
|
|
|
int-to-long v1, v1
|
|
|
|
const-wide/16 v3, 0x7b
|
|
|
|
cmp-long v5, v1, v3
|
|
|
|
if-gtz v5, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
const-string v0, "reason.size() > 123: "
|
|
|
|
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v0, p2}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalArgumentException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
:goto_0
|
|
iget-boolean p2, p0, Lokhttp3/internal/i/a;->cfR:Z
|
|
|
|
if-nez p2, :cond_3
|
|
|
|
iget-boolean p2, p0, Lokhttp3/internal/i/a;->cfN:Z
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
goto :goto_1
|
|
|
|
:cond_2
|
|
const/4 p2, 0x1
|
|
|
|
iput-boolean p2, p0, Lokhttp3/internal/i/a;->cfN:Z
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
new-instance v2, Lokhttp3/internal/i/a$b;
|
|
|
|
const-wide/32 v3, 0xea60
|
|
|
|
invoke-direct {v2, p1, v0, v3, v4}, Lokhttp3/internal/i/a$b;-><init>(ILokio/ByteString;J)V
|
|
|
|
invoke-virtual {v1, v2}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
|
|
|
|
invoke-direct {p0}, Lokhttp3/internal/i/a;->IP()V
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return p2
|
|
|
|
:cond_3
|
|
:goto_1
|
|
const/4 p1, 0x0
|
|
|
|
monitor-exit p0
|
|
|
|
return p1
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final IN()V
|
|
.locals 4
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
:goto_0
|
|
iget v0, p0, Lokhttp3/internal/i/a;->cfP:I
|
|
|
|
const/4 v1, -0x1
|
|
|
|
if-ne v0, v1, :cond_4
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfH:Lokhttp3/internal/i/c;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/internal/i/c;->IR()V
|
|
|
|
iget-boolean v1, v0, Lokhttp3/internal/i/c;->cgf:Z
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
invoke-virtual {v0}, Lokhttp3/internal/i/c;->IS()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget v1, v0, Lokhttp3/internal/i/c;->opcode:I
|
|
|
|
const/4 v2, 0x1
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
const/4 v3, 0x2
|
|
|
|
if-ne v1, v3, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
new-instance v0, Ljava/net/ProtocolException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "Unknown opcode: "
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-static {v1}, Ljava/lang/Integer;->toHexString(I)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-direct {v0, v1}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_2
|
|
:goto_1
|
|
invoke-virtual {v0}, Lokhttp3/internal/i/c;->IU()V
|
|
|
|
if-ne v1, v2, :cond_3
|
|
|
|
iget-object v1, v0, Lokhttp3/internal/i/c;->cgc:Lokhttp3/internal/i/c$a;
|
|
|
|
iget-object v0, v0, Lokhttp3/internal/i/c;->cgh:Lokio/c;
|
|
|
|
invoke-virtual {v0}, Lokio/c;->Jf()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v1, v0}, Lokhttp3/internal/i/c$a;->eJ(Ljava/lang/String;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_3
|
|
iget-object v1, v0, Lokhttp3/internal/i/c;->cgc:Lokhttp3/internal/i/c$a;
|
|
|
|
iget-object v0, v0, Lokhttp3/internal/i/c;->cgh:Lokio/c;
|
|
|
|
invoke-virtual {v0}, Lokio/c;->Ik()Lokio/ByteString;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v1, v0}, Lokhttp3/internal/i/c$a;->d(Lokio/ByteString;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
.method public final declared-synchronized IO()V
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget v0, p0, Lokhttp3/internal/i/a;->cfU:I
|
|
|
|
add-int/lit8 v0, v0, 0x1
|
|
|
|
iput v0, p0, Lokhttp3/internal/i/a;->cfU:I
|
|
|
|
const/4 v0, 0x0
|
|
|
|
iput-boolean v0, p0, Lokhttp3/internal/i/a;->cdP:Z
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method final IQ()Z
|
|
.locals 12
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfR:Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
monitor-exit p0
|
|
|
|
return v1
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfI:Lokhttp3/internal/i/d;
|
|
|
|
iget-object v2, p0, Lokhttp3/internal/i/a;->cfK:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v2}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Lokio/ByteString;
|
|
|
|
const/4 v3, 0x0
|
|
|
|
if-nez v2, :cond_4
|
|
|
|
iget-object v4, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v4}, Ljava/util/ArrayDeque;->poll()Ljava/lang/Object;
|
|
|
|
move-result-object v4
|
|
|
|
instance-of v5, v4, Lokhttp3/internal/i/a$b;
|
|
|
|
if-eqz v5, :cond_2
|
|
|
|
iget v5, p0, Lokhttp3/internal/i/a;->cfP:I
|
|
|
|
iget-object v6, p0, Lokhttp3/internal/i/a;->cfQ:Ljava/lang/String;
|
|
|
|
const/4 v7, -0x1
|
|
|
|
if-eq v5, v7, :cond_1
|
|
|
|
iget-object v7, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
iput-object v3, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
iget-object v3, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
invoke-interface {v3}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
|
|
|
|
:goto_0
|
|
move-object v3, v6
|
|
|
|
goto :goto_2
|
|
|
|
:cond_1
|
|
iget-object v7, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
new-instance v8, Lokhttp3/internal/i/a$a;
|
|
|
|
invoke-direct {v8, p0}, Lokhttp3/internal/i/a$a;-><init>(Lokhttp3/internal/i/a;)V
|
|
|
|
move-object v9, v4
|
|
|
|
check-cast v9, Lokhttp3/internal/i/a$b;
|
|
|
|
iget-wide v9, v9, Lokhttp3/internal/i/a$b;->cfY:J
|
|
|
|
sget-object v11, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-interface {v7, v8, v9, v10, v11}, Ljava/util/concurrent/ScheduledExecutorService;->schedule(Ljava/lang/Runnable;JLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
move-result-object v7
|
|
|
|
iput-object v7, p0, Lokhttp3/internal/i/a;->cfO:Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
move-object v7, v3
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
if-nez v4, :cond_3
|
|
|
|
monitor-exit p0
|
|
|
|
return v1
|
|
|
|
:cond_3
|
|
move-object v7, v3
|
|
|
|
goto :goto_1
|
|
|
|
:cond_4
|
|
move-object v4, v3
|
|
|
|
move-object v7, v4
|
|
|
|
:goto_1
|
|
const/4 v5, 0x0
|
|
|
|
:goto_2
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_3
|
|
|
|
const/4 v6, 0x1
|
|
|
|
if-eqz v2, :cond_5
|
|
|
|
const/16 v1, 0xa
|
|
|
|
:try_start_1
|
|
invoke-virtual {v0, v1, v2}, Lokhttp3/internal/i/d;->a(ILokio/ByteString;)V
|
|
|
|
goto/16 :goto_3
|
|
|
|
:catchall_0
|
|
move-exception v0
|
|
|
|
goto/16 :goto_4
|
|
|
|
:cond_5
|
|
instance-of v2, v4, Lokhttp3/internal/i/a$c;
|
|
|
|
if-eqz v2, :cond_7
|
|
|
|
move-object v2, v4
|
|
|
|
check-cast v2, Lokhttp3/internal/i/a$c;
|
|
|
|
iget-object v2, v2, Lokhttp3/internal/i/a$c;->cga:Lokio/ByteString;
|
|
|
|
check-cast v4, Lokhttp3/internal/i/a$c;
|
|
|
|
iget v3, v4, Lokhttp3/internal/i/a$c;->cfZ:I
|
|
|
|
invoke-virtual {v2}, Lokio/ByteString;->size()I
|
|
|
|
move-result v4
|
|
|
|
int-to-long v4, v4
|
|
|
|
iget-boolean v8, v0, Lokhttp3/internal/i/d;->cgo:Z
|
|
|
|
if-nez v8, :cond_6
|
|
|
|
iput-boolean v6, v0, Lokhttp3/internal/i/d;->cgo:Z
|
|
|
|
iget-object v8, v0, Lokhttp3/internal/i/d;->cgn:Lokhttp3/internal/i/d$a;
|
|
|
|
iput v3, v8, Lokhttp3/internal/i/d$a;->cfZ:I
|
|
|
|
iget-object v3, v0, Lokhttp3/internal/i/d;->cgn:Lokhttp3/internal/i/d$a;
|
|
|
|
iput-wide v4, v3, Lokhttp3/internal/i/d$a;->contentLength:J
|
|
|
|
iget-object v3, v0, Lokhttp3/internal/i/d;->cgn:Lokhttp3/internal/i/d$a;
|
|
|
|
iput-boolean v6, v3, Lokhttp3/internal/i/d$a;->cgp:Z
|
|
|
|
iget-object v3, v0, Lokhttp3/internal/i/d;->cgn:Lokhttp3/internal/i/d$a;
|
|
|
|
iput-boolean v1, v3, Lokhttp3/internal/i/d$a;->closed:Z
|
|
|
|
iget-object v0, v0, Lokhttp3/internal/i/d;->cgn:Lokhttp3/internal/i/d$a;
|
|
|
|
invoke-static {v0}, Lokio/j;->b(Lokio/p;)Lokio/BufferedSink;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-interface {v0, v2}, Lokio/BufferedSink;->i(Lokio/ByteString;)Lokio/BufferedSink;
|
|
|
|
invoke-interface {v0}, Lokio/BufferedSink;->close()V
|
|
|
|
monitor-enter p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:try_start_2
|
|
iget-wide v0, p0, Lokhttp3/internal/i/a;->cfM:J
|
|
|
|
invoke-virtual {v2}, Lokio/ByteString;->size()I
|
|
|
|
move-result v2
|
|
|
|
int-to-long v2, v2
|
|
|
|
sub-long/2addr v0, v2
|
|
|
|
iput-wide v0, p0, Lokhttp3/internal/i/a;->cfM:J
|
|
|
|
monitor-exit p0
|
|
|
|
goto :goto_3
|
|
|
|
:catchall_1
|
|
move-exception v0
|
|
|
|
monitor-exit p0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
:try_start_3
|
|
throw v0
|
|
|
|
:cond_6
|
|
new-instance v0, Ljava/lang/IllegalStateException;
|
|
|
|
const-string v1, "Another message writer is active. Did you call close()?"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_7
|
|
instance-of v1, v4, Lokhttp3/internal/i/a$b;
|
|
|
|
if-eqz v1, :cond_d
|
|
|
|
check-cast v4, Lokhttp3/internal/i/a$b;
|
|
|
|
iget v1, v4, Lokhttp3/internal/i/a$b;->code:I
|
|
|
|
iget-object v2, v4, Lokhttp3/internal/i/a$b;->cfX:Lokio/ByteString;
|
|
|
|
sget-object v4, Lokio/ByteString;->cgQ:Lokio/ByteString;
|
|
|
|
if-nez v1, :cond_8
|
|
|
|
if-eqz v2, :cond_b
|
|
|
|
:cond_8
|
|
if-eqz v1, :cond_9
|
|
|
|
invoke-static {v1}, Lokhttp3/internal/i/b;->fp(I)V
|
|
|
|
:cond_9
|
|
new-instance v4, Lokio/c;
|
|
|
|
invoke-direct {v4}, Lokio/c;-><init>()V
|
|
|
|
invoke-virtual {v4, v1}, Lokio/c;->ft(I)Lokio/c;
|
|
|
|
if-eqz v2, :cond_a
|
|
|
|
invoke-virtual {v4, v2}, Lokio/c;->g(Lokio/ByteString;)Lokio/c;
|
|
|
|
:cond_a
|
|
invoke-virtual {v4}, Lokio/c;->Ik()Lokio/ByteString;
|
|
|
|
move-result-object v4
|
|
:try_end_3
|
|
.catchall {:try_start_3 .. :try_end_3} :catchall_0
|
|
|
|
:cond_b
|
|
const/16 v1, 0x8
|
|
|
|
:try_start_4
|
|
invoke-virtual {v0, v1, v4}, Lokhttp3/internal/i/d;->a(ILokio/ByteString;)V
|
|
:try_end_4
|
|
.catchall {:try_start_4 .. :try_end_4} :catchall_2
|
|
|
|
:try_start_5
|
|
iput-boolean v6, v0, Lokhttp3/internal/i/d;->cgl:Z
|
|
|
|
if-eqz v7, :cond_c
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
invoke-virtual {v0, p0, v5, v3}, Lokhttp3/WebSocketListener;->onClosed(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
:try_end_5
|
|
.catchall {:try_start_5 .. :try_end_5} :catchall_0
|
|
|
|
:cond_c
|
|
:goto_3
|
|
invoke-static {v7}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
return v6
|
|
|
|
:catchall_2
|
|
move-exception v1
|
|
|
|
:try_start_6
|
|
iput-boolean v6, v0, Lokhttp3/internal/i/d;->cgl:Z
|
|
|
|
throw v1
|
|
|
|
:cond_d
|
|
new-instance v0, Ljava/lang/AssertionError;
|
|
|
|
invoke-direct {v0}, Ljava/lang/AssertionError;-><init>()V
|
|
|
|
throw v0
|
|
:try_end_6
|
|
.catchall {:try_start_6 .. :try_end_6} :catchall_0
|
|
|
|
:goto_4
|
|
invoke-static {v7}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
throw v0
|
|
|
|
:catchall_3
|
|
move-exception v0
|
|
|
|
:try_start_7
|
|
monitor-exit p0
|
|
:try_end_7
|
|
.catchall {:try_start_7 .. :try_end_7} :catchall_3
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public final a(Ljava/lang/Exception;Lokhttp3/Response;)V
|
|
.locals 3
|
|
.param p2 # Lokhttp3/Response;
|
|
.annotation runtime Ljavax/annotation/Nullable;
|
|
.end annotation
|
|
.end param
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfR:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const/4 v0, 0x1
|
|
|
|
iput-boolean v0, p0, Lokhttp3/internal/i/a;->cfR:Z
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
iput-object v1, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfO:Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
if-eqz v1, :cond_1
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfO:Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/concurrent/ScheduledFuture;->cancel(Z)Z
|
|
|
|
:cond_1
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
if-eqz v1, :cond_2
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
invoke-interface {v1}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
|
|
|
|
:cond_2
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:try_start_1
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
invoke-virtual {v1, p0, p1, p2}, Lokhttp3/WebSocketListener;->onFailure(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
invoke-static {v0}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
invoke-static {v0}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
throw p1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
:try_start_2
|
|
monitor-exit p0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final a(Ljava/lang/String;Lokhttp3/internal/i/a$e;)V
|
|
.locals 7
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iput-object p2, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
new-instance v0, Lokhttp3/internal/i/d;
|
|
|
|
iget-boolean v1, p2, Lokhttp3/internal/i/a$e;->cdH:Z
|
|
|
|
iget-object v2, p2, Lokhttp3/internal/i/a$e;->cbR:Lokio/BufferedSink;
|
|
|
|
iget-object v3, p0, Lokhttp3/internal/i/a;->random:Ljava/util/Random;
|
|
|
|
invoke-direct {v0, v1, v2, v3}, Lokhttp3/internal/i/d;-><init>(ZLokio/BufferedSink;Ljava/util/Random;)V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/i/a;->cfI:Lokhttp3/internal/i/d;
|
|
|
|
new-instance v0, Ljava/util/concurrent/ScheduledThreadPoolExecutor;
|
|
|
|
const/4 v1, 0x1
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {p1, v2}, Lokhttp3/internal/c;->j(Ljava/lang/String;Z)Ljava/util/concurrent/ThreadFactory;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {v0, v1, p1}, Ljava/util/concurrent/ScheduledThreadPoolExecutor;-><init>(ILjava/util/concurrent/ThreadFactory;)V
|
|
|
|
iput-object v0, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
iget-wide v0, p0, Lokhttp3/internal/i/a;->cfF:J
|
|
|
|
const-wide/16 v2, 0x0
|
|
|
|
cmp-long p1, v0, v2
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
new-instance v1, Lokhttp3/internal/i/a$d;
|
|
|
|
invoke-direct {v1, p0}, Lokhttp3/internal/i/a$d;-><init>(Lokhttp3/internal/i/a;)V
|
|
|
|
iget-wide v2, p0, Lokhttp3/internal/i/a;->cfF:J
|
|
|
|
iget-wide v4, p0, Lokhttp3/internal/i/a;->cfF:J
|
|
|
|
sget-object v6, Ljava/util/concurrent/TimeUnit;->MILLISECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-interface/range {v0 .. v6}, Ljava/util/concurrent/ScheduledExecutorService;->scheduleAtFixedRate(Ljava/lang/Runnable;JJLjava/util/concurrent/TimeUnit;)Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
:cond_0
|
|
iget-object p1, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {p1}, Ljava/util/ArrayDeque;->isEmpty()Z
|
|
|
|
move-result p1
|
|
|
|
if-nez p1, :cond_1
|
|
|
|
invoke-direct {p0}, Lokhttp3/internal/i/a;->IP()V
|
|
|
|
:cond_1
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
new-instance p1, Lokhttp3/internal/i/c;
|
|
|
|
iget-boolean v0, p2, Lokhttp3/internal/i/a$e;->cdH:Z
|
|
|
|
iget-object p2, p2, Lokhttp3/internal/i/a$e;->caE:Lokio/d;
|
|
|
|
invoke-direct {p1, v0, p2, p0}, Lokhttp3/internal/i/c;-><init>(ZLokio/d;Lokhttp3/internal/i/c$a;)V
|
|
|
|
iput-object p1, p0, Lokhttp3/internal/i/a;->cfH:Lokhttp3/internal/i/c;
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_1
|
|
monitor-exit p0
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final d(Lokio/ByteString;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
invoke-virtual {v0, p0, p1}, Lokhttp3/WebSocketListener;->onMessage(Lokhttp3/WebSocket;Lokio/ByteString;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final declared-synchronized e(Lokio/ByteString;)V
|
|
.locals 1
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfR:Z
|
|
|
|
if-nez v0, :cond_1
|
|
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfN:Z
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfK:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v0, p1}, Ljava/util/ArrayDeque;->add(Ljava/lang/Object;)Z
|
|
|
|
invoke-direct {p0}, Lokhttp3/internal/i/a;->IP()V
|
|
|
|
iget p1, p0, Lokhttp3/internal/i/a;->cfT:I
|
|
|
|
add-int/lit8 p1, p1, 0x1
|
|
|
|
iput p1, p0, Lokhttp3/internal/i/a;->cfT:I
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_0
|
|
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:cond_1
|
|
:goto_0
|
|
monitor-exit p0
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final eJ(Ljava/lang/String;)V
|
|
.locals 1
|
|
.annotation system Ldalvik/annotation/Throws;
|
|
value = {
|
|
Ljava/io/IOException;
|
|
}
|
|
.end annotation
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
invoke-virtual {v0, p0, p1}, Lokhttp3/WebSocketListener;->onMessage(Lokhttp3/WebSocket;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final ew(Ljava/lang/String;)Z
|
|
.locals 1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-static {p1}, Lokio/ByteString;->eM(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-direct {p0, p1}, Lokhttp3/internal/i/a;->f(Lokio/ByteString;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
|
|
:cond_0
|
|
new-instance p1, Ljava/lang/NullPointerException;
|
|
|
|
const-string v0, "text == null"
|
|
|
|
invoke-direct {p1, v0}, Ljava/lang/NullPointerException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public final h(ILjava/lang/String;)Z
|
|
.locals 0
|
|
|
|
invoke-direct {p0, p1, p2}, Lokhttp3/internal/i/a;->j(ILjava/lang/String;)Z
|
|
|
|
move-result p1
|
|
|
|
return p1
|
|
.end method
|
|
|
|
.method public final i(ILjava/lang/String;)V
|
|
.locals 3
|
|
|
|
const/4 v0, -0x1
|
|
|
|
if-eq p1, v0, :cond_4
|
|
|
|
monitor-enter p0
|
|
|
|
:try_start_0
|
|
iget v1, p0, Lokhttp3/internal/i/a;->cfP:I
|
|
|
|
if-ne v1, v0, :cond_3
|
|
|
|
iput p1, p0, Lokhttp3/internal/i/a;->cfP:I
|
|
|
|
iput-object p2, p0, Lokhttp3/internal/i/a;->cfQ:Ljava/lang/String;
|
|
|
|
iget-boolean v0, p0, Lokhttp3/internal/i/a;->cfN:Z
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfL:Ljava/util/ArrayDeque;
|
|
|
|
invoke-virtual {v0}, Ljava/util/ArrayDeque;->isEmpty()Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_1
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
iput-object v1, p0, Lokhttp3/internal/i/a;->cfJ:Lokhttp3/internal/i/a$e;
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfO:Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
if-eqz v1, :cond_0
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfO:Ljava/util/concurrent/ScheduledFuture;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-interface {v1, v2}, Ljava/util/concurrent/ScheduledFuture;->cancel(Z)Z
|
|
|
|
:cond_0
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->nK:Ljava/util/concurrent/ScheduledExecutorService;
|
|
|
|
invoke-interface {v1}, Ljava/util/concurrent/ScheduledExecutorService;->shutdown()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
move-object v0, v1
|
|
|
|
:goto_0
|
|
monitor-exit p0
|
|
:try_end_0
|
|
.catchall {:try_start_0 .. :try_end_0} :catchall_1
|
|
|
|
:try_start_1
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
invoke-virtual {v1, p0, p1, p2}, Lokhttp3/WebSocketListener;->onClosing(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
|
|
if-eqz v0, :cond_2
|
|
|
|
iget-object v1, p0, Lokhttp3/internal/i/a;->cfE:Lokhttp3/WebSocketListener;
|
|
|
|
invoke-virtual {v1, p0, p1, p2}, Lokhttp3/WebSocketListener;->onClosed(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
:cond_2
|
|
invoke-static {v0}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
invoke-static {v0}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
:try_start_2
|
|
new-instance p1, Ljava/lang/IllegalStateException;
|
|
|
|
const-string p2, "already closed"
|
|
|
|
invoke-direct {p1, p2}, Ljava/lang/IllegalStateException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:catchall_1
|
|
move-exception p1
|
|
|
|
monitor-exit p0
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
throw p1
|
|
|
|
:cond_4
|
|
new-instance p1, Ljava/lang/IllegalArgumentException;
|
|
|
|
invoke-direct {p1}, Ljava/lang/IllegalArgumentException;-><init>()V
|
|
|
|
throw p1
|
|
.end method
|