Skip to content

Commit

Permalink
fix: 系统界面-锁屏-隐藏勿扰通知(by hyper helper)
Browse files Browse the repository at this point in the history
Signed-off-by: mu7220 <[email protected]>
  • Loading branch information
lingqiqi5211 committed Jan 23, 2024
1 parent 7c207da commit c79ee79
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,28 @@ 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.BaseHook
import com.sevtinge.hyperceiler.utils.devicesdk.isMoreHyperOSVersion
import com.sevtinge.hyperceiler.utils.setObjectField

object HideLockscreenZenMode : BaseHook() {
override fun init() {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController", lpparam.classLoader)
.methodFinder().first {
name == "shouldBeVisible"
}.createHook {
returnConstant(false)
}
// hyperOS fix by hyper helper
if (isMoreHyperOSVersion(1f)) {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController", lpparam.classLoader)
.methodFinder().first {
name == "updateVisibility"
}.createHook {
before {
it.thisObject.setObjectField("manuallyDismissed", true)
}
}
} else {
loadClass("com.android.systemui.statusbar.notification.zen.ZenModeViewController", lpparam.classLoader)
.methodFinder().first {
name == "shouldBeVisible"
}.createHook {
returnConstant(false)
}
}
}
}
2 changes: 1 addition & 1 deletion app/src/main/res/values-zh-rCN/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,7 @@
<string name="system_ui_another_title">其他</string>
<string name="system_ui_disable_bluetooth_restrict">禁用蓝牙临时关闭</string>
<string name="system_ui_disable_miui_multi_win_switch">隐藏快捷窗口按钮</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">隐藏 HyperOS 应用窗口顶部居中的快捷窗口按钮 (即常驻的三个小点)</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">隐藏常驻的三个小点,包括小窗顶部和 HyperOS for Pad 横屏顶部中间的按钮 (不影响功能使用)</string>
<string name="system_ui_notification_freeform">更多应用通知栏下拉打开小窗</string>
<string name="system_ui_others_pct_title">数据显示</string>
<string name="system_showpct_title">显示亮度百分比</string>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@
<string name="system_ui_another_title">Other</string>
<string name="system_ui_disable_bluetooth_restrict">Prevent bluetooth from being turned off temporarily</string>
<string name="system_ui_disable_miui_multi_win_switch">Hide the Convenience Window button</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">Hide the convenient window button centered at the top of the app windows in HyperOS</string>
<string name="system_ui_disable_miui_multi_win_switch_desc">Hide the three permanent dots, including the top of the small window and the button in the middle of the top of the HyperOS for Pad horizontal screen (does not affect the use of functions)</string>
<string name="system_ui_others_pct_title">Data display</string>
<string name="system_showpct_title">Displays the brightness percentage</string>
<string name="system_cc_volume_showpct_title">Displays the percentage of sound</string>
Expand Down

0 comments on commit c79ee79

Please sign in to comment.