apkfuckery/com.discord/smali/f/a/g/d.smali

348 lines
9.2 KiB
Smali
Raw Normal View History

2020-07-08 16:44:49 +00:00
.class public final Lf/a/g/d;
2020-11-09 19:03:49 +00:00
.super Ly/n/c/k;
.source "RtcConnection.kt"
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
# interfaces
2020-11-09 19:03:49 +00:00
.implements Lkotlin/jvm/functions/Function0;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
2020-11-09 19:03:49 +00:00
"Ly/n/c/k;",
"Lkotlin/jvm/functions/Function0<",
"Lkotlin/Unit;",
2020-07-08 16:44:49 +00:00
">;"
}
.end annotation
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
# instance fields
2020-11-09 19:03:49 +00:00
.field public final synthetic this$0:Lf/a/g/e;
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
# direct methods
2020-11-09 19:03:49 +00:00
.method public constructor <init>(Lf/a/g/e;)V
2020-07-08 16:44:49 +00:00
.locals 0
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iput-object p1, p0, Lf/a/g/d;->this$0:Lf/a/g/e;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
const/4 p1, 0x0
invoke-direct {p0, p1}, Ly/n/c/k;-><init>(I)V
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
return-void
.end method
2020-05-17 12:40:10 +00:00
2020-07-08 16:44:49 +00:00
# virtual methods
2020-11-09 19:03:49 +00:00
.method public invoke()Ljava/lang/Object;
.locals 17
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
move-object/from16 v1, p0
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v0, v1, Lf/a/g/d;->this$0:Lf/a/g/e;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v0, v0, Lf/a/g/e;->d:Lf/a/g/h;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v2, v0, Lf/a/g/h;->this$0:Lcom/discord/rtcconnection/RtcConnection;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v3, v0, Lf/a/g/h;->$endpoint:Ljava/lang/String;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v6, v0, Lf/a/g/h;->$token:Ljava/lang/String;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v7, v0, Lf/a/g/h;->$sslSocketFactory:Ljavax/net/ssl/SSLSocketFactory;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
iget-object v0, v2, Lcom/discord/rtcconnection/RtcConnection;->e:Lcom/discord/utilities/networking/Backoff;
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
invoke-virtual {v0}, Lcom/discord/utilities/networking/Backoff;->succeed()V
2020-05-17 12:40:10 +00:00
2020-11-09 19:03:49 +00:00
if-eqz v7, :cond_0
const-string/jumbo v0, "wss"
goto :goto_0
:cond_0
const-string/jumbo v0, "ws"
:goto_0
const/4 v4, 0x0
2020-11-11 02:08:46 +00:00
const/4 v5, 0x1
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
if-eqz v3, :cond_2
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v3}, Ljava/lang/String;->length()I
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
move-result v8
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
if-nez v8, :cond_1
goto :goto_1
:cond_1
const/4 v8, 0x0
goto :goto_2
:cond_2
:goto_1
const/4 v8, 0x1
:goto_2
if-eqz v8, :cond_4
iget-object v0, v2, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/t/a;
if-eqz v0, :cond_3
iget-object v3, v0, Lf/a/g/t/a;->p:Ljava/util/List;
invoke-interface {v3}, Ljava/util/List;->clear()V
sget-object v3, Lf/a/g/t/b;->d:Lf/a/g/t/b;
invoke-virtual {v0, v3}, Lf/a/g/t/a;->b(Lkotlin/jvm/functions/Function1;)V
iput-boolean v5, v0, Lf/a/g/t/a;->q:Z
:cond_3
sget-object v0, Lcom/discord/rtcconnection/RtcConnection$State$b;->a:Lcom/discord/rtcconnection/RtcConnection$State$b;
invoke-virtual {v2, v0}, Lcom/discord/rtcconnection/RtcConnection;->o(Lcom/discord/rtcconnection/RtcConnection$State;)V
goto/16 :goto_6
:cond_4
const/4 v8, 0x4
const-string v9, ".gg"
const-string v10, ".media"
invoke-static {v3, v9, v10, v4, v8}, Ly/t/k;->replace$default(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZI)Ljava/lang/String;
move-result-object v3
2020-11-09 19:03:49 +00:00
const-string v9, "://"
2020-11-11 02:08:46 +00:00
invoke-static {v0, v9, v3}, Lf/e/c/a/a;->r(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
2020-11-09 19:03:49 +00:00
move-result-object v0
const-string v9, ":80"
const-string v10, ":443"
2020-11-11 02:08:46 +00:00
invoke-static {v0, v9, v10, v4, v8}, Ly/t/k;->replace$default(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;ZI)Ljava/lang/String;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
move-result-object v8
2020-11-09 19:03:49 +00:00
iget-object v9, v2, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/t/a;
const/4 v10, 0x0
2020-11-11 02:08:46 +00:00
if-eqz v9, :cond_5
2020-11-09 19:03:49 +00:00
iget-object v9, v9, Lf/a/g/t/a;->r:Ljava/lang/String;
2020-11-11 02:08:46 +00:00
goto :goto_3
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:cond_5
2020-11-09 19:03:49 +00:00
move-object v9, v10
2020-11-11 02:08:46 +00:00
:goto_3
invoke-static {v9, v8}, Ly/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
2020-11-09 19:03:49 +00:00
move-result v9
2020-11-11 02:08:46 +00:00
if-eqz v9, :cond_7
2020-11-09 19:03:49 +00:00
iget-object v9, v2, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/t/a;
2020-11-11 02:08:46 +00:00
if-eqz v9, :cond_6
2020-11-09 19:03:49 +00:00
iget-object v9, v9, Lf/a/g/t/a;->s:Ljava/lang/String;
2020-11-11 02:08:46 +00:00
goto :goto_4
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:cond_6
2020-11-09 19:03:49 +00:00
move-object v9, v10
2020-11-11 02:08:46 +00:00
:goto_4
2020-11-09 19:03:49 +00:00
invoke-static {v9, v6}, Ly/n/c/j;->areEqual(Ljava/lang/Object;Ljava/lang/Object;)Z
move-result v9
2020-11-11 02:08:46 +00:00
if-eqz v9, :cond_7
2020-11-09 19:03:49 +00:00
iget-object v9, v2, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State;
instance-of v9, v9, Lcom/discord/rtcconnection/RtcConnection$State$d;
2020-11-11 02:08:46 +00:00
if-nez v9, :cond_7
2020-11-09 19:03:49 +00:00
iget-object v11, v2, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
iget-object v12, v2, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String;
const/4 v14, 0x0
const/4 v15, 0x4
const/16 v16, 0x0
const-string v13, "Already connecting, no need to continue."
invoke-static/range {v11 .. v16}, Lcom/discord/utilities/logging/Logger;->w$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
2020-11-11 02:08:46 +00:00
goto/16 :goto_6
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:cond_7
2020-11-09 19:03:49 +00:00
iget-object v9, v2, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/t/a;
2020-11-11 02:08:46 +00:00
if-eqz v9, :cond_8
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
iget-object v11, v9, Lf/a/g/t/a;->p:Ljava/util/List;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-interface {v11}, Ljava/util/List;->clear()V
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
sget-object v11, Lf/a/g/t/b;->d:Lf/a/g/t/b;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v9, v11}, Lf/a/g/t/a;->b(Lkotlin/jvm/functions/Function1;)V
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
iput-boolean v5, v9, Lf/a/g/t/a;->q:Z
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:cond_8
iget-boolean v5, v2, Lcom/discord/rtcconnection/RtcConnection;->h:Z
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
if-eqz v5, :cond_9
2020-11-09 19:03:49 +00:00
const-string v0, "Connect called on destroyed instance."
invoke-virtual {v2, v4, v0, v10}, Lcom/discord/rtcconnection/RtcConnection;->d(ZLjava/lang/String;Ljava/lang/Throwable;)V
2020-11-11 02:08:46 +00:00
goto/16 :goto_6
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:cond_9
if-nez v6, :cond_a
2020-11-09 19:03:49 +00:00
const-string v0, "Connect called with no token."
invoke-virtual {v2, v4, v0, v10}, Lcom/discord/rtcconnection/RtcConnection;->d(ZLjava/lang/String;Ljava/lang/Throwable;)V
2020-11-11 02:08:46 +00:00
goto :goto_6
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:cond_a
iget-object v4, v2, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
new-instance v5, Ljava/lang/StringBuilder;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-direct {v5}, Ljava/lang/StringBuilder;-><init>()V
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
const-string v9, "connecting via endpoint: "
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v5, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
const-string v9, " token: "
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v5, v9}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
move-result-object v5
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
iget-object v9, v2, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v4, v5, v9}, Lcom/discord/utilities/logging/Logger;->recordBreadcrumb(Ljava/lang/String;Ljava/lang/String;)V
2020-11-09 19:03:49 +00:00
:try_start_0
2020-11-11 02:08:46 +00:00
new-instance v4, Ljava/net/URI;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-direct {v4, v0}, Ljava/net/URI;-><init>(Ljava/lang/String;)V
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v4}, Ljava/net/URI;->getHost()Ljava/lang/String;
2020-11-09 19:03:49 +00:00
move-result-object v0
iput-object v0, v2, Lcom/discord/rtcconnection/RtcConnection;->l:Ljava/lang/String;
2020-11-11 02:08:46 +00:00
invoke-virtual {v4}, Ljava/net/URI;->getPort()I
2020-11-09 19:03:49 +00:00
move-result v0
invoke-static {v0}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v0
iput-object v0, v2, Lcom/discord/rtcconnection/RtcConnection;->m:Ljava/lang/Integer;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
2020-11-11 02:08:46 +00:00
goto :goto_5
2020-11-09 19:03:49 +00:00
:catch_0
move-exception v0
2020-11-11 02:08:46 +00:00
iget-object v4, v2, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
new-instance v5, Lkotlin/Pair;
2020-11-09 19:03:49 +00:00
const-string v9, "endpoint"
2020-11-11 02:08:46 +00:00
invoke-direct {v5, v9, v3}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-static {v5}, Lf/h/a/f/f/n/f;->mapOf(Lkotlin/Pair;)Ljava/util/Map;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
move-result-object v3
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
const-string v5, "Failed to parse RTC endpoint"
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-virtual {v4, v5, v0, v3}, Lcom/discord/utilities/logging/Logger;->e(Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;)V
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
:goto_5
2020-11-09 19:03:49 +00:00
new-instance v0, Lf/a/g/t/a;
2020-11-11 02:08:46 +00:00
iget-object v3, v2, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
iget-object v4, v2, Lcom/discord/rtcconnection/RtcConnection;->B:Lcom/discord/rtcconnection/mediaengine/MediaEngine;
2020-11-09 19:03:49 +00:00
2020-11-11 02:08:46 +00:00
invoke-interface {v4}, Lcom/discord/rtcconnection/mediaengine/MediaEngine;->l()Ljava/util/concurrent/ExecutorService;
2020-11-09 19:03:49 +00:00
move-result-object v9
iget-object v10, v2, Lcom/discord/rtcconnection/RtcConnection;->D:Lcom/discord/utilities/time/Clock;
move-object v4, v0
2020-11-11 02:08:46 +00:00
move-object v5, v8
move-object v8, v3
2020-11-09 19:03:49 +00:00
invoke-direct/range {v4 .. v10}, Lf/a/g/t/a;-><init>(Ljava/lang/String;Ljava/lang/String;Ljavax/net/ssl/SSLSocketFactory;Lcom/discord/utilities/logging/Logger;Ljava/util/concurrent/ExecutorService;Lcom/discord/utilities/time/Clock;)V
iget-object v3, v2, Lcom/discord/rtcconnection/RtcConnection;->t:Lf/a/g/q;
const-string v4, "listener"
invoke-static {v3, v4}, Ly/n/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
iget-object v4, v0, Lf/a/g/t/a;->p:Ljava/util/List;
invoke-interface {v4, v3}, Ljava/util/List;->add(Ljava/lang/Object;)Z
invoke-virtual {v0}, Lf/a/g/t/a;->e()Z
iput-object v0, v2, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/t/a;
2020-11-11 02:08:46 +00:00
:goto_6
2020-11-09 19:03:49 +00:00
sget-object v0, Lkotlin/Unit;->a:Lkotlin/Unit;
return-object v0
2020-05-17 12:40:10 +00:00
.end method