fix: Prevent printing of denied root permission exceptions for unrooted users

This commit is contained in:
Alberto Ponces
2022-09-22 14:01:05 +01:00
parent 3d25655851
commit f0f934f6a1
2 changed files with 10 additions and 3 deletions

View File

@ -7,8 +7,12 @@ class RootAPI {
Future<bool> hasRootPermissions() async {
try {
bool? isRooted = await Root.isRooted();
return isRooted != null && isRooted;
bool? isRooted = await Root.isRootAvailable();
if (isRooted != null && isRooted) {
isRooted = await Root.isRooted();
return isRooted != null && isRooted;
}
return false;
} on Exception {
return false;
}