From 2f6799663c85731d9d5204f5c262695f6f877163 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?YuSaki=E4=B8=B6Kanade?=
<53483352+Nep-Timeline@users.noreply.github.com>
Date: Mon, 9 Dec 2024 14:11:20 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A7=A3=E9=94=81=E9=80=9A=E7=9F=A5?=
=?UTF-8?q?=E9=99=90=E5=88=B6=20(#1030)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* feat: systemui - lockscreen - Unlock Notification Restrict
允许所有通知在锁屏页显示
* opt: desc
---
.../module/app/SystemUI/Phone/SystemUiV.java | 2 ++
.../lockscreen/NotificationShowOnKeyguard.kt | 32 +++++++++++++++++++
app/src/main/res/values-zh-rCN/strings.xml | 2 ++
app/src/main/res/values-zh-rHK/strings.xml | 2 ++
app/src/main/res/values-zh-rTW/strings.xml | 2 ++
app/src/main/res/values/strings.xml | 2 ++
.../main/res/xml/system_ui_lock_screen.xml | 6 ++++
7 files changed, 48 insertions(+)
create mode 100644 app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/NotificationShowOnKeyguard.kt
diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java
index b785bb81b6..922611d0ed 100644
--- a/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java
+++ b/app/src/main/java/com/sevtinge/hyperceiler/module/app/SystemUI/Phone/SystemUiV.java
@@ -89,6 +89,7 @@
import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.LinkageAnimCustomer;
import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.LockScreenDoubleTapToSleep;
import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.NoPassword;
+import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.NotificationShowOnKeyguard;
import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.RemoveCamera;
import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.RemoveSmartScreen;
import com.sevtinge.hyperceiler.module.hook.systemui.lockscreen.ScramblePIN;
@@ -294,6 +295,7 @@ public void handleLoadPackage() {
initHook(NoPassword.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_password_free"));
initHook(LockScreenDoubleTapToSleep.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_double_lock"));
initHook(ForceClockUseSystemFontsHook.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_force_system_fonts"));
+ initHook(NotificationShowOnKeyguard.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_unlock_notification_restrict"));
initHook(HideLockscreenZenMode.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_not_disturb_mode"));
initHook(HideLockScreenHint.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_unlock_tip"));
initHook(HideLockScreenStatusBar.INSTANCE, mPrefsMap.getBoolean("system_ui_lock_screen_hide_status_bar"));
diff --git a/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/NotificationShowOnKeyguard.kt b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/NotificationShowOnKeyguard.kt
new file mode 100644
index 0000000000..e3cb586269
--- /dev/null
+++ b/app/src/main/java/com/sevtinge/hyperceiler/module/hook/systemui/lockscreen/NotificationShowOnKeyguard.kt
@@ -0,0 +1,32 @@
+/*
+ * This file is part of HyperCeiler.
+
+ * HyperCeiler is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see .
+
+ * Copyright (C) 2023-2024 HyperCeiler Contributions
+*/
+package com.sevtinge.hyperceiler.module.hook.systemui.lockscreen
+
+import com.github.kyuubiran.ezxhelper.ClassUtils.loadClass
+import com.github.kyuubiran.ezxhelper.HookFactory.`-Static`.createHook
+import com.github.kyuubiran.ezxhelper.finders.MethodFinder.`-Static`.methodFinder
+import com.sevtinge.hyperceiler.module.base.*
+
+object NotificationShowOnKeyguard : BaseHook() {
+ override fun init() {
+ loadClass("com.android.systemui.statusbar.notification.ExpandedNotification").methodFinder().filterByName("canShowOnKeyguard").first().createHook {
+ returnConstant(true)
+ }
+ }
+}
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index b66b7e832e..f59d7ca1ec 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -700,6 +700,8 @@
时钟强制使用系统字体
双击锁屏
双击空白位置锁屏
+ 解除通知限制
+ 让所有通知均可以在锁屏页显示
隐藏勿扰模式通知
隐藏屏幕底部解锁提示
锁屏时隐藏状态栏
diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml
index c5e584e93b..eed087499c 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -608,6 +608,8 @@
時鐘強制使用系統字體
雙擊鎖屏
雙擊空白位置鎖屏
+ 解除通知限制
+ 讓所有通知均可以在鎖屏頁顯示
隱藏勿擾模式通知
隱藏屏幕底部解鎖提示
鎖屏時隱藏狀態欄
diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml
index 59dd5ba252..90b9cfd249 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -588,6 +588,8 @@
時鐘強制使用系統字體
雙擊鎖定螢幕
雙擊空白處鎖定螢幕
+ 解除通知限制
+ 讓所有通知均可以在鎖屏頁顯示
隱藏勿擾模式通知
隱藏螢幕底部解鎖提示
鎖定螢幕時隱藏狀態欄
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index ccd4429947..1eb049bdbb 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -692,6 +692,8 @@
Force clock to use system fonts
Double-tap the Lock screen
Double-tap an empty location to lock the screen
+ Unlock notification restrict
+ Enable all notifications to be displayed on the lock screen
Hide DND mode notification
Hide unlock request
Remove status bar from Lock screen
diff --git a/app/src/main/res/xml/system_ui_lock_screen.xml b/app/src/main/res/xml/system_ui_lock_screen.xml
index 0b8972c2da..92f9a4b42f 100644
--- a/app/src/main/res/xml/system_ui_lock_screen.xml
+++ b/app/src/main/res/xml/system_ui_lock_screen.xml
@@ -94,6 +94,12 @@
+
+