mirror of
https://github.com/fankes/ColorOSNotifyIcon.git
synced 2025-09-04 09:45:34 +08:00
Modify add friendly root permission access fail tips in SystemUITool
This commit is contained in:
@@ -66,7 +66,16 @@ object SystemUITool {
|
|||||||
* 重启系统界面
|
* 重启系统界面
|
||||||
* @param context 实例
|
* @param context 实例
|
||||||
*/
|
*/
|
||||||
fun restartSystemUI(context: Context) =
|
fun restartSystemUI(context: Context) {
|
||||||
|
/** 当 Root 权限获取失败时显示对话框 */
|
||||||
|
fun showWhenAccessRootFail() =
|
||||||
|
context.showDialog {
|
||||||
|
title = "获取 Root 权限失败"
|
||||||
|
msg = "当前无法获取 Root 权限,请确认你的设备已经被 Root 且同意授予 Root 权限。\n" +
|
||||||
|
"如果你正在使用 Magisk 并安装了 Shamiko 模块," +
|
||||||
|
"请确认当前是否正处于白名单模式。 (白名单模式将导致无法申请 Root 权限)"
|
||||||
|
confirmButton(text = "我知道了")
|
||||||
|
}
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = "重启系统界面"
|
title = "重启系统界面"
|
||||||
msg = "你确定要立即重启系统界面吗?\n\n" +
|
msg = "你确定要立即重启系统界面吗?\n\n" +
|
||||||
@@ -75,11 +84,12 @@ object SystemUITool {
|
|||||||
execShell(cmd = "pgrep systemui").also { pid ->
|
execShell(cmd = "pgrep systemui").also { pid ->
|
||||||
if (pid.isNotBlank())
|
if (pid.isNotBlank())
|
||||||
execShell(cmd = "kill -9 $pid")
|
execShell(cmd = "kill -9 $pid")
|
||||||
else toast(msg = "ROOT 权限获取失败")
|
else showWhenAccessRootFail()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 刷新系统界面状态栏与通知图标
|
* 刷新系统界面状态栏与通知图标
|
||||||
|
Reference in New Issue
Block a user