479 lines
15 KiB
Smali
479 lines
15 KiB
Smali
.class public final Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
.super Landroid/app/IntentService;
|
|
.source "VoiceEngineForegroundService.kt"
|
|
|
|
|
|
# annotations
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
value = {
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$Constants;,
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$Actions;,
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$Connection;,
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;,
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$LocalBinder;,
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;,
|
|
Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion;
|
|
}
|
|
.end annotation
|
|
|
|
|
|
# static fields
|
|
.field public static final synthetic $$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
.field public static final Companion:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion;
|
|
|
|
.field public static final LOG_TAG:Ljava/lang/String; = "DiscordVoiceService"
|
|
|
|
.field public static onDisconnect:Lkotlin/jvm/functions/Function0;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static final onNotificationClass:Ljava/lang/Class;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Ljava/lang/Class<",
|
|
"Lcom/discord/app/AppActivity$Main;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static onToggleSelfDeafen:Lkotlin/jvm/functions/Function0;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
.field public static onToggleSelfMute:Lkotlin/jvm/functions/Function0;
|
|
.annotation system Ldalvik/annotation/Signature;
|
|
value = {
|
|
"Lkotlin/jvm/functions/Function0<",
|
|
"Lkotlin/Unit;",
|
|
">;"
|
|
}
|
|
.end annotation
|
|
.end field
|
|
|
|
|
|
# instance fields
|
|
.field public final binder:Lcom/discord/utilities/voice/VoiceEngineForegroundService$LocalBinder;
|
|
|
|
.field public final wakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
|
|
# direct methods
|
|
.method public static constructor <clinit>()V
|
|
.locals 5
|
|
|
|
const/4 v0, 0x1
|
|
|
|
new-array v0, v0, [Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v1, Lx/u/b/u;
|
|
|
|
const-class v2, Lcom/discord/utilities/voice/VoiceEngineForegroundService;
|
|
|
|
invoke-static {v2}, Lx/u/b/w;->getOrCreateKotlinClass(Ljava/lang/Class;)Lx/y/b;
|
|
|
|
move-result-object v2
|
|
|
|
const-string v3, "wakeLock"
|
|
|
|
const-string v4, "getWakeLock()Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;"
|
|
|
|
invoke-direct {v1, v2, v3, v4}, Lx/u/b/u;-><init>(Lkotlin/reflect/KDeclarationContainer;Ljava/lang/String;Ljava/lang/String;)V
|
|
|
|
sget-object v2, Lx/u/b/w;->a:Lx/u/b/x;
|
|
|
|
invoke-virtual {v2, v1}, Lx/u/b/x;->property1(Lx/u/b/t;)Lx/y/d;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aput-object v1, v0, v2
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
new-instance v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion;
|
|
|
|
const/4 v1, 0x0
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->Companion:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion;
|
|
|
|
const-class v0, Lcom/discord/app/AppActivity$Main;
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onNotificationClass:Ljava/lang/Class;
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion$onDisconnect$1;->INSTANCE:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion$onDisconnect$1;
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onDisconnect:Lkotlin/jvm/functions/Function0;
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion$onToggleSelfDeafen$1;->INSTANCE:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion$onToggleSelfDeafen$1;
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfDeafen:Lkotlin/jvm/functions/Function0;
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion$onToggleSelfMute$1;->INSTANCE:Lcom/discord/utilities/voice/VoiceEngineForegroundService$Companion$onToggleSelfMute$1;
|
|
|
|
sput-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfMute:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public constructor <init>()V
|
|
.locals 1
|
|
|
|
const-string v0, "VoiceEngineForegroundService"
|
|
|
|
invoke-direct {p0, v0}, Landroid/app/IntentService;-><init>(Ljava/lang/String;)V
|
|
|
|
new-instance v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$LocalBinder;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$LocalBinder;-><init>(Lcom/discord/utilities/voice/VoiceEngineForegroundService;)V
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->binder:Lcom/discord/utilities/voice/VoiceEngineForegroundService$LocalBinder;
|
|
|
|
new-instance v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$wakeLock$2;
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$wakeLock$2;-><init>(Lcom/discord/utilities/voice/VoiceEngineForegroundService;)V
|
|
|
|
invoke-static {v0}, Le/o/a/j/a;->lazy(Lkotlin/jvm/functions/Function0;)Lkotlin/Lazy;
|
|
|
|
move-result-object v0
|
|
|
|
iput-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->wakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnDisconnect$cp()Lkotlin/jvm/functions/Function0;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onDisconnect:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnNotificationClass$cp()Ljava/lang/Class;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onNotificationClass:Ljava/lang/Class;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnToggleSelfDeafen$cp()Lkotlin/jvm/functions/Function0;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfDeafen:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$getOnToggleSelfMute$cp()Lkotlin/jvm/functions/Function0;
|
|
.locals 1
|
|
|
|
sget-object v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfMute:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method public static final synthetic access$setOnDisconnect$cp(Lkotlin/jvm/functions/Function0;)V
|
|
.locals 0
|
|
|
|
sput-object p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onDisconnect:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setOnToggleSelfDeafen$cp(Lkotlin/jvm/functions/Function0;)V
|
|
.locals 0
|
|
|
|
sput-object p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfDeafen:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public static final synthetic access$setOnToggleSelfMute$cp(Lkotlin/jvm/functions/Function0;)V
|
|
.locals 0
|
|
|
|
sput-object p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfMute:Lkotlin/jvm/functions/Function0;
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method private final getWakeLock()Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
.locals 3
|
|
|
|
iget-object v0, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->wakeLock$delegate:Lkotlin/Lazy;
|
|
|
|
sget-object v1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->$$delegatedProperties:[Lkotlin/reflect/KProperty;
|
|
|
|
const/4 v2, 0x0
|
|
|
|
aget-object v1, v1, v2
|
|
|
|
invoke-interface {v0}, Lkotlin/Lazy;->getValue()Ljava/lang/Object;
|
|
|
|
move-result-object v0
|
|
|
|
check-cast v0, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
return-object v0
|
|
.end method
|
|
|
|
.method private final setProximityLock(Z)V
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->getWakeLock()Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->acquireProximityLock()V
|
|
|
|
goto :goto_0
|
|
|
|
:cond_0
|
|
invoke-direct {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->getWakeLock()Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
move-result-object p1
|
|
|
|
invoke-virtual {p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->releaseProximityLock()V
|
|
|
|
:goto_0
|
|
return-void
|
|
.end method
|
|
|
|
|
|
# virtual methods
|
|
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
|
|
.locals 0
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
iget-object p1, p0, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->binder:Lcom/discord/utilities/voice/VoiceEngineForegroundService$LocalBinder;
|
|
|
|
return-object p1
|
|
|
|
:cond_0
|
|
const-string p1, "intent"
|
|
|
|
invoke-static {p1}, Lx/u/b/j;->a(Ljava/lang/String;)V
|
|
|
|
const/4 p1, 0x0
|
|
|
|
throw p1
|
|
.end method
|
|
|
|
.method public onCreate()V
|
|
.locals 2
|
|
|
|
invoke-super {p0}, Landroid/app/IntentService;->onCreate()V
|
|
|
|
const-string v0, "DiscordVoiceService"
|
|
|
|
const-string v1, "Service created."
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
sget-object v0, Le/a/b/i;->c:Le/a/b/i;
|
|
|
|
invoke-virtual {v0, p0}, Le/a/b/i;->a(Ljava/lang/Object;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->getWakeLock()Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->acquire()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onDestroy()V
|
|
.locals 2
|
|
|
|
invoke-super {p0}, Landroid/app/IntentService;->onDestroy()V
|
|
|
|
const-string v0, "DiscordVoiceService"
|
|
|
|
const-string v1, "Service destroyed."
|
|
|
|
invoke-static {v0, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
sget-object v0, Le/a/b/i;->c:Le/a/b/i;
|
|
|
|
invoke-virtual {v0, p0}, Le/a/b/i;->b(Ljava/lang/Object;)V
|
|
|
|
invoke-direct {p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->getWakeLock()Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;
|
|
|
|
move-result-object v0
|
|
|
|
invoke-virtual {v0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$WakeLock;->release()V
|
|
|
|
return-void
|
|
.end method
|
|
|
|
.method public onHandleIntent(Landroid/content/Intent;)V
|
|
.locals 3
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p1}, Landroid/content/Intent;->getAction()Ljava/lang/String;
|
|
|
|
move-result-object v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const-string v1, "intent?.action ?: return"
|
|
|
|
invoke-static {v0, v1}, Lx/u/b/j;->checkExpressionValueIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V
|
|
|
|
new-instance v1, Ljava/lang/StringBuilder;
|
|
|
|
invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V
|
|
|
|
const-string v2, "Received action: "
|
|
|
|
invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
|
|
|
|
invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
|
|
|
|
move-result-object v1
|
|
|
|
const-string v2, "DiscordVoiceService"
|
|
|
|
invoke-static {v2, v1}, Landroid/util/Log;->v(Ljava/lang/String;Ljava/lang/String;)I
|
|
|
|
invoke-virtual {v0}, Ljava/lang/String;->hashCode()I
|
|
|
|
move-result v1
|
|
|
|
const/4 v2, 0x1
|
|
|
|
sparse-switch v1, :sswitch_data_0
|
|
|
|
goto :goto_0
|
|
|
|
:sswitch_0
|
|
const-string p1, "com.discord.utilities.voice.action.toggle_muted"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfMute:Lkotlin/jvm/functions/Function0;
|
|
|
|
invoke-interface {p1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
|
|
|
|
goto :goto_0
|
|
|
|
:sswitch_1
|
|
const-string v1, "com.discord.utilities.voice.action.start_foreground"
|
|
|
|
invoke-virtual {v0, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result v0
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
const/16 v0, 0x65
|
|
|
|
new-instance v1, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;
|
|
|
|
invoke-direct {v1, p1, p0}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;-><init>(Landroid/content/Intent;Landroid/content/Context;)V
|
|
|
|
invoke-virtual {v1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService$NotificationBuilder;->build()Landroid/app/Notification;
|
|
|
|
move-result-object v1
|
|
|
|
invoke-virtual {p0, v0, v1}, Landroid/app/IntentService;->startForeground(ILandroid/app/Notification;)V
|
|
|
|
const/4 v0, 0x0
|
|
|
|
const-string v1, "com.discord.utilities.voice.extra.proximity_lock_enabled"
|
|
|
|
invoke-virtual {p1, v1, v0}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
|
|
|
|
move-result p1
|
|
|
|
invoke-direct {p0, p1}, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->setProximityLock(Z)V
|
|
|
|
goto :goto_0
|
|
|
|
:sswitch_2
|
|
const-string p1, "com.discord.utilities.voice.action.disconnect"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onDisconnect:Lkotlin/jvm/functions/Function0;
|
|
|
|
invoke-interface {p1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
|
|
|
|
invoke-virtual {p0, v2}, Landroid/app/IntentService;->stopForeground(Z)V
|
|
|
|
invoke-virtual {p0}, Landroid/app/IntentService;->stopSelf()V
|
|
|
|
goto :goto_0
|
|
|
|
:sswitch_3
|
|
const-string p1, "com.discord.utilities.voice.action.stop"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
invoke-virtual {p0, v2}, Landroid/app/IntentService;->stopForeground(Z)V
|
|
|
|
invoke-virtual {p0}, Landroid/app/IntentService;->stopSelf()V
|
|
|
|
goto :goto_0
|
|
|
|
:sswitch_4
|
|
const-string p1, "com.discord.utilities.voice.action.toggle_deafened"
|
|
|
|
invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
|
|
|
|
move-result p1
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
sget-object p1, Lcom/discord/utilities/voice/VoiceEngineForegroundService;->onToggleSelfDeafen:Lkotlin/jvm/functions/Function0;
|
|
|
|
invoke-interface {p1}, Lkotlin/jvm/functions/Function0;->invoke()Ljava/lang/Object;
|
|
|
|
:cond_0
|
|
:goto_0
|
|
return-void
|
|
|
|
:sswitch_data_0
|
|
.sparse-switch
|
|
-0x78b14b10 -> :sswitch_4
|
|
-0x593bf795 -> :sswitch_3
|
|
-0x29e659bb -> :sswitch_2
|
|
0x20467429 -> :sswitch_1
|
|
0x5f84c829 -> :sswitch_0
|
|
.end sparse-switch
|
|
.end method
|