mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Added access root failed tips dialog in FrameworkTool
This commit is contained in:
@@ -32,7 +32,6 @@ import com.fankes.apperrorstracking.locale.LocaleString
|
|||||||
import com.fankes.apperrorstracking.utils.factory.execShell
|
import com.fankes.apperrorstracking.utils.factory.execShell
|
||||||
import com.fankes.apperrorstracking.utils.factory.isRootAccess
|
import com.fankes.apperrorstracking.utils.factory.isRootAccess
|
||||||
import com.fankes.apperrorstracking.utils.factory.showDialog
|
import com.fankes.apperrorstracking.utils.factory.showDialog
|
||||||
import com.fankes.apperrorstracking.utils.factory.snake
|
|
||||||
import com.highcapable.yukihookapi.hook.factory.dataChannel
|
import com.highcapable.yukihookapi.hook.factory.dataChannel
|
||||||
import com.highcapable.yukihookapi.hook.param.PackageParam
|
import com.highcapable.yukihookapi.hook.param.PackageParam
|
||||||
import com.highcapable.yukihookapi.hook.xposed.channel.data.ChannelData
|
import com.highcapable.yukihookapi.hook.xposed.channel.data.ChannelData
|
||||||
@@ -205,14 +204,21 @@ object FrameworkTool {
|
|||||||
* 重启系统
|
* 重启系统
|
||||||
* @param context 实例
|
* @param context 实例
|
||||||
*/
|
*/
|
||||||
fun restartSystem(context: Context) =
|
fun restartSystem(context: Context) {
|
||||||
|
/** 当 Root 权限获取失败时显示对话框 */
|
||||||
|
fun showWhenAccessRootFail() =
|
||||||
|
context.showDialog {
|
||||||
|
title = LocaleString.accessRootFail
|
||||||
|
msg = LocaleString.accessRootFailTip
|
||||||
|
confirmButton(LocaleString.gotIt)
|
||||||
|
}
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = LocaleString.notice
|
title = LocaleString.notice
|
||||||
msg = LocaleString.areYouSureRestartSystem
|
msg = LocaleString.areYouSureRestartSystem
|
||||||
confirmButton {
|
confirmButton {
|
||||||
if (isRootAccess)
|
if (isRootAccess)
|
||||||
execShell(cmd = "reboot")
|
execShell(cmd = "reboot")
|
||||||
else context.snake(LocaleString.accessRootFail)
|
else showWhenAccessRootFail()
|
||||||
}
|
}
|
||||||
neutralButton(LocaleString.fastRestart) {
|
neutralButton(LocaleString.fastRestart) {
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
@@ -221,13 +227,14 @@ object FrameworkTool {
|
|||||||
confirmButton {
|
confirmButton {
|
||||||
if (isRootAccess)
|
if (isRootAccess)
|
||||||
execShell(cmd = "killall zygote")
|
execShell(cmd = "killall zygote")
|
||||||
else context.snake(LocaleString.accessRootFail)
|
else showWhenAccessRootFail()
|
||||||
}
|
}
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查模块是否激活
|
* 检查模块是否激活
|
||||||
|
Reference in New Issue
Block a user