Update YukiHookAPI

This commit is contained in:
2022-03-06 01:15:29 +08:00
parent cd5f9806a3
commit e529e75bc2

View File

@@ -267,11 +267,19 @@ class HookEntry : YukiHookXposedInitProxy {
} }
} }
override fun onHook() = encase { override fun onHook() {
configs { runConfig()
runHook()
}
/** 配置 Hook */
private fun runConfig() = configs {
debugTag = "ColorOSNotify" debugTag = "ColorOSNotify"
isDebug = false isDebug = false
} }
/** 开始 Hook */
private fun runHook() = encase {
loadApp(SYSTEMUI_PACKAGE_NAME) { loadApp(SYSTEMUI_PACKAGE_NAME) {
when { when {
/** 不是 ColorOS 系统停止 Hook */ /** 不是 ColorOS 系统停止 Hook */
@@ -301,7 +309,11 @@ class HookEntry : YukiHookXposedInitProxy {
} }
beforeHook { beforeHook {
/** 是否移除 */ /** 是否移除 */
if (firstArgs as Int == 7 && prefs.getBoolean(REMOVE_CHANGECP_NOTIFY, default = false)) resultNull() if (firstArgs as Int == 7 && prefs.getBoolean(
REMOVE_CHANGECP_NOTIFY,
default = false
)
) resultNull()
} }
} }
} }