root_plus 1.0.2
root_plus: ^1.0.2 copied to clipboard
Root Plus, Request Root Access and Run Root Commands Easily with this Flutter Plugin.
Root Plus - Flutter Plugin for Root Commands #
A Flutter plugin to request root access and execute privileged commands on rooted Android devices.
Features #
- Request root access (
su
) - Execute single or multiple root commands
- Get command output and error streams
- Simple, clean API
Installation #
Add root_plus
to your pubspec.yaml
:
dependencies:
root_plus: ^1.0.0
Then run:
flutter pub get
Usage Guide #
1. Import the package #
import 'package:root_plus/root_plus.dart';
2. Request Root Access #
Check if root access is available:
bool hasRoot = await RootPlus.requestRootAccess();
if (hasRoot) {
print('Root access granted!');
} else {
print('Root access denied or device not rooted');
}
3. Execute Commands #
Single Command:
try {
String result = await RootPlus.executeRootCommand('pm list packages');
print('Installed packages: $result');
} on RootCommandException catch (e) {
print('Command failed: ${e.message}');
}
Multiple Commands:
try {
String result = await RootPlus.executeRootCommand("echo Hello\necho World\npm list packages");
print('Commands output: $result');
} on RootCommandException catch (e) {
print('Error executing commands: ${e.message}');
}
Exceptions #
All methods may throw RootCommandException
with these properties:
code
: Error type (e.g., "COMMAND_FAILED")message
: Human-readable error messagedetails
: Additional error details (often the command output)
Requirements #
- Rooted Android Phone
- Tested on Android 15, I didn't tested on other android versions.
Common Use Cases #
- System modifications (remounting partitions)
- Accessing protected system files
- Managing system apps (install/uninstall)
- Advanced device administration
Warning #
⚠️ Use with caution! Root access gives complete control over the device.
- Incorrect commands can brick your device
Author #
Developed by Zaher