Skip to content

Conversation

@ViperLiu
Copy link

@ViperLiu ViperLiu commented Jan 16, 2019

fix issues #293 and #299

quote apk tool command 
quote dex2jar command
quote decompilers commands
@nwalsh1995
Copy link
Contributor

It seems like your code has some issues running on python 3.6 vs python 2.7. This is most likely because of the unicode/str/bytes that each version of the language does.

If you can fix these, I would be happy to merge.

@vizzdoom
Copy link

This PR works and fix my problems (Windows 10, Python 3.6.8).

@testSatya007
Copy link

@nwalsh1995 and @ViperLiu Please take needful to close this bug. This issue is occurred to me but when I had updated my decompiler.py and external_decompiler.py file according to @ViperLiu. It is working fine.

log.debug("Running dex2jar with command %s", dex2jar_command)
try:
ret_code = subprocess.call(shlex.split(dex2jar_command))
ret_code = subprocess.call(shlex.split(dex2jar_command.decode(encoding="utf-8")))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To ensure backward compatibility with python2.7 (unfortunately has reach EOL prior to Jan 2021), simply check the type of the dex2jar_command variable using isinstance(dex2jar_command, bytes). If the check fails, simply run subprocess.call(shlex.split(dex2jar_command)) instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants