538 lines
14 KiB
Smali
538 lines
14 KiB
Smali
.class public final Lcom/discord/utilities/fcm/NotificationClient$FCMMessagingService;
|
|
.super Lcom/google/firebase/messaging/FirebaseMessagingService;
|
|
.source "NotificationClient.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/fcm/NotificationClient;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "FCMMessagingService"
|
|
.end annotation
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Lcom/google/firebase/messaging/FirebaseMessagingService;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final onMessageReceived(Lcom/google/firebase/messaging/RemoteMessage;)V
|
|
.locals 16
|
|
|
|
move-object/from16 v0, p1
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
sget-object v0, Lcom/discord/app/AppLog;->wM:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
const/4 v3, 0x0
|
|
|
|
const/4 v4, 0x6
|
|
|
|
const/4 v5, 0x0
|
|
|
|
const-string v1, "Got null remote message."
|
|
|
|
invoke-static/range {v0 .. v5}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
iget-object v1, v0, Lcom/google/firebase/messaging/RemoteMessage;->aXt:Ljava/util/Map;
|
|
|
|
const-string v2, "message_type"
|
|
|
|
const-string v3, "collapse_key"
|
|
|
|
const-string v4, "from"
|
|
|
|
if-nez v1, :cond_3
|
|
|
|
iget-object v1, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
new-instance v5, Landroidx/collection/ArrayMap;
|
|
|
|
invoke-direct {v5}, Landroidx/collection/ArrayMap;-><init>()V
|
|
|
|
invoke-virtual {v1}, Landroid/os/Bundle;->keySet()Ljava/util/Set;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-interface {v6}, Ljava/util/Set;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v6
|
|
|
|
:cond_1
|
|
:goto_0
|
|
invoke-interface {v6}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v7
|
|
|
|
if-eqz v7, :cond_2
|
|
|
|
invoke-interface {v6}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v7
|
|
|
|
check-cast v7, Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v7}, Landroid/os/Bundle;->get(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
move-result-object v8
|
|
|
|
instance-of v9, v8, Ljava/lang/String;
|
|
|
|
if-eqz v9, :cond_1
|
|
|
|
check-cast v8, Ljava/lang/String;
|
|
|
|
const-string v9, "google."
|
|
|
|
invoke-virtual {v7, v9}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_1
|
|
|
|
const-string v9, "gcm."
|
|
|
|
invoke-virtual {v7, v9}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_1
|
|
|
|
invoke-virtual {v7, v4}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_1
|
|
|
|
invoke-virtual {v7, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_1
|
|
|
|
invoke-virtual {v7, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v9
|
|
|
|
if-nez v9, :cond_1
|
|
|
|
invoke-virtual {v5, v7, v8}, Landroidx/collection/ArrayMap;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_2
|
|
iput-object v5, v0, Lcom/google/firebase/messaging/RemoteMessage;->aXt:Ljava/util/Map;
|
|
|
|
:cond_3
|
|
iget-object v1, v0, Lcom/google/firebase/messaging/RemoteMessage;->aXt:Ljava/util/Map;
|
|
|
|
const/4 v5, 0x4
|
|
|
|
const/4 v6, 0x3
|
|
|
|
const/4 v7, 0x2
|
|
|
|
const/4 v8, 0x1
|
|
|
|
const/4 v9, 0x0
|
|
|
|
if-nez v1, :cond_a
|
|
|
|
sget-object v10, Lcom/discord/app/AppLog;->wM:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/4 v1, 0x5
|
|
|
|
new-array v1, v1, [Lkotlin/Pair;
|
|
|
|
iget-object v11, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
invoke-virtual {v11, v4}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
const-string v11, "null"
|
|
|
|
if-nez v4, :cond_4
|
|
|
|
move-object v4, v11
|
|
|
|
:cond_4
|
|
const-string v13, "fcm_from"
|
|
|
|
invoke-static {v13, v4}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v1, v9
|
|
|
|
iget-object v4, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
const-string v9, "google.to"
|
|
|
|
invoke-virtual {v4, v9}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
if-nez v4, :cond_5
|
|
|
|
move-object v4, v11
|
|
|
|
:cond_5
|
|
const-string v9, "fcm_to"
|
|
|
|
invoke-static {v9, v4}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v1, v8
|
|
|
|
iget-object v4, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
const-string v8, "google.message_id"
|
|
|
|
invoke-virtual {v4, v8}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
if-nez v4, :cond_6
|
|
|
|
iget-object v4, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
const-string v8, "message_id"
|
|
|
|
invoke-virtual {v4, v8}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v4
|
|
|
|
:cond_6
|
|
if-nez v4, :cond_7
|
|
|
|
move-object v4, v11
|
|
|
|
:cond_7
|
|
const-string v8, "fcm_messageId"
|
|
|
|
invoke-static {v8, v4}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v4
|
|
|
|
aput-object v4, v1, v7
|
|
|
|
iget-object v4, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
invoke-virtual {v4, v3}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
if-nez v3, :cond_8
|
|
|
|
move-object v3, v11
|
|
|
|
:cond_8
|
|
const-string v4, "fcm_collapseKey"
|
|
|
|
invoke-static {v4, v3}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v1, v6
|
|
|
|
iget-object v0, v0, Lcom/google/firebase/messaging/RemoteMessage;->aYv:Landroid/os/Bundle;
|
|
|
|
invoke-virtual {v0, v2}, Landroid/os/Bundle;->getString(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_9
|
|
|
|
move-object v0, v11
|
|
|
|
:cond_9
|
|
const-string v2, "fcm_messageType"
|
|
|
|
invoke-static {v2, v0}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v1, v5
|
|
|
|
invoke-static {v1}, Lkotlin/a/ad;->a([Lkotlin/Pair;)Ljava/util/Map;
|
|
|
|
move-result-object v13
|
|
|
|
const/4 v14, 0x2
|
|
|
|
const/4 v15, 0x0
|
|
|
|
const-string v11, "Got remote message with null data."
|
|
|
|
invoke-static/range {v10 .. v15}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_a
|
|
invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v2, "Got notification: "
|
|
|
|
invoke-virtual {v2, v0}, Ljava/lang/String;->concat(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-static {v0}, Lcom/discord/app/AppLog;->i(Ljava/lang/String;)V
|
|
|
|
new-instance v0, Lcom/discord/utilities/fcm/NotificationData;
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/utilities/fcm/NotificationData;-><init>(Ljava/util/Map;)V
|
|
|
|
sget-object v1, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/fcm/NotificationClient;->getSettings$app_productionDiscordExternalRelease()Lcom/discord/utilities/fcm/NotificationClient$SettingsV2;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/fcm/NotificationData;->getAckChannelIds()Ljava/util/List;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-interface {v2}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v2
|
|
|
|
:goto_1
|
|
invoke-interface {v2}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_b
|
|
|
|
invoke-interface {v2}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v3
|
|
|
|
check-cast v3, Ljava/lang/Number;
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Number;->longValue()J
|
|
|
|
move-result-wide v3
|
|
|
|
sget-object v10, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
sget-object v11, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-static {v11}, Lcom/discord/utilities/fcm/NotificationClient;->access$getContext$p(Lcom/discord/utilities/fcm/NotificationClient;)Landroid/content/Context;
|
|
|
|
move-result-object v11
|
|
|
|
invoke-virtual {v10, v3, v4, v11}, Lcom/discord/utilities/fcm/NotificationClient;->clear(JLandroid/content/Context;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_b
|
|
sget-object v2, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-static {v2}, Lcom/discord/utilities/fcm/NotificationClient;->access$getContext$p(Lcom/discord/utilities/fcm/NotificationClient;)Landroid/content/Context;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_c
|
|
|
|
sget-object v10, Lcom/discord/app/AppLog;->wM:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v12, 0x0
|
|
|
|
const/4 v13, 0x0
|
|
|
|
const/4 v14, 0x6
|
|
|
|
const/4 v15, 0x0
|
|
|
|
const-string v11, "Not showing notification because context was null."
|
|
|
|
invoke-static/range {v10 .. v15}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
|
|
:cond_c
|
|
invoke-virtual {v0}, Lcom/discord/utilities/fcm/NotificationData;->isValid()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_10
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/fcm/NotificationClient$SettingsV2;->isAuthed()Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_d
|
|
|
|
goto :goto_2
|
|
|
|
:cond_d
|
|
sget-object v3, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-static {v3}, Lcom/discord/utilities/fcm/NotificationClient;->access$isBackgrounded$p(Lcom/discord/utilities/fcm/NotificationClient;)Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_e
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/fcm/NotificationClient$SettingsV2;->isEnabled()Z
|
|
|
|
move-result v3
|
|
|
|
if-eqz v3, :cond_e
|
|
|
|
sget-object v3, Lcom/discord/utilities/fcm/NotificationRenderer;->INSTANCE:Lcom/discord/utilities/fcm/NotificationRenderer;
|
|
|
|
invoke-virtual {v3, v2, v0, v1}, Lcom/discord/utilities/fcm/NotificationRenderer;->display(Landroid/content/Context;Lcom/discord/utilities/fcm/NotificationData;Lcom/discord/utilities/fcm/NotificationClient$SettingsV2;)V
|
|
|
|
return-void
|
|
|
|
:cond_e
|
|
sget-object v3, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-static {v3}, Lcom/discord/utilities/fcm/NotificationClient;->access$isBackgrounded$p(Lcom/discord/utilities/fcm/NotificationClient;)Z
|
|
|
|
move-result v3
|
|
|
|
if-nez v3, :cond_f
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/fcm/NotificationClient$SettingsV2;->isEnabledInApp()Z
|
|
|
|
move-result v1
|
|
|
|
if-eqz v1, :cond_f
|
|
|
|
sget-object v1, Lcom/discord/utilities/fcm/NotificationRenderer;->INSTANCE:Lcom/discord/utilities/fcm/NotificationRenderer;
|
|
|
|
invoke-virtual {v1, v2, v0}, Lcom/discord/utilities/fcm/NotificationRenderer;->displayInApp(Landroid/content/Context;Lcom/discord/utilities/fcm/NotificationData;)V
|
|
|
|
:cond_f
|
|
return-void
|
|
|
|
:cond_10
|
|
:goto_2
|
|
invoke-virtual {v0}, Lcom/discord/utilities/fcm/NotificationData;->getType()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "MESSAGE_CREATE"
|
|
|
|
invoke-static {v2, v3}, Lkotlin/jvm/internal/k;->n(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_11
|
|
|
|
sget-object v10, Lcom/discord/app/AppLog;->wM:Lcom/discord/app/AppLog;
|
|
|
|
const/4 v12, 0x0
|
|
|
|
new-array v2, v5, [Lkotlin/Pair;
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/fcm/NotificationData;->getMessageId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "messageId"
|
|
|
|
invoke-static {v4, v3}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v2, v9
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/fcm/NotificationData;->getChannelId()J
|
|
|
|
move-result-wide v3
|
|
|
|
invoke-static {v3, v4}, Ljava/lang/String;->valueOf(J)Ljava/lang/String;
|
|
|
|
move-result-object v3
|
|
|
|
const-string v4, "channelId"
|
|
|
|
invoke-static {v4, v3}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v3
|
|
|
|
aput-object v3, v2, v8
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/fcm/NotificationClient$SettingsV2;->isAuthed()Z
|
|
|
|
move-result v1
|
|
|
|
invoke-static {v1}, Ljava/lang/String;->valueOf(Z)Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v3, "isAuthed"
|
|
|
|
invoke-static {v3, v1}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v1
|
|
|
|
aput-object v1, v2, v7
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/fcm/NotificationData;->getType()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "type"
|
|
|
|
invoke-static {v1, v0}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v2, v6
|
|
|
|
invoke-static {v2}, Lkotlin/a/ad;->a([Lkotlin/Pair;)Ljava/util/Map;
|
|
|
|
move-result-object v13
|
|
|
|
const/4 v14, 0x2
|
|
|
|
const/4 v15, 0x0
|
|
|
|
const-string v11, "Not showing invalid notification"
|
|
|
|
invoke-static/range {v10 .. v15}, Lcom/discord/utilities/logging/Logger;->e$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;Ljava/util/Map;ILjava/lang/Object;)V
|
|
|
|
:cond_11
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onNewToken(Ljava/lang/String;)V
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/utilities/fcm/NotificationClient;->onNewToken(Ljava/lang/String;)V
|
|
|
|
return-void
|
|
.end method
|