You've already forked Magisk
mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-09-06 06:36:58 +00:00
14 lines
504 B
Kotlin
14 lines
504 B
Kotlin
package com.topjohnwu.magisk.extensions
|
|
|
|
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(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)
|
|
fun File.suInputStream() = SuFileInputStream(this) |