feat: Hide "Install as Root" button if user does not have root access at all

This commit is contained in:
Alberto Ponces
2022-09-23 15:47:30 +01:00
parent c8c35ca801
commit 9561153bfb
3 changed files with 15 additions and 1 deletions

View File

@ -5,6 +5,15 @@ class RootAPI {
final String _postFsDataDirPath = '/data/adb/post-fs-data.d';
final String _serviceDDirPath = '/data/adb/service.d';
Future<bool> isRooted() async {
try {
bool? isRooted = await Root.isRootAvailable();
return isRooted != null && isRooted;
} on Exception {
return false;
}
}
Future<bool> hasRootPermissions() async {
try {
bool? isRooted = await Root.isRootAvailable();