v2.0.4
root
Flutter 插件,用於檢查 Android 裝置的 Root 狀態並在 Android(僅限 Android)上執行 shell 命令,僅建議在短時間內執行作業時使用此插件。
36喜歡 1390近 30 天下載150Pub 分數
Android
一個用於檢查 Android 設備 Root 狀態並以 Root 權限執行 shell 命令的 Flutter 插件
以下為英文專案原文快照,最新內容請造訪 GitHub。
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.
依賴清單 2 項
{"sdk":"flutter"}{"sdk":"flutter"}先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。
“A repository is the most basic element of GitHub.”
GitHub Docs — About repositories ↗