v2.0.4
root
Flutter Plugin to check Android device Root status and Run shell commands in android(only), use this plugin only for short period of processes.
36Likes 1.4K30-day downloads150Pub points
Android
A Flutter Plugin to check Android device Root status and execute shell commands with root privileges
{"sdk":"flutter"}{"sdk":"flutter"}English project snapshot. Visit GitHub for the latest content.
https://media.giphy.com/media/8eTmwU4QUazn9cpPhg/giphy.gif
root as a dependency in your pubspec.yaml file. root: ^2.0.4
import 'package:root/root.dart';
bool _status = false;
Future<void> checkRoot() async {
bool result = await Root.isRooted();
setState(() {
_status = result;
});
}
later you can use _status in your code to let app know the root status.
bool _status = false;
Future<void> checkRoot() async {
bool result = await Root.isRootAvailable();
setState(() {
_status = result;
});
}
later you can use _status in your code to let app know the root status.
String _result;
Future<void> setCommand() async {
String res = await Root.exec(cmd: "cat /proc/version");
setState(() {
_result = res;
});
}
later you can use the _result in your code to let know the output of the given shell command.