333 lines
9.5 KiB
Smali
333 lines
9.5 KiB
Smali
.class public final Lokhttp3/internal/j/a$2;
|
|
.super Ljava/lang/Object;
|
|
.source "RealWebSocket.java"
|
|
|
|
# interfaces
|
|
.implements Lokhttp3/f;
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lokhttp3/internal/j/a;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x1
|
|
name = null
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field final synthetic bxW:Lokhttp3/internal/j/a;
|
|
|
|
.field final synthetic bxX:Lokhttp3/w;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lokhttp3/internal/j/a;Lokhttp3/w;)V
|
|
.locals 0
|
|
|
|
iput-object p1, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
iput-object p2, p0, Lokhttp3/internal/j/a$2;->bxX:Lokhttp3/w;
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final a(Ljava/io/IOException;)V
|
|
.locals 2
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {v0, p1, v1}, Lokhttp3/internal/j/a;->a(Ljava/lang/Exception;Lokhttp3/Response;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final a(Lokhttp3/e;Lokhttp3/Response;)V
|
|
.locals 5
|
|
|
|
const-string v0, "Upgrade"
|
|
|
|
:try_start_0
|
|
iget-object v1, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
iget v2, p2, Lokhttp3/Response;->code:I
|
|
:try_end_0
|
|
.catch Ljava/net/ProtocolException; {:try_start_0 .. :try_end_0} :catch_1
|
|
|
|
const/16 v3, 0x65
|
|
|
|
const-string v4, "\'"
|
|
|
|
if-ne v2, v3, :cond_3
|
|
|
|
:try_start_1
|
|
const-string v2, "Connection"
|
|
|
|
invoke-virtual {p2, v2}, Lokhttp3/Response;->dp(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-virtual {p2, v0}, Lokhttp3/Response;->dp(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v2, "websocket"
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
const-string v0, "Sec-WebSocket-Accept"
|
|
|
|
invoke-virtual {p2, v0}, Lokhttp3/Response;->dp(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v2}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
iget-object v1, v1, Lokhttp3/internal/j/a;->key:Ljava/lang/String;
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"
|
|
|
|
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-static {v1}, Lokio/ByteString;->ek(Ljava/lang/String;)Lokio/ByteString;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lokio/ByteString;->Hv()Lokio/ByteString;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1}, Lokio/ByteString;->Hu()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
:try_end_1
|
|
.catch Ljava/net/ProtocolException; {:try_start_1 .. :try_end_1} :catch_1
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
sget-object v0, Lokhttp3/internal/a;->bsV:Lokhttp3/internal/a;
|
|
|
|
invoke-virtual {v0, p1}, Lokhttp3/internal/a;->a(Lokhttp3/e;)Lokhttp3/internal/b/g;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lokhttp3/internal/b/g;->Gh()V
|
|
|
|
invoke-virtual {p1}, Lokhttp3/internal/b/g;->Gg()Lokhttp3/internal/b/c;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Lokhttp3/internal/b/c$1;
|
|
|
|
iget-object v2, v0, Lokhttp3/internal/b/c;->lY:Lokio/d;
|
|
|
|
iget-object v3, v0, Lokhttp3/internal/b/c;->btZ:Lokio/BufferedSink;
|
|
|
|
invoke-direct {v1, v0, v2, v3, p1}, Lokhttp3/internal/b/c$1;-><init>(Lokhttp3/internal/b/c;Lokio/d;Lokio/BufferedSink;Lokhttp3/internal/b/g;)V
|
|
|
|
:try_start_2
|
|
iget-object v0, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
iget-object v0, v0, Lokhttp3/internal/j/a;->bxF:Lokhttp3/WebSocketListener;
|
|
|
|
iget-object v2, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
invoke-virtual {v0, v2, p2}, Lokhttp3/WebSocketListener;->onOpen(Lokhttp3/WebSocket;Lokhttp3/Response;)V
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v0, "OkHttp WebSocket "
|
|
|
|
invoke-direct {p2, v0}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/j/a$2;->bxX:Lokhttp3/w;
|
|
|
|
iget-object v0, v0, Lokhttp3/w;->bnk:Lokhttp3/s;
|
|
|
|
invoke-virtual {v0}, Lokhttp3/s;->Fu()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
invoke-virtual {v0, p2, v1}, Lokhttp3/internal/j/a;->a(Ljava/lang/String;Lokhttp3/internal/j/a$e;)V
|
|
|
|
invoke-virtual {p1}, Lokhttp3/internal/b/g;->Gg()Lokhttp3/internal/b/c;
|
|
|
|
move-result-object p1
|
|
|
|
iget-object p1, p1, Lokhttp3/internal/b/c;->btX:Ljava/net/Socket;
|
|
|
|
const/4 p2, 0x0
|
|
|
|
invoke-virtual {p1, p2}, Ljava/net/Socket;->setSoTimeout(I)V
|
|
|
|
iget-object p1, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
invoke-virtual {p1}, Lokhttp3/internal/j/a;->GV()V
|
|
:try_end_2
|
|
.catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_0
|
|
|
|
return-void
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
iget-object p2, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
const/4 v0, 0x0
|
|
|
|
invoke-virtual {p2, p1, v0}, Lokhttp3/internal/j/a;->a(Ljava/lang/Exception;Lokhttp3/Response;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
:try_start_3
|
|
new-instance p1, Ljava/net/ProtocolException;
|
|
|
|
new-instance v2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v3, "Expected \'Sec-WebSocket-Accept\' header value \'"
|
|
|
|
invoke-direct {v2, v3}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "\' but was \'"
|
|
|
|
invoke-virtual {v2, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_1
|
|
new-instance p1, Ljava/net/ProtocolException;
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Expected \'Upgrade\' header value \'websocket\' but was \'"
|
|
|
|
invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_2
|
|
new-instance p1, Ljava/net/ProtocolException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Expected \'Connection\' header value \'Upgrade\' but was \'"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
|
|
:cond_3
|
|
new-instance p1, Ljava/net/ProtocolException;
|
|
|
|
new-instance v0, Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, "Expected HTTP 101 response but was \'"
|
|
|
|
invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
iget v1, p2, Lokhttp3/Response;->code:I
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
|
|
|
|
const-string v1, " "
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
iget-object v1, p2, Lokhttp3/Response;->message:Ljava/lang/String;
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-direct {p1, v0}, Ljava/net/ProtocolException;-><init>(Ljava/lang/String;)V
|
|
|
|
throw p1
|
|
:try_end_3
|
|
.catch Ljava/net/ProtocolException; {:try_start_3 .. :try_end_3} :catch_1
|
|
|
|
:catch_1
|
|
move-exception p1
|
|
|
|
iget-object v0, p0, Lokhttp3/internal/j/a$2;->bxW:Lokhttp3/internal/j/a;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lokhttp3/internal/j/a;->a(Ljava/lang/Exception;Lokhttp3/Response;)V
|
|
|
|
invoke-static {p2}, Lokhttp3/internal/c;->closeQuietly(Ljava/io/Closeable;)V
|
|
|
|
return-void
|
|
.end method
|