apkfuckery/com.discord/smali/f/a/g/g.smali
2020-05-11 21:22:21 +02:00

602 lines
16 KiB
Smali

.class public final Lf/a/g/g;
.super Ljava/lang/Object;
.source "RtcConnection.kt"
# interfaces
.implements Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$b;
# instance fields
.field public final synthetic a:Lcom/discord/rtcconnection/RtcConnection;
# direct methods
.method public constructor <init>(Lcom/discord/rtcconnection/RtcConnection;)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"()V"
}
.end annotation
iput-object p1, p0, Lf/a/g/g;->a:Lcom/discord/rtcconnection/RtcConnection;
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
return-void
.end method
# virtual methods
.method public onConnected(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;Ljava/util/List;)V
.locals 20
.annotation system Ldalvik/annotation/Signature;
value = {
"(",
"Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;",
"Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;",
"Ljava/util/List<",
"Lf/a/g/o/a;",
">;)V"
}
.end annotation
move-object/from16 v0, p2
move-object/from16 v1, p3
const/4 v2, 0x0
if-eqz p1, :cond_6
if-eqz v0, :cond_5
if-eqz v1, :cond_4
move-object/from16 v3, p0
iget-object v4, v3, Lf/a/g/g;->a:Lcom/discord/rtcconnection/RtcConnection;
iget-object v5, v4, Lcom/discord/rtcconnection/RtcConnection;->e:Lcom/discord/utilities/networking/Backoff;
invoke-virtual {v5}, Lcom/discord/utilities/networking/Backoff;->succeed()V
iput-object v0, v4, Lcom/discord/rtcconnection/RtcConnection;->f:Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;
invoke-virtual/range {p2 .. p2}, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->c()Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo$Protocol;
move-result-object v5
sget-object v6, Lf/a/g/d;->b:[I
invoke-virtual {v5}, Ljava/lang/Enum;->ordinal()I
move-result v5
aget v5, v6, v5
const/4 v6, 0x1
if-eq v5, v6, :cond_0
iget-object v7, v4, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
iget-object v8, v4, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String;
const-string v1, "Unsupported protocol: "
invoke-static {v1}, Lf/e/b/a/a;->a(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v1
invoke-virtual/range {p2 .. p2}, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->c()Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo$Protocol;
move-result-object v0
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v9
const/4 v10, 0x0
const/4 v11, 0x0
const/16 v12, 0xc
const/4 v13, 0x0
invoke-static/range {v7 .. v13}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
invoke-virtual {v4, v6}, Lcom/discord/rtcconnection/RtcConnection;->a(Z)V
goto :goto_1
:cond_0
iget-object v14, v4, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
iget-object v5, v4, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String;
const/16 v17, 0x0
const/16 v18, 0x4
const/16 v19, 0x0
const-string v15, "Sending UDP info to RTC server."
move-object/from16 v16, v5
invoke-static/range {v14 .. v19}, Lcom/discord/utilities/logging/Logger;->recordBreadcrumb$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)V
iget-object v4, v4, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/p/a;
if-eqz v4, :cond_3
invoke-virtual/range {p2 .. p2}, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->a()Ljava/lang/String;
move-result-object v5
invoke-virtual/range {p2 .. p2}, Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$TransportInfo;->b()I
move-result v0
if-eqz v5, :cond_2
new-instance v2, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$ProtocolInfo;
const-string v7, "xsalsa20_poly1305"
invoke-direct {v2, v5, v0, v7}, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$ProtocolInfo;-><init>(Ljava/lang/String;ILjava/lang/String;)V
sget-object v0, Lf/a/g/p/a;->y:Lf/a/g/p/a$a;
new-instance v5, Ljava/util/ArrayList;
const/16 v7, 0xa
invoke-static {v1, v7}, Lf/o/a/j/a;->collectionSizeOrDefault(Ljava/lang/Iterable;I)I
move-result v7
invoke-direct {v5, v7}, Ljava/util/ArrayList;-><init>(I)V
invoke-interface/range {p3 .. p3}, Ljava/lang/Iterable;->iterator()Ljava/util/Iterator;
move-result-object v1
:goto_0
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
move-result v7
if-eqz v7, :cond_1
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v7
check-cast v7, Lf/a/g/o/a;
invoke-virtual {v0, v7}, Lf/a/g/p/a$a;->a(Lf/a/g/o/a;)Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$CodecInfo;
move-result-object v7
invoke-interface {v5, v7}, Ljava/util/Collection;->add(Ljava/lang/Object;)Z
goto :goto_0
:cond_1
new-instance v0, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol;
const-string v1, "udp"
invoke-direct {v0, v1, v2, v5}, Lcom/discord/rtcconnection/socket/io/Payloads$Protocol;-><init>(Ljava/lang/String;Lcom/discord/rtcconnection/socket/io/Payloads$Protocol$ProtocolInfo;Ljava/util/List;)V
invoke-virtual {v4, v6, v0}, Lf/a/g/p/a;->a(ILjava/lang/Object;)V
goto :goto_1
:cond_2
const-string v0, "address"
invoke-static {v0}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v2
:cond_3
:goto_1
return-void
:cond_4
move-object/from16 v3, p0
const-string v0, "supportedVideoCodecs"
invoke-static {v0}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v2
:cond_5
move-object/from16 v3, p0
const-string v0, "transportInfo"
invoke-static {v0}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v2
:cond_6
move-object/from16 v3, p0
const-string v0, "connection"
invoke-static {v0}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v2
.end method
.method public onConnectionStateChange(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$ConnectionState;)V
.locals 8
const/4 v0, 0x0
if-eqz p1, :cond_a
if-eqz p2, :cond_9
iget-object p1, p0, Lf/a/g/g;->a:Lcom/discord/rtcconnection/RtcConnection;
iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State;
iget-object v2, p1, Lcom/discord/rtcconnection/RtcConnection;->C:Lcom/discord/utilities/logging/Logger;
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "Connection state change: "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
invoke-virtual {v3, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/Object;)Ljava/lang/StringBuilder;
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
iget-object v4, p1, Lcom/discord/rtcconnection/RtcConnection;->b:Ljava/lang/String;
const/4 v5, 0x0
const/4 v6, 0x4
const/4 v7, 0x0
invoke-static/range {v2 .. v7}, Lcom/discord/utilities/logging/Logger;->recordBreadcrumb$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)V
sget-object v2, Lf/a/g/d;->c:[I
invoke-virtual {p2}, Ljava/lang/Enum;->ordinal()I
move-result p2
aget p2, v2, p2
const/4 v2, 0x1
if-eq p2, v2, :cond_3
const/4 v3, 0x2
if-eq p2, v3, :cond_2
const/4 v3, 0x3
if-eq p2, v3, :cond_1
const/4 v3, 0x4
if-ne p2, v3, :cond_0
sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$e;->a:Lcom/discord/rtcconnection/RtcConnection$State$e;
goto :goto_0
:cond_0
new-instance p1, Ly/g;
invoke-direct {p1}, Ly/g;-><init>()V
throw p1
:cond_1
sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f;
goto :goto_0
:cond_2
sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$g;->a:Lcom/discord/rtcconnection/RtcConnection$State$g;
goto :goto_0
:cond_3
sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$h;->a:Lcom/discord/rtcconnection/RtcConnection$State$h;
:goto_0
invoke-virtual {p1, p2}, Lcom/discord/rtcconnection/RtcConnection;->a(Lcom/discord/rtcconnection/RtcConnection$State;)V
sget-object p2, Lcom/discord/rtcconnection/RtcConnection$State$g;->a:Lcom/discord/rtcconnection/RtcConnection$State$g;
if-ne v1, p2, :cond_4
iget-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State;
sget-object v1, Lcom/discord/rtcconnection/RtcConnection$State$h;->a:Lcom/discord/rtcconnection/RtcConnection$State$h;
if-ne p2, v1, :cond_4
invoke-virtual {p1}, Lcom/discord/rtcconnection/RtcConnection;->j()V
:cond_4
iget-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->g:Lcom/discord/rtcconnection/RtcConnection$State;
sget-object v1, Lcom/discord/rtcconnection/RtcConnection$State$f;->a:Lcom/discord/rtcconnection/RtcConnection$State$f;
if-ne p2, v1, :cond_8
iget-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->D:Lcom/discord/utilities/time/Clock;
invoke-interface {p2}, Lcom/discord/utilities/time/Clock;->currentTimeMillis()J
move-result-wide v3
invoke-static {v3, v4}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object p2
iput-object p2, p1, Lcom/discord/rtcconnection/RtcConnection;->p:Ljava/lang/Long;
iput-boolean v2, p1, Lcom/discord/rtcconnection/RtcConnection;->r:Z
new-array p2, v2, [Lkotlin/Pair;
const/4 v1, 0x0
iget v2, p1, Lcom/discord/rtcconnection/RtcConnection;->q:I
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
new-instance v3, Lkotlin/Pair;
const-string v4, "connect_count"
invoke-direct {v3, v4, v2}, Lkotlin/Pair;-><init>(Ljava/lang/Object;Ljava/lang/Object;)V
aput-object v3, p2, v1
invoke-static {p2}, Ly/q/m;->mutableMapOf([Lkotlin/Pair;)Ljava/util/Map;
move-result-object p2
iget-object v1, p1, Lcom/discord/rtcconnection/RtcConnection;->o:Ljava/lang/Long;
iget-object v2, p1, Lcom/discord/rtcconnection/RtcConnection;->p:Ljava/lang/Long;
if-eqz v2, :cond_6
if-nez v1, :cond_5
goto :goto_1
:cond_5
invoke-virtual {v2}, Ljava/lang/Long;->longValue()J
move-result-wide v2
invoke-virtual {v1}, Ljava/lang/Long;->longValue()J
move-result-wide v0
sub-long/2addr v2, v0
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
:cond_6
:goto_1
if-eqz v0, :cond_7
invoke-virtual {v0}, Ljava/lang/Number;->longValue()J
move-result-wide v0
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
move-result-object v0
const-string v1, "connect_time"
invoke-interface {p2, v1, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
:cond_7
invoke-virtual {p1, p2}, Lcom/discord/rtcconnection/RtcConnection;->a(Ljava/util/Map;)Ljava/util/Map;
sget-object v0, Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;->VOICE_CONNECTION_SUCCESS:Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;
invoke-virtual {p1, v0, p2}, Lcom/discord/rtcconnection/RtcConnection;->a(Lcom/discord/rtcconnection/RtcConnection$AnalyticsEvent;Ljava/util/Map;)V
:cond_8
return-void
:cond_9
const-string p1, "connectionState"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_a
const-string p1, "connection"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public onDestroy(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;)V
.locals 0
if-eqz p1, :cond_0
return-void
:cond_0
const-string p1, "connection"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
const/4 p1, 0x0
throw p1
.end method
.method public onError(Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException;)V
.locals 1
const/4 v0, 0x0
if-eqz p1, :cond_1
if-eqz p2, :cond_0
iget-object p1, p0, Lf/a/g/g;->a:Lcom/discord/rtcconnection/RtcConnection;
invoke-static {p1, p2}, Lcom/discord/rtcconnection/RtcConnection;->a(Lcom/discord/rtcconnection/RtcConnection;Lcom/discord/rtcconnection/mediaengine/MediaEngineConnection$FailedConnectionException;)V
return-void
:cond_0
const-string p1, "exception"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
:cond_1
const-string p1, "connection"
invoke-static {p1}, Ly/v/b/j;->a(Ljava/lang/String;)V
throw v0
.end method
.method public onSpeaking(JIZ)V
.locals 11
iget-object v0, p0, Lf/a/g/g;->a:Lcom/discord/rtcconnection/RtcConnection;
iget-wide v1, v0, Lcom/discord/rtcconnection/RtcConnection;->A:J
cmp-long v3, p1, v1
if-nez v3, :cond_0
iget-object v1, v0, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/p/a;
if-eqz v1, :cond_0
const/4 v2, 0x5
new-instance v10, Lcom/discord/rtcconnection/socket/io/Payloads$Speaking;
invoke-static {p4}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v5
const/4 v3, 0x0
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v6
const/4 v7, 0x0
const/16 v8, 0x8
const/4 v9, 0x0
move-object v3, v10
move v4, p3
invoke-direct/range {v3 .. v9}, Lcom/discord/rtcconnection/socket/io/Payloads$Speaking;-><init>(ILjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
invoke-virtual {v1, v2, v10}, Lf/a/g/p/a;->a(ILjava/lang/Object;)V
:cond_0
new-instance p3, Lf/a/g/h;
invoke-direct {p3, p1, p2, p4}, Lf/a/g/h;-><init>(JZ)V
invoke-virtual {v0, p3}, Lcom/discord/rtcconnection/RtcConnection;->a(Lkotlin/jvm/functions/Function1;)V
return-void
.end method
.method public onVideo(JLjava/lang/Integer;III)V
.locals 13
move-wide v0, p1
move-object v2, p0
iget-object v3, v2, Lf/a/g/g;->a:Lcom/discord/rtcconnection/RtcConnection;
iget-wide v4, v3, Lcom/discord/rtcconnection/RtcConnection;->A:J
cmp-long v6, v0, v4
if-nez v6, :cond_0
iget-object v4, v3, Lcom/discord/rtcconnection/RtcConnection;->j:Lf/a/g/p/a;
if-eqz v4, :cond_0
new-instance v12, Lcom/discord/rtcconnection/socket/io/Payloads$Video;
const/4 v9, 0x0
const/16 v10, 0x8
const/4 v11, 0x0
move-object v5, v12
move/from16 v6, p4
move/from16 v7, p5
move/from16 v8, p6
invoke-direct/range {v5 .. v11}, Lcom/discord/rtcconnection/socket/io/Payloads$Video;-><init>(IIILjava/lang/Long;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
const/16 v5, 0xc
invoke-virtual {v4, v5, v12}, Lf/a/g/p/a;->a(ILjava/lang/Object;)V
:cond_0
new-instance v4, Lf/a/g/i;
move-object/from16 v5, p3
invoke-direct {v4, p1, p2, v5}, Lf/a/g/i;-><init>(JLjava/lang/Integer;)V
invoke-virtual {v3, v4}, Lcom/discord/rtcconnection/RtcConnection;->a(Lkotlin/jvm/functions/Function1;)V
return-void
.end method