CMDProcessorLibrary
An implementation of AOKP's CMDProcessor as a standalone library. This provides a concise and easy-to-use Java abstraction layer for the UNIX Shell on Android.
Install / Use
/learn @Androguide/CMDProcessorLibraryREADME
CMDProcessorLibrary
My implementation of AOKP's CMDProcessor as a standalone library.
This provides a concise and easy-to-use Java abstraction layer for the UNIX Shell on Android.
Examples:
// Executing a command
CMDProcessor.runShellCommand("touch /sdcard/test.txt");
// Executing a command as root
CMDProcessor.runSuCommand("mount -o remount,rw /system");
// Getting the standard output
String stdout = CMDProcessor.runShellCommand("echo HelloWorld").getStdout().toString(); //stdout == "HelloWorld"
// Getting the standard error stream
String stderr = CMDProcessor.runShellCommand("mount -o remount,rw /system").getStderr; //stderr = "mount: permission denied (are you root?)"
// Check if the device is rooted
if (CMDProcessor.canSu()) { ... }
// Executing several commands at once
CMDProcessor.runShellCommand("echo test" + "\n" + "touch /sdcard/test.txt" + "\n" + "ls -n");
Preferably, use CMDProcessor in a separate Thread or in an AsyncTask.
If you don't, you will block the UI thread and cause lags.
new Thread(new Runnable() {
@Override
public void run() {
CMDProcessor.runShellCommand("...");
}
}).start();
Related Skills
node-connect
352.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.5kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
