2020-11-12 02:11:44 +00:00
|
|
|
.class public abstract Lcom/discord/overlay/OverlayService;
|
|
|
|
.super Landroid/app/Service;
|
|
|
|
.source "OverlayService.kt"
|
|
|
|
|
|
|
|
|
|
|
|
# annotations
|
|
|
|
.annotation system Ldalvik/annotation/MemberClasses;
|
|
|
|
value = {
|
|
|
|
Lcom/discord/overlay/OverlayService$Companion;
|
|
|
|
}
|
|
|
|
.end annotation
|
|
|
|
|
|
|
|
|
|
|
|
# static fields
|
|
|
|
.field public static final Companion:Lcom/discord/overlay/OverlayService$Companion;
|
|
|
|
|
|
|
|
.field public static final NOTIFICATION_ID:I = 0x16e2
|
|
|
|
|
|
|
|
|
|
|
|
# instance fields
|
|
|
|
.field public overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
|
|
|
|
|
|
|
# direct methods
|
|
|
|
.method public static constructor <clinit>()V
|
|
|
|
.locals 2
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/overlay/OverlayService$Companion;
|
|
|
|
|
|
|
|
const/4 v1, 0x0
|
|
|
|
|
|
|
|
invoke-direct {v0, v1}, Lcom/discord/overlay/OverlayService$Companion;-><init>(Lkotlin/jvm/internal/DefaultConstructorMarker;)V
|
|
|
|
|
|
|
|
sput-object v0, Lcom/discord/overlay/OverlayService;->Companion:Lcom/discord/overlay/OverlayService$Companion;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public constructor <init>()V
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
invoke-direct {p0}, Landroid/app/Service;-><init>()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method private final attachBubbleToWindow(Landroid/content/Intent;)Z
|
|
|
|
.locals 4
|
|
|
|
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/overlay/OverlayService;->createOverlayBubble(Landroid/content/Intent;)Lcom/discord/overlay/views/OverlayBubbleWrap;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-eqz p1, :cond_4
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
const/4 v1, 0x0
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
const-string v2, "overlayManager"
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-eqz v0, :cond_3
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
invoke-virtual {v0, p1}, Lcom/discord/overlay/OverlayManager;->a(Lcom/discord/overlay/views/OverlayBubbleWrap;)V
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/overlay/OverlayService$a;
|
|
|
|
|
|
|
|
invoke-direct {v0, p0, p1}, Lcom/discord/overlay/OverlayService$a;-><init>(Lcom/discord/overlay/OverlayService;Lcom/discord/overlay/views/OverlayBubbleWrap;)V
|
|
|
|
|
|
|
|
invoke-virtual {p1, v0}, Landroid/widget/FrameLayout;->post(Ljava/lang/Runnable;)Z
|
|
|
|
|
|
|
|
iget-object p1, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-eqz p1, :cond_2
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
iget-object p1, p1, Lcom/discord/overlay/OverlayManager;->i:Lf/a/e/f/a;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
if-nez p1, :cond_1
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
new-instance p1, Lf/a/e/f/a;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/app/Service;->getApplicationContext()Landroid/content/Context;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string v3, "applicationContext"
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {v0, v3}, Ly/m/c/j;->checkNotNullExpressionValue(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-direct {p1, v0}, Lf/a/e/f/a;-><init>(Landroid/content/Context;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
if-eqz v0, :cond_0
|
2020-11-14 03:19:56 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {v0}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;)Ljava/lang/Object;
|
|
|
|
|
2020-11-12 02:11:44 +00:00
|
|
|
const-string/jumbo v1, "trashWrap"
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {p1, v1}, Ly/m/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
iput-object p1, v0, Lcom/discord/overlay/OverlayManager;->i:Lf/a/e/f/a;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
iget-object v0, v0, Lcom/discord/overlay/OverlayManager;->m:Landroid/view/WindowManager;
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-virtual {p1}, Lf/a/e/f/a;->getWindowLayoutParams()Landroid/view/WindowManager$LayoutParams;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
move-result-object v1
|
|
|
|
|
|
|
|
invoke-interface {v0, p1, v1}, Landroid/view/WindowManager;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {v2}, Ly/m/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
throw v1
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_1
|
2020-11-16 01:00:50 +00:00
|
|
|
:goto_0
|
|
|
|
const/4 p1, 0x1
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 01:00:50 +00:00
|
|
|
return p1
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_2
|
|
|
|
invoke-static {v2}, Ly/m/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-11-14 02:19:59 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
throw v1
|
2020-11-14 02:19:59 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_3
|
|
|
|
invoke-static {v2}, Ly/m/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
throw v1
|
2020-11-16 01:00:50 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
:cond_4
|
2020-11-12 02:11:44 +00:00
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
return p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
|
|
|
|
# virtual methods
|
|
|
|
.method public abstract createNotification(Landroid/content/Intent;)Landroid/app/Notification;
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public abstract createOverlayBubble(Landroid/content/Intent;)Lcom/discord/overlay/views/OverlayBubbleWrap;
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final getOverlayManager()Lcom/discord/overlay/OverlayManager;
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
return-object v0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string v0, "overlayManager"
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {v0}, Ly/m/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onBind(Landroid/content/Intent;)Landroid/os/IBinder;
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
const/4 p1, 0x0
|
|
|
|
|
|
|
|
return-object p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onCreate()V
|
|
|
|
.locals 3
|
|
|
|
|
|
|
|
invoke-super {p0}, Landroid/app/Service;->onCreate()V
|
|
|
|
|
|
|
|
invoke-virtual {p0}, Landroid/app/Service;->getApplicationContext()Landroid/content/Context;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
|
|
|
const-string/jumbo v1, "window"
|
|
|
|
|
|
|
|
invoke-virtual {v0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
|
|
|
|
|
|
|
|
move-result-object v0
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
const-string v1, "null cannot be cast to non-null type android.view.WindowManager"
|
|
|
|
|
|
|
|
invoke-static {v0, v1}, Ljava/util/Objects;->requireNonNull(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
check-cast v0, Landroid/view/WindowManager;
|
|
|
|
|
|
|
|
new-instance v1, Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
|
|
|
invoke-direct {v1, v0}, Lcom/discord/overlay/OverlayManager;-><init>(Landroid/view/WindowManager;)V
|
|
|
|
|
|
|
|
iput-object v1, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
|
|
|
new-instance v0, Lcom/discord/overlay/OverlayService$b;
|
|
|
|
|
|
|
|
invoke-direct {v0, p0}, Lcom/discord/overlay/OverlayService$b;-><init>(Lcom/discord/overlay/OverlayService;)V
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
iput-object v0, v1, Lcom/discord/overlay/OverlayManager;->j:Lf/a/e/e;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
new-instance v0, Lcom/discord/overlay/OverlayService$c;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-direct {v0, p0}, Lcom/discord/overlay/OverlayService$c;-><init>(Lcom/discord/overlay/OverlayService;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
const-string v2, "<set-?>"
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {v0, v2}, Ly/m/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
iput-object v0, v1, Lcom/discord/overlay/OverlayManager;->h:Lkotlin/jvm/functions/Function1;
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onDestroy()V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
iget-object v0, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
|
|
|
if-eqz v0, :cond_0
|
|
|
|
|
|
|
|
invoke-virtual {v0}, Lcom/discord/overlay/OverlayManager;->close()V
|
|
|
|
|
|
|
|
invoke-super {p0}, Landroid/app/Service;->onDestroy()V
|
|
|
|
|
|
|
|
return-void
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
const-string v0, "overlayManager"
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {v0}, Ly/m/c/j;->throwUninitializedPropertyAccessException(Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
const/4 v0, 0x0
|
|
|
|
|
|
|
|
throw v0
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public onStartCommand(Landroid/content/Intent;II)I
|
|
|
|
.locals 0
|
|
|
|
|
|
|
|
if-eqz p1, :cond_0
|
|
|
|
|
|
|
|
move-object p2, p1
|
|
|
|
|
|
|
|
goto :goto_0
|
|
|
|
|
|
|
|
:cond_0
|
|
|
|
new-instance p2, Landroid/content/Intent;
|
|
|
|
|
|
|
|
invoke-direct {p2}, Landroid/content/Intent;-><init>()V
|
|
|
|
|
|
|
|
:goto_0
|
|
|
|
invoke-direct {p0, p2}, Lcom/discord/overlay/OverlayService;->attachBubbleToWindow(Landroid/content/Intent;)Z
|
|
|
|
|
|
|
|
move-result p2
|
|
|
|
|
|
|
|
if-eqz p2, :cond_2
|
|
|
|
|
|
|
|
if-eqz p1, :cond_1
|
|
|
|
|
|
|
|
goto :goto_1
|
|
|
|
|
|
|
|
:cond_1
|
|
|
|
new-instance p1, Landroid/content/Intent;
|
|
|
|
|
|
|
|
invoke-direct {p1}, Landroid/content/Intent;-><init>()V
|
|
|
|
|
|
|
|
:goto_1
|
|
|
|
invoke-virtual {p0, p1}, Lcom/discord/overlay/OverlayService;->createNotification(Landroid/content/Intent;)Landroid/app/Notification;
|
|
|
|
|
|
|
|
move-result-object p1
|
|
|
|
|
|
|
|
const/16 p2, 0x16e2
|
|
|
|
|
|
|
|
invoke-virtual {p0, p2, p1}, Landroid/app/Service;->startForeground(ILandroid/app/Notification;)V
|
|
|
|
|
|
|
|
:cond_2
|
|
|
|
const/4 p1, 0x3
|
|
|
|
|
|
|
|
return p1
|
|
|
|
.end method
|
|
|
|
|
|
|
|
.method public final setOverlayManager(Lcom/discord/overlay/OverlayManager;)V
|
|
|
|
.locals 1
|
|
|
|
|
|
|
|
const-string v0, "<set-?>"
|
|
|
|
|
2020-11-16 22:05:17 +00:00
|
|
|
invoke-static {p1, v0}, Ly/m/c/j;->checkNotNullParameter(Ljava/lang/Object;Ljava/lang/String;)V
|
2020-11-12 02:11:44 +00:00
|
|
|
|
|
|
|
iput-object p1, p0, Lcom/discord/overlay/OverlayService;->overlayManager:Lcom/discord/overlay/OverlayManager;
|
|
|
|
|
|
|
|
return-void
|
|
|
|
.end method
|