Skip to content

Commit

Permalink
Added a timeout for adb remount so it will go on also if the command …
Browse files Browse the repository at this point in the history
…stuck (only for new Python versions, on old versions it will behave as before), ref #22
  • Loading branch information
ale5000-git committed Sep 1, 2017
1 parent ff0a919 commit 2c6ce8d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ def enable_device_writing(chosen_device):

print_(" *** Remounting /system...")
if(UNLOCKED_ADB):
remount_check = subprocess.check_output([DEPS_PATH["adb"], "-s", chosen_device, "remount"]).decode("utf-8")
remount_check = safe_subprocess_run_timeout([DEPS_PATH["adb"], "-s", chosen_device, "remount"])
if remount_check is not False:
remount_check = remount_check.decode("utf-8")
else:
remount_check = subprocess.check_output([DEPS_PATH["adb"], "-s", chosen_device, "shell", "su -c 'mount -o remount,rw /system && mount' | grep /system"]).decode("utf-8") # Untested
debug(remount_check)
Expand Down

0 comments on commit 2c6ce8d

Please sign in to comment.