719 lines
19 KiB
Smali
719 lines
19 KiB
Smali
.class public final Lcom/discord/utilities/fcm/NotificationActions;
|
|
.super Landroid/content/BroadcastReceiver;
|
|
.source "NotificationActions.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/fcm/NotificationActions$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final Companion:Lcom/discord/utilities/fcm/NotificationActions$Companion;
|
|
|
|
.field private static final NOTIFICATION_CHANNEL_ID:Ljava/lang/String; = "com.discord.NOTIFICATION_DELETED_CHANNEL_ID"
|
|
|
|
.field private static final NOTIFICATION_ID:Ljava/lang/String; = "com.discord.NOTIFICATION_ID"
|
|
|
|
|
|
# direct methods
|
|
.method static constructor <clinit>()V
|
|
.locals 2
|
|
|
|
new-instance v0, Lcom/discord/utilities/fcm/NotificationActions$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/utilities/fcm/NotificationActions$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/utilities/fcm/NotificationActions;->Companion:Lcom/discord/utilities/fcm/NotificationActions$Companion;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 0
|
|
|
|
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final enqueueAckMessage(Landroid/content/Intent;)V
|
|
.locals 6
|
|
|
|
invoke-virtual {p1}, Landroid/content/Intent;->getData()Landroid/net/Uri;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
const-string v0, "channelId"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-static {v0}, Lkotlin/text/l;->dC(Ljava/lang/String;)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-string v2, "messageId"
|
|
|
|
invoke-virtual {p1, v2}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-static {p1}, Lkotlin/text/l;->dC(Ljava/lang/String;)Ljava/lang/Long;
|
|
|
|
move-result-object p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v2
|
|
|
|
sget-object p1, Lcom/discord/workers/MessageAckWorker;->Az:Lcom/discord/workers/MessageAckWorker$a;
|
|
|
|
new-instance p1, Landroidx/work/Data$Builder;
|
|
|
|
invoke-direct {p1}, Landroidx/work/Data$Builder;-><init>()V
|
|
|
|
const/4 v4, 0x2
|
|
|
|
new-array v4, v4, [Lkotlin/Pair;
|
|
|
|
const/4 v5, 0x0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "com.discord.intent.extra.EXTRA_CHANNEL_ID"
|
|
|
|
invoke-static {v1, v0}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v4, v5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
invoke-static {v2, v3}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "com.discord.intent.extra.EXTRA_MESSAGE_ID"
|
|
|
|
invoke-static {v2, v1}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v1
|
|
|
|
aput-object v1, v4, v0
|
|
|
|
invoke-static {v4}, Lkotlin/a/ab;->a([Lkotlin/Pair;)Ljava/util/Map;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/work/Data$Builder;->putAll(Ljava/util/Map;)Landroidx/work/Data$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Landroidx/work/Data$Builder;->build()Landroidx/work/Data;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "Data.Builder()\n \u2026geId))\n .build()"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
const-class v1, Lcom/discord/workers/MessageAckWorker;
|
|
|
|
invoke-direct {v0, v1}, Landroidx/work/OneTimeWorkRequest$Builder;-><init>(Ljava/lang/Class;)V
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/work/OneTimeWorkRequest$Builder;->setInputData(Landroidx/work/Data;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
sget-object v0, Landroidx/work/BackoffPolicy;->LINEAR:Landroidx/work/BackoffPolicy;
|
|
|
|
const-wide/16 v1, 0x1
|
|
|
|
sget-object v3, Ljava/util/concurrent/TimeUnit;->SECONDS:Ljava/util/concurrent/TimeUnit;
|
|
|
|
invoke-virtual {p1, v0, v1, v2, v3}, Landroidx/work/OneTimeWorkRequest$Builder;->setBackoffCriteria(Landroidx/work/BackoffPolicy;JLjava/util/concurrent/TimeUnit;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
const-string v0, "message"
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/work/OneTimeWorkRequest$Builder;->addTag(Ljava/lang/String;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
const-string v0, "ack"
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/work/OneTimeWorkRequest$Builder;->addTag(Ljava/lang/String;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
new-instance v0, Landroidx/work/Constraints$Builder;
|
|
|
|
invoke-direct {v0}, Landroidx/work/Constraints$Builder;-><init>()V
|
|
|
|
sget-object v1, Landroidx/work/NetworkType;->CONNECTED:Landroidx/work/NetworkType;
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/work/Constraints$Builder;->setRequiredNetworkType(Landroidx/work/NetworkType;)Landroidx/work/Constraints$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Landroidx/work/Constraints$Builder;->build()Landroidx/work/Constraints;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {p1, v0}, Landroidx/work/OneTimeWorkRequest$Builder;->setConstraints(Landroidx/work/Constraints;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/OneTimeWorkRequest$Builder;->build()Landroidx/work/WorkRequest;
|
|
|
|
move-result-object p1
|
|
|
|
const-string v0, "OneTimeWorkRequestBuilde\u2026ild())\n .build()"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest;
|
|
|
|
invoke-static {}, Landroidx/work/WorkManager;->getInstance()Landroidx/work/WorkManager;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast p1, Landroidx/work/WorkRequest;
|
|
|
|
invoke-virtual {v0, p1}, Landroidx/work/WorkManager;->enqueue(Landroidx/work/WorkRequest;)Landroidx/work/Operation;
|
|
|
|
:cond_0
|
|
return-void
|
|
.end method
|
|
|
|
.method private final enqueueDirectReply(Landroid/content/Context;Landroid/content/Intent;)V
|
|
.locals 9
|
|
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getData()Landroid/net/Uri;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
const-string v1, "channelId"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-static {v0}, Lkotlin/text/l;->dC(Ljava/lang/String;)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_4
|
|
|
|
invoke-virtual {v0}, Ljava/lang/Long;->longValue()J
|
|
|
|
move-result-wide v0
|
|
|
|
const-string v2, "com.discord.intent.extra.EXTRA_CHANNEL_NAME"
|
|
|
|
invoke-virtual {p2, v2}, Landroid/content/Intent;->getCharSequenceExtra(Ljava/lang/String;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {p2}, Landroidx/core/app/RemoteInput;->getResultsFromIntent(Landroid/content/Intent;)Landroid/os/Bundle;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
const-string v4, "discord_notif_text_input"
|
|
|
|
invoke-virtual {p2, v4}, Landroid/os/Bundle;->getCharSequence(Ljava/lang/String;)Ljava/lang/CharSequence;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-static {p2}, Lkotlin/text/l;->j(Ljava/lang/CharSequence;)Z
|
|
|
|
move-result v4
|
|
|
|
const/4 v5, 0x1
|
|
|
|
xor-int/2addr v4, v5
|
|
|
|
const/4 v6, 0x0
|
|
|
|
if-eqz v4, :cond_0
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object p2, v6
|
|
|
|
:goto_0
|
|
if-eqz p2, :cond_3
|
|
|
|
invoke-virtual {p2}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
if-nez p2, :cond_1
|
|
|
|
goto/16 :goto_1
|
|
|
|
:cond_1
|
|
sget-object p1, Lcom/discord/workers/MessageSendWorker;->AA:Lcom/discord/workers/MessageSendWorker$a;
|
|
|
|
const-string p1, "message"
|
|
|
|
invoke-static {p2, p1}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v4, Landroidx/work/Data$Builder;
|
|
|
|
invoke-direct {v4}, Landroidx/work/Data$Builder;-><init>()V
|
|
|
|
const/4 v7, 0x3
|
|
|
|
new-array v7, v7, [Lkotlin/Pair;
|
|
|
|
const/4 v8, 0x0
|
|
|
|
invoke-static {v0, v1}, Ljava/lang/Long;->valueOf(J)Ljava/lang/Long;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "com.discord.intent.extra.EXTRA_CHANNEL_ID"
|
|
|
|
invoke-static {v1, v0}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v7, v8
|
|
|
|
if-eqz v3, :cond_2
|
|
|
|
invoke-virtual {v3}, Ljava/lang/Object;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
:cond_2
|
|
invoke-static {v2, v6}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object v0
|
|
|
|
aput-object v0, v7, v5
|
|
|
|
const/4 v0, 0x2
|
|
|
|
const-string v1, "MESSAGE_CONTENT"
|
|
|
|
invoke-static {v1, p2}, Lkotlin/q;->m(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
|
|
|
|
move-result-object p2
|
|
|
|
aput-object p2, v7, v0
|
|
|
|
invoke-static {v7}, Lkotlin/a/ab;->a([Lkotlin/Pair;)Ljava/util/Map;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {v4, p2}, Landroidx/work/Data$Builder;->putAll(Ljava/util/Map;)Landroidx/work/Data$Builder;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Landroidx/work/Data$Builder;->build()Landroidx/work/Data;
|
|
|
|
move-result-object p2
|
|
|
|
const-string v0, "Data.Builder()\n \u2026sage))\n .build()"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v0, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
const-class v1, Lcom/discord/workers/MessageSendWorker;
|
|
|
|
invoke-direct {v0, v1}, Landroidx/work/OneTimeWorkRequest$Builder;-><init>(Ljava/lang/Class;)V
|
|
|
|
invoke-virtual {v0, p2}, Landroidx/work/OneTimeWorkRequest$Builder;->setInputData(Landroidx/work/Data;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p2, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
invoke-virtual {p2, p1}, Landroidx/work/OneTimeWorkRequest$Builder;->addTag(Ljava/lang/String;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
const-string p2, "send"
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/work/OneTimeWorkRequest$Builder;->addTag(Ljava/lang/String;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
new-instance p2, Landroidx/work/Constraints$Builder;
|
|
|
|
invoke-direct {p2}, Landroidx/work/Constraints$Builder;-><init>()V
|
|
|
|
sget-object v0, Landroidx/work/NetworkType;->CONNECTED:Landroidx/work/NetworkType;
|
|
|
|
invoke-virtual {p2, v0}, Landroidx/work/Constraints$Builder;->setRequiredNetworkType(Landroidx/work/NetworkType;)Landroidx/work/Constraints$Builder;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p2}, Landroidx/work/Constraints$Builder;->build()Landroidx/work/Constraints;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/work/OneTimeWorkRequest$Builder;->setConstraints(Landroidx/work/Constraints;)Landroidx/work/WorkRequest$Builder;
|
|
|
|
move-result-object p1
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest$Builder;
|
|
|
|
invoke-virtual {p1}, Landroidx/work/OneTimeWorkRequest$Builder;->build()Landroidx/work/WorkRequest;
|
|
|
|
move-result-object p1
|
|
|
|
const-string p2, "OneTimeWorkRequestBuilde\u2026ild())\n .build()"
|
|
|
|
invoke-static {p1, p2}, Lkotlin/jvm/internal/k;->g(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
check-cast p1, Landroidx/work/OneTimeWorkRequest;
|
|
|
|
invoke-static {}, Landroidx/work/WorkManager;->getInstance()Landroidx/work/WorkManager;
|
|
|
|
move-result-object p2
|
|
|
|
check-cast p1, Landroidx/work/WorkRequest;
|
|
|
|
invoke-virtual {p2, p1}, Landroidx/work/WorkManager;->enqueue(Landroidx/work/WorkRequest;)Landroidx/work/Operation;
|
|
|
|
return-void
|
|
|
|
:cond_3
|
|
:goto_1
|
|
sget-object p2, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-virtual {p2, v0, v1, p1}, Lcom/discord/utilities/fcm/NotificationClient;->clear(JLandroid/content/Context;)V
|
|
|
|
:cond_4
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final enqueue(Landroid/content/Context;Landroid/content/Intent;)V
|
|
.locals 5
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "intent"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getData()Landroid/net/Uri;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
invoke-virtual {v0}, Landroid/net/Uri;->getAuthority()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
move-object v2, v1
|
|
|
|
:goto_0
|
|
const-string v3, "action"
|
|
|
|
invoke-static {v2, v3}, Lkotlin/jvm/internal/k;->n(Ljava/lang/Object;Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_1
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
move-object v0, v1
|
|
|
|
:goto_1
|
|
if-nez v0, :cond_2
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
invoke-virtual {v0}, Landroid/net/Uri;->getPath()Ljava/lang/String;
|
|
|
|
move-result-object v2
|
|
|
|
if-nez v2, :cond_3
|
|
|
|
goto :goto_2
|
|
|
|
:cond_3
|
|
invoke-virtual {v2}, Ljava/lang/String;->hashCode()I
|
|
|
|
move-result v3
|
|
|
|
const v4, -0x22a784ed
|
|
|
|
if-eq v3, v4, :cond_5
|
|
|
|
const p1, 0x3581d6f2
|
|
|
|
if-eq v3, p1, :cond_4
|
|
|
|
goto :goto_2
|
|
|
|
:cond_4
|
|
const-string p1, "/message/ack"
|
|
|
|
invoke-virtual {v2, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_6
|
|
|
|
invoke-direct {p0, p2}, Lcom/discord/utilities/fcm/NotificationActions;->enqueueAckMessage(Landroid/content/Intent;)V
|
|
|
|
return-void
|
|
|
|
:cond_5
|
|
const-string v3, "/message/reply"
|
|
|
|
invoke-virtual {v2, v3}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_6
|
|
|
|
invoke-direct {p0, p1, p2}, Lcom/discord/utilities/fcm/NotificationActions;->enqueueDirectReply(Landroid/content/Context;Landroid/content/Intent;)V
|
|
|
|
return-void
|
|
|
|
:cond_6
|
|
:goto_2
|
|
sget-object p1, Lcom/discord/app/AppLog;->sU:Lcom/discord/app/AppLog;
|
|
|
|
new-instance p2, Ljava/lang/StringBuilder;
|
|
|
|
const-string v2, "Unknown work action "
|
|
|
|
invoke-direct {p2, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V
|
|
|
|
invoke-virtual {v0}, Landroid/net/Uri;->getPath()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
|
|
|
|
const/4 v0, 0x2
|
|
|
|
invoke-static {p1, p2, v1, v0, v1}, Lcom/discord/utilities/logging/Logger;->w$default(Lcom/discord/utilities/logging/Logger;Ljava/lang/String;Ljava/lang/Throwable;ILjava/lang/Object;)V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public final onReceive(Landroid/content/Context;Landroid/content/Intent;)V
|
|
.locals 3
|
|
|
|
const-string v0, "context"
|
|
|
|
invoke-static {p1, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
const-string v0, "intent"
|
|
|
|
invoke-static {p2, v0}, Lkotlin/jvm/internal/k;->h(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Got notification action: "
|
|
|
|
invoke-virtual {v1, 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
|
|
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-nez v0, :cond_0
|
|
|
|
return-void
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
|
|
|
|
move-result v1
|
|
|
|
const v2, -0x5f5bfd47
|
|
|
|
if-eq v1, v2, :cond_4
|
|
|
|
const v2, -0x50851c66
|
|
|
|
if-eq v1, v2, :cond_2
|
|
|
|
const v2, -0x19ac103
|
|
|
|
if-eq v1, v2, :cond_1
|
|
|
|
goto :goto_0
|
|
|
|
:cond_1
|
|
const-string v1, "com.discord.intent.action.ENQUEUE_WORK"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-virtual {p0, p1, p2}, Lcom/discord/utilities/fcm/NotificationActions;->enqueue(Landroid/content/Context;Landroid/content/Intent;)V
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string v1, "com.discord.intent.action.NOTIFICATION_DELETED"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Got notification deleted: "
|
|
|
|
invoke-virtual {v1, 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
|
|
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_3
|
|
|
|
const-string v0, "com.discord.NOTIFICATION_DELETED_CHANNEL_ID"
|
|
|
|
invoke-virtual {p2, v0}, Landroid/os/Bundle;->getLong(Ljava/lang/String;)J
|
|
|
|
move-result-wide v0
|
|
|
|
sget-object p2, Lcom/discord/utilities/fcm/NotificationClient;->INSTANCE:Lcom/discord/utilities/fcm/NotificationClient;
|
|
|
|
invoke-virtual {p2, v0, v1, p1}, Lcom/discord/utilities/fcm/NotificationClient;->clear(JLandroid/content/Context;)V
|
|
|
|
:cond_3
|
|
return-void
|
|
|
|
:cond_4
|
|
const-string v1, "com.discord.intent.action.NOTIFICATION_CANCEL"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_5
|
|
|
|
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "Got notification cancel: "
|
|
|
|
invoke-virtual {v1, 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
|
|
|
|
invoke-virtual {p2}, Landroid/content/Intent;->getExtras()Landroid/os/Bundle;
|
|
|
|
move-result-object p2
|
|
|
|
if-eqz p2, :cond_5
|
|
|
|
const-string v0, "com.discord.NOTIFICATION_ID"
|
|
|
|
invoke-virtual {p2, v0}, Landroid/os/Bundle;->getInt(Ljava/lang/String;)I
|
|
|
|
move-result p2
|
|
|
|
invoke-static {p1}, Landroidx/core/app/NotificationManagerCompat;->from(Landroid/content/Context;)Landroidx/core/app/NotificationManagerCompat;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1, p2}, Landroidx/core/app/NotificationManagerCompat;->cancel(I)V
|
|
|
|
nop
|
|
|
|
:cond_5
|
|
:goto_0
|
|
return-void
|
|
.end method
|