359 lines
11 KiB
Smali
359 lines
11 KiB
Smali
.class public final Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;
|
|
.super Ljava/lang/Object;
|
|
.source "VoiceEngineForegroundService.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
value = Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
.end annotation
|
|
|
|
.annotation system Ldalvik/annotation/InnerClass;
|
|
accessFlags = 0x19
|
|
name = "NotificationBuilder"
|
|
.end annotation
|
|
|
|
|
|
# instance fields
|
|
.field public final actions:Ljava/util/List;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/util/List<",
|
|
"Landroidx/core/app/NotificationCompat$Action;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public final contentText:Ljava/lang/String;
|
|
|
|
.field public final contentTitle:Ljava/lang/String;
|
|
|
|
.field public final context:Landroid/content/Context;
|
|
|
|
|
|
# direct methods
|
|
.method public constructor <init>(Landroid/content/Intent;Landroid/content/Context;)V
|
|
.locals 10
|
|
|
|
const/4 v0, 0x0
|
|
|
|
if-eqz p1, :cond_3
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
|
|
|
|
iput-object p2, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->context:Landroid/content/Context;
|
|
|
|
const-string v0, "com.discord.utilities.voice.extra.title"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->contentTitle:Ljava/lang/String;
|
|
|
|
const-string v0, "com.discord.utilities.voice.extra.title_subtext"
|
|
|
|
invoke-virtual {p1, v0}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->contentText:Ljava/lang/String;
|
|
|
|
const-string v0, "com.discord.utilities.voice.extra.item_muted"
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-virtual {p1, v0, v1}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result v0
|
|
|
|
const-string v2, "com.discord.utilities.voice.extra.item_deafened"
|
|
|
|
invoke-virtual {p1, v2, v1}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result p1
|
|
|
|
new-instance v2, Landroid/content/Intent;
|
|
|
|
const-class v3, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v2, p2, v3}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v3, "com.discord.utilities.voice.action.disconnect"
|
|
|
|
invoke-virtual {v2, v3}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-static {p2, v1, v2, v1}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object v2
|
|
|
|
new-instance v3, Landroid/content/Intent;
|
|
|
|
const-class v4, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v3, p2, v4}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v4, "com.discord.utilities.voice.action.toggle_deafened"
|
|
|
|
invoke-virtual {v3, v4}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object v3
|
|
|
|
invoke-static {p2, v1, v3, v1}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object v3
|
|
|
|
new-instance v4, Landroid/content/Intent;
|
|
|
|
const-class v5, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-direct {v4, p2, v5}, Landroid/content/Intent;-><init>(Landroid/content/Context;Ljava/lang/Class;)V
|
|
|
|
const-string v5, "com.discord.utilities.voice.action.toggle_muted"
|
|
|
|
invoke-virtual {v4, v5}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
move-result-object v4
|
|
|
|
invoke-static {p2, v1, v4, v1}, Landroid/app/PendingIntent;->getService(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object v4
|
|
|
|
const/4 v5, 0x3
|
|
|
|
new-array v5, v5, [Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
new-instance v6, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
const v7, 0x7f08025b
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v8
|
|
|
|
const v9, 0x7f1205a7
|
|
|
|
invoke-virtual {v8, v9}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v8
|
|
|
|
invoke-direct {v6, v7, v8, v2}, Landroidx/core/app/NotificationCompat$Action;-><init>(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)V
|
|
|
|
aput-object v6, v5, v1
|
|
|
|
const/4 v1, 0x1
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
new-instance v0, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
const v2, 0x7f080366
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v6
|
|
|
|
const v7, 0x7f121641
|
|
|
|
invoke-virtual {v6, v7}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-direct {v0, v2, v6, v4}, Landroidx/core/app/NotificationCompat$Action;-><init>(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
new-instance v0, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
const v2, 0x7f080365
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object v6
|
|
|
|
const v7, 0x7f120f1b
|
|
|
|
invoke-virtual {v6, v7}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object v6
|
|
|
|
invoke-direct {v0, v2, v6, v4}, Landroidx/core/app/NotificationCompat$Action;-><init>(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)V
|
|
|
|
:goto_0
|
|
aput-object v0, v5, v1
|
|
|
|
const/4 v0, 0x2
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
new-instance p1, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
const v1, 0x7f080325
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p2
|
|
|
|
const v2, 0x7f121637
|
|
|
|
invoke-virtual {p2, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, v1, p2, v3}, Landroidx/core/app/NotificationCompat$Action;-><init>(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)V
|
|
|
|
goto :goto_1
|
|
|
|
:cond_1
|
|
new-instance p1, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
const v1, 0x7f080324
|
|
|
|
invoke-virtual {p2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
|
|
|
|
move-result-object p2
|
|
|
|
const v2, 0x7f12055a
|
|
|
|
invoke-virtual {p2, v2}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;
|
|
|
|
move-result-object p2
|
|
|
|
invoke-direct {p1, v1, p2, v3}, Landroidx/core/app/NotificationCompat$Action;-><init>(ILjava/lang/CharSequence;Landroid/app/PendingIntent;)V
|
|
|
|
:goto_1
|
|
aput-object p1, v5, v0
|
|
|
|
invoke-static {v5}, Lf/n/a/k/a;->listOf([Ljava/lang/Object;)Ljava/util/List;
|
|
|
|
move-result-object p1
|
|
|
|
iput-object p1, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->actions:Ljava/util/List;
|
|
|
|
return-void
|
|
|
|
:cond_2
|
|
const-string p1, "context"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
|
|
:cond_3
|
|
const-string p1, "intent"
|
|
|
|
invoke-static {p1}, Lj0/n/c/h;->c(Ljava/lang/String;)V
|
|
|
|
throw v0
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public final build()Landroid/app/Notification;
|
|
.locals 4
|
|
|
|
new-instance v0, Landroid/content/Intent;
|
|
|
|
invoke-direct {v0}, Landroid/content/Intent;-><init>()V
|
|
|
|
iget-object v1, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->context:Landroid/content/Context;
|
|
|
|
invoke-static {}, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->access$getOnNotificationClass$cp()Ljava/lang/Class;
|
|
|
|
move-result-object v2
|
|
|
|
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->setClass(Landroid/content/Context;Ljava/lang/Class;)Landroid/content/Intent;
|
|
|
|
const-string v1, "com.discord.utilities.voice.action.main"
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setAction(Ljava/lang/String;)Landroid/content/Intent;
|
|
|
|
const v1, 0x10008000
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
|
|
|
|
iget-object v1, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->context:Landroid/content/Context;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
invoke-static {v1, v2, v0, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
|
|
|
|
move-result-object v0
|
|
|
|
new-instance v1, Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
iget-object v2, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->context:Landroid/content/Context;
|
|
|
|
const-string v3, "Media Connections"
|
|
|
|
invoke-direct {v1, v2, v3}, Landroidx/core/app/NotificationCompat$Builder;-><init>(Landroid/content/Context;Ljava/lang/String;)V
|
|
|
|
iget-object v2, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->contentTitle:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/core/app/NotificationCompat$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
move-result-object v1
|
|
|
|
iget-object v2, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->contentText:Ljava/lang/String;
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/core/app/NotificationCompat$Builder;->setContentText(Ljava/lang/CharSequence;)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
move-result-object v1
|
|
|
|
const v2, 0x7f080384
|
|
|
|
invoke-virtual {v1, v2}, Landroidx/core/app/NotificationCompat$Builder;->setSmallIcon(I)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {v1, v0}, Landroidx/core/app/NotificationCompat$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
const/4 v1, 0x1
|
|
|
|
invoke-virtual {v0, v1}, Landroidx/core/app/NotificationCompat$Builder;->setOngoing(Z)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
move-result-object v0
|
|
|
|
iget-object v1, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->actions:Ljava/util/List;
|
|
|
|
invoke-interface {v1}, Ljava/util/List;->iterator()Ljava/util/Iterator;
|
|
|
|
move-result-object v1
|
|
|
|
:goto_0
|
|
invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z
|
|
|
|
move-result v2
|
|
|
|
if-eqz v2, :cond_0
|
|
|
|
invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;
|
|
|
|
move-result-object v2
|
|
|
|
check-cast v2, Landroidx/core/app/NotificationCompat$Action;
|
|
|
|
invoke-virtual {v0, v2}, Landroidx/core/app/NotificationCompat$Builder;->addAction(Landroidx/core/app/NotificationCompat$Action;)Landroidx/core/app/NotificationCompat$Builder;
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-virtual {v0}, Landroidx/core/app/NotificationCompat$Builder;->build()Landroid/app/Notification;
|
|
|
|
move-result-object v0
|
|
|
|
const-string v1, "builder.build()"
|
|
|
|
invoke-static {v0, v1}, Lj0/n/c/h;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
return-object v0
|
|
.end method
|