Package-level declarations

Types

Link copied to clipboard
object RootUtils

Functions

Link copied to clipboard
fun File.copyToAsSu(destination: File): File

Copies this files to the destination one, no matter file system permissions. Requires root permissions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
inline fun ignoreErrors(block: () -> Unit)

Catches and logs any exception for this block and continue execution. Note that execution of block will exit on first statement that throws an exception. Exception is logged as ERROR level.

Link copied to clipboard

Installs file as APK without asking permission. Requires root permissions.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun <T : Exception> T.log(tag: String = TAG): T

Log stacktrace of exception as error

fun <T> T.log(tag: String = TAG): T

Log this object as debug (shorter name)

Link copied to clipboard
fun logCallTrace(tag: String = TAG)

Logs the call stack trace as debug.

Link copied to clipboard
fun <T> T.logDebug(tag: String = TAG): T

Log this object as debug.

Link copied to clipboard
fun <T> T.logError(tag: String = TAG): T

Log this object as error.

Link copied to clipboard
inline fun <T> logExecutionTime(tag: String = "LogUtils", block: () -> T?): T?

Executes block and logs execution time for it as debug.

Link copied to clipboard
fun <T> T.logInfo(tag: String = TAG): T

Log this object as info.

Link copied to clipboard
fun <T> T.logWarning(tag: String = TAG): T

Log this object as warning.

Link copied to clipboard
fun reboot()

Reboots the device

Link copied to clipboard

Executes command on shell and returns standard output.

Link copied to clipboard

Executes command on shell as root (superuser) and returns standard output. NOTE: This call needs superuser privileges.

Link copied to clipboard
fun shutdown()

Powers off the device