mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-06 15:30:46 -05:00
@@ -155,10 +155,5 @@ class RootUtils : Shell.Initializer() {
|
||||
fun rmAndLaunch(rm: String, component: ComponentName) {
|
||||
Shell.su("(rm_launch $rm ${component.flattenToString()})").exec()
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun reboot() {
|
||||
Shell.su("/system/bin/reboot ${if (Info.recovery) "recovery" else ""}").submit()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
package com.topjohnwu.magisk.utils
|
||||
|
||||
import com.topjohnwu.magisk.Info
|
||||
import com.topjohnwu.superuser.Shell
|
||||
import com.topjohnwu.superuser.io.SuFileInputStream
|
||||
import com.topjohnwu.superuser.io.SuFileOutputStream
|
||||
import java.io.File
|
||||
|
||||
fun reboot(recovery: Boolean = false): Shell.Result {
|
||||
val command = StringBuilder("/system/bin/reboot")
|
||||
.appendIf(recovery) {
|
||||
append(" recovery")
|
||||
}
|
||||
.toString()
|
||||
|
||||
return Shell.su(command).exec()
|
||||
fun reboot(reason: String = if (Info.recovery) "recovery" else "") {
|
||||
Shell.su("/system/bin/svc power reboot $reason || /system/bin/reboot $reason").submit()
|
||||
}
|
||||
|
||||
fun File.suOutputStream() = SuFileOutputStream(this)
|
||||
|
||||
Reference in New Issue
Block a user