requestAccess

fun requestAccess(onResult: (Boolean) -> Unit? = null)

Trigger the su prompt (if it hasn't fired yet) on a background thread. Optional onResult callback is invoked once libsu has the shell ready, with true when the resulting shell is a root shell, false otherwise (user denied, non-root device, or a non-root default builder was configured). The callback runs on libsu's worker thread — dispatch to the UI thread yourself if you need to mutate UI state.

Safe to call multiple times; libsu deduplicates and reuses the cached shell once it's been instantiated.