From cbd9158daf0c87c71a8524f38080167d287d7b32 Mon Sep 17 00:00:00 2001 From: William Budington Date: Tue, 24 Jan 2023 07:22:52 -0800 Subject: [PATCH] Fixes bug where su binary is present but privilege is not granted to com.android.shell (#326) --- mvt/android/modules/adb/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mvt/android/modules/adb/base.py b/mvt/android/modules/adb/base.py index 4246937..61d6518 100644 --- a/mvt/android/modules/adb/base.py +++ b/mvt/android/modules/adb/base.py @@ -138,7 +138,8 @@ class AndroidExtraction(MVTModule): :returns: Boolean indicating whether a `su` binary is present or not """ - return bool(self._adb_command("command -v su")) + result = self._adb_command("command -v su && su -c true") + return bool(result) and "Permission denied" not in result def _adb_root_or_die(self) -> None: """Check if we have a `su` binary, otherwise raise an Exception."""