Skip to content

Commit

Permalink
feat: 解锁通知限制 (#1030)
Browse files Browse the repository at this point in the history
* feat: systemui - lockscreen - Unlock Notification Restrict

允许所有通知在锁屏页显示

* opt: desc
  • Loading branch information
Nep-Timeline authored Dec 9, 2024
1 parent f85c9f9 commit 2f67996
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"));
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
* 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)
}
}
}
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,8 @@
<string name="system_ui_lock_screen_force_system_fonts">时钟强制使用系统字体</string>
<string name="system_ui_lock_screen_double_lock">双击锁屏</string>
<string name="system_ui_lock_screen_double_lock_desc">双击空白位置锁屏</string>
<string name="system_ui_lock_screen_unlock_notification_restrict">解除通知限制</string>
<string name="system_ui_lock_screen_unlock_notification_restrict_desc">让所有通知均可以在锁屏页显示</string>
<string name="system_ui_lock_screen_not_disturb_mode_title">隐藏勿扰模式通知</string>
<string name="system_ui_lock_screen_unlock_tip_title">隐藏屏幕底部解锁提示</string>
<string name="system_ui_lock_screen_hide_status_bar">锁屏时隐藏状态栏</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rHK/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -608,6 +608,8 @@
<string name="system_ui_lock_screen_force_system_fonts">時鐘強制使用系統字體</string>
<string name="system_ui_lock_screen_double_lock">雙擊鎖屏</string>
<string name="system_ui_lock_screen_double_lock_desc">雙擊空白位置鎖屏</string>
<string name="system_ui_lock_screen_unlock_notification_restrict">解除通知限制</string>
<string name="system_ui_lock_screen_unlock_notification_restrict_desc">讓所有通知均可以在鎖屏頁顯示</string>
<string name="system_ui_lock_screen_not_disturb_mode_title">隱藏勿擾模式通知</string>
<string name="system_ui_lock_screen_unlock_tip_title">隱藏屏幕底部解鎖提示</string>
<string name="system_ui_lock_screen_hide_status_bar">鎖屏時隱藏狀態欄</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values-zh-rTW/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,8 @@
<string name="system_ui_lock_screen_force_system_fonts">時鐘強制使用系統字體</string>
<string name="system_ui_lock_screen_double_lock">雙擊鎖定螢幕</string>
<string name="system_ui_lock_screen_double_lock_desc">雙擊空白處鎖定螢幕</string>
<string name="system_ui_lock_screen_unlock_notification_restrict">解除通知限制</string>
<string name="system_ui_lock_screen_unlock_notification_restrict_desc">讓所有通知均可以在鎖屏頁顯示</string>
<string name="system_ui_lock_screen_not_disturb_mode_title">隱藏勿擾模式通知</string>
<string name="system_ui_lock_screen_unlock_tip_title">隱藏螢幕底部解鎖提示</string>
<string name="system_ui_lock_screen_hide_status_bar">鎖定螢幕時隱藏狀態欄</string>
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,8 @@
<string name="system_ui_lock_screen_force_system_fonts">Force clock to use system fonts</string>
<string name="system_ui_lock_screen_double_lock">Double-tap the Lock screen</string>
<string name="system_ui_lock_screen_double_lock_desc">Double-tap an empty location to lock the screen</string>
<string name="system_ui_lock_screen_unlock_notification_restrict">Unlock notification restrict</string>
<string name="system_ui_lock_screen_unlock_notification_restrict_desc">Enable all notifications to be displayed on the lock screen</string>
<string name="system_ui_lock_screen_not_disturb_mode_title">Hide DND mode notification</string>
<string name="system_ui_lock_screen_unlock_tip_title">Hide unlock request</string>
<string name="system_ui_lock_screen_hide_status_bar">Remove status bar from Lock screen</string>
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/system_ui_lock_screen.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@
</PreferenceCategory>

<PreferenceCategory android:title="@string/system_ui_lockscreen_information_title">
<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_lock_screen_unlock_notification_restrict"
android:summary="@string/system_ui_lock_screen_unlock_notification_restrict_desc"
android:title="@string/system_ui_lock_screen_unlock_notification_restrict" />

<SwitchPreference
android:defaultValue="false"
android:key="prefs_key_system_ui_lock_screen_not_disturb_mode"
Expand Down

0 comments on commit 2f67996

Please sign in to comment.