mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-11-28 20:45:24 +00:00
b018124226
Marked most of the old classes using Networking as deprecated to clearly visualise their future removal
19 lines
542 B
Kotlin
19 lines
542 B
Kotlin
package com.topjohnwu.magisk.utils
|
|
|
|
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 File.suOutputStream() = SuFileOutputStream(this)
|
|
fun File.suInputStream() = SuFileInputStream(this) |