mirror of
https://github.com/mvt-project/mvt.git
synced 2026-02-13 00:52:44 +00:00
Use command -v instead of which to check for root
`command` is built in, unlike `which`, and is more reliable. https://github.com/mvt-project/mvt/pull/19#issuecomment-885650430 https://stackoverflow.com/questions/592620/how-can-i-check-if-a-program-exists-from-a-bash-script/677212#677212
This commit is contained in:
@@ -96,7 +96,7 @@ class AndroidExtraction(MVTModule):
|
||||
"""Check if we have a `su` binary on the Android device.
|
||||
:returns: Boolean indicating whether a `su` binary is present or not
|
||||
"""
|
||||
return bool(self._adb_command("which su"))
|
||||
return bool(self._adb_command("command -v su"))
|
||||
|
||||
def _adb_root_or_die(self):
|
||||
"""Check if we have a `su` binary, otherwise raise an Exception.
|
||||
|
||||
Reference in New Issue
Block a user