Skip to content

Commit

Permalink
Improve Windows apktool version detection.
Browse files Browse the repository at this point in the history
Non English Windows installs will have the 'Press any key to...'
message in whatever language the OS is set to use. This patch
assumes the version will always be on the first line.

Fixes #364
  • Loading branch information
leonjza committed May 10, 2020
1 parent 0a206c8 commit 46f8d0c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions objection/utils/patchers/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,10 @@ def is_apktool_ready(self) -> bool:
'-version',
]), timeout=self.command_run_timeout).out.strip()

# windows / delegator weirdness...
if 'Press any key to continue . . .' in o:
# On windows we get this 'Press any key to continue' thing,
# localized to the the current language. Assume that the version
# string we want is always the first line.
if len(o.split('\n')) > 1:
o = o.split('\n')[0]

if len(o) == 0:
Expand Down

0 comments on commit 46f8d0c

Please sign in to comment.