From ef0c59f69396938291d5da5aa9f062eedb4e23ef Mon Sep 17 00:00:00 2001 From: Alberto Ponces Date: Fri, 16 Sep 2022 16:39:37 +0100 Subject: [PATCH] fix: Surround isRooted with a try/catch just to be safe --- lib/services/root_api.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/services/root_api.dart b/lib/services/root_api.dart index 5e0e50db..57179a27 100644 --- a/lib/services/root_api.dart +++ b/lib/services/root_api.dart @@ -6,8 +6,12 @@ class RootAPI { final String _serviceDDirPath = '/data/adb/service.d'; Future hasRootPermissions() async { - bool? isRooted = await Root.isRooted(); - return isRooted != null && isRooted; + try { + bool? isRooted = await Root.isRooted(); + return isRooted != null && isRooted; + } on Exception { + return false; + } } Future setPermissions(