WebUI development
About 127 wordsLess than 1 minute
Module WebUIs can use the kernelsu JavaScript package from the repository's js/ directory.
yarn add kernelsuPublic API
exec(command, options): run a root shell command and returnerrno,stdout,stderrspawn(command, args, options): start a root child process with stream and exit eventsfullScreen(boolean): request WebView fullscreen statetoast(message): show an Android ToastmoduleInfo(): read information about the current module
import { exec, toast } from 'kernelsu'
const { errno, stdout, stderr } = await exec('id')
toast(errno === 0 ? stdout : stderr)exec and spawn run in a root shell. Never concatenate URL parameters, form input or remote content directly into commands, and do not load untrusted remote scripts.
See js/README.md for the maintained API contract.
Copyright
Copyright Ownership:Anatdx
License under:Attribution-NonCommercial-ShareAlike 4.0 International (CC-BY-NC-SA-4.0)