313 lines
8.3 KiB
Smali
313 lines
8.3 KiB
Smali
.class public final Lcom/discord/utilities/websocket/ZLibWebSocketListener;
|
|
.super Lokhttp3/WebSocketListener;
|
|
.source "ZLibWebSocketListener.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/websocket/ZLibWebSocketListener$ZLibByteStream;,
|
|
Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final inflater:Ljava/util/zip/Inflater;
|
|
|
|
.field public final listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;Ljava/util/zip/Inflater;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
invoke-direct {p0}, Lokhttp3/WebSocketListener;-><init>()V
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->inflater:Ljava/util/zip/Inflater;
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "inflater"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "listener"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public synthetic constructor <init>(Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;Ljava/util/zip/Inflater;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
.locals 0
|
|
|
|
and-int/lit8 p3, p3, 0x2
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
new-instance p2, Ljava/util/zip/Inflater;
|
|
|
|
invoke-direct {p2}, Ljava/util/zip/Inflater;-><init>()V
|
|
|
|
:cond_0
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/utilities/websocket/ZLibWebSocketListener;-><init>(Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;Ljava/util/zip/Inflater;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final getListener()Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
.locals 1
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public onClosed(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->inflater:Ljava/util/zip/Inflater;
|
|
|
|
invoke-virtual {v0}, Ljava/util/zip/Inflater;->reset()V
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {v0, p1, p2, p3}, Lokhttp3/WebSocketListener;->onClosed(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "reason"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "webSocket"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onClosing(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p3, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->inflater:Ljava/util/zip/Inflater;
|
|
|
|
invoke-virtual {v0}, Ljava/util/zip/Inflater;->reset()V
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {v0, p1, p2, p3}, Lokhttp3/WebSocketListener;->onClosing(Lokhttp3/WebSocket;ILjava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "reason"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "webSocket"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onFailure(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {v0, p1, p2, p3}, Lokhttp3/WebSocketListener;->onFailure(Lokhttp3/WebSocket;Ljava/lang/Throwable;Lokhttp3/Response;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "t"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "webSocket"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onMessage(Lokhttp3/WebSocket;Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;->onMessage(Lokhttp3/WebSocket;Ljava/lang/String;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "text"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "webSocket"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onMessage(Lokhttp3/WebSocket;Lokio/ByteString;)V
|
|
.locals 3
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
:try_start_0
|
|
new-instance v1, Lcom/discord/utilities/websocket/ZLibWebSocketListener$ZLibByteStream;
|
|
|
|
iget-object v2, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->inflater:Ljava/util/zip/Inflater;
|
|
|
|
invoke-direct {v1, p2, v2}, Lcom/discord/utilities/websocket/ZLibWebSocketListener$ZLibByteStream;-><init>(Lokio/ByteString;Ljava/util/zip/Inflater;)V
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/websocket/ZLibWebSocketListener$ZLibByteStream;->toReader()Ljava/io/InputStreamReader;
|
|
|
|
move-result-object p2
|
|
:try_end_0
|
|
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
|
|
|
|
:try_start_1
|
|
iget-object v1, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {v1, p1, p2}, Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;->onInflatedMessage(Lokhttp3/WebSocket;Ljava/io/InputStreamReader;)V
|
|
:try_end_1
|
|
.catchall {:try_start_1 .. :try_end_1} :catchall_0
|
|
|
|
invoke-static {p2, v0}, Le/k/a/b/e/p/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
return-void
|
|
|
|
:catchall_0
|
|
move-exception p1
|
|
|
|
:try_start_2
|
|
throw p1
|
|
:try_end_2
|
|
.catchall {:try_start_2 .. :try_end_2} :catchall_1
|
|
|
|
:catchall_1
|
|
move-exception v0
|
|
|
|
invoke-static {p2, p1}, Le/k/a/b/e/p/g;->closeFinally(Ljava/io/Closeable;Ljava/lang/Throwable;)V
|
|
|
|
throw v0
|
|
|
|
:catch_0
|
|
move-exception p1
|
|
|
|
iget-object p2, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {p2, p1}, Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;->onInflateError(Ljava/lang/Exception;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "bytes"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "webSocket"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
.method public onOpen(Lokhttp3/WebSocket;Lokhttp3/Response;)V
|
|
.locals 1
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
if-eqz p2, :cond_0
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->inflater:Ljava/util/zip/Inflater;
|
|
|
|
invoke-virtual {v0}, Ljava/util/zip/Inflater;->reset()V
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/websocket/ZLibWebSocketListener;->listener:Lcom/discord/utilities/websocket/ZLibWebSocketListener$Listener;
|
|
|
|
invoke-virtual {v0, p1, p2}, Lokhttp3/WebSocketListener;->onOpen(Lokhttp3/WebSocket;Lokhttp3/Response;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
const-string p1, "response"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_1
|
|
const-string p1, "webSocket"
|
|
|
|
invoke-static {p1}, Lt/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|