diff --git a/tools/include/device_utils.py b/tools/include/device_utils.py index f048fe3..c00c900 100644 --- a/tools/include/device_utils.py +++ b/tools/include/device_utils.py @@ -33,6 +33,10 @@ def remote_shell(cmd, verbose=True): if retcode == '0': return cmd_out + args = cmd.split(' ') + if (args[0] == "/system/bin/toolbox") and (retcode == '255'): + return retcode + if verbose: print('Remote command %s failed with error code %s' % (cmd, retcode), file=sys.stderr) @@ -57,8 +61,12 @@ def remote_toolbox_cmd(cmd, args='', verbose=True): the same output regardless of whether busybox is installed. """ - return remote_shell('/system/bin/toolbox "%s" %s' % (cmd, args), verbose) + retcode = remote_shell('/system/bin/toolbox "%s" %s' % (cmd, args), verbose) + + if retcode == '255': + retcode = remote_shell('/system/bin/toybox "%s" %s' % (cmd, args), verbose) + return retcode def remote_ls(dir, verbose=True): """Run ls on the remote device, and return a set containing the results.""" --