Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not handle APKs with spaces in the name properly #299

Open
ViperLiu opened this issue Dec 26, 2018 · 0 comments · May be fixed by #338
Open

Does not handle APKs with spaces in the name properly #299

ViperLiu opened this issue Dec 26, 2018 · 0 comments · May be fixed by #338
Labels

Comments

@ViperLiu
Copy link

ViperLiu commented Dec 26, 2018

Calling APKTool with following command
b'java -Djava.awt.headless=true -jar c:\\program files\\python36\\lib\\site-packages\\qark-3.0.0-py3.6.egg\\qark\\decompiler\\..\\lib\\apktool/apktool.jar d D:\\mas\\NPTU.apk --no-src --force -m --output D:\\mas\\build\\qark\\apktool'

Error: Unable to access jarfile c:\program

It seems that APKTool take
c:\\\\program files\\\\python36\\\\lib\\\\site-packages\\\\qark-3.0.0-py3.6.egg\\\\qark\\\\decompiler\\\\..\\\\lib\\\\apktool/apktool.jar
as 2 arguments, since there is a space in the "program files"
This will also cause the failure of move manifest into proper location, because there is no manifest to move

so I change the decompiler.py at line 29
APK_TOOL_COMMAND = ("java -Djava.awt.headless=true -jar {apktool_path}/apktool.jar " "d {path_to_source} --no-src --force -m --output {build_directory}")
to
APK_TOOL_COMMAND = ("java -Djava.awt.headless=true -jar '{apktool_path}/apktool.jar' " "d '{path_to_source}' --no-src --force -m --output '{build_directory}'")

I just simply add quotes in every path-argument and fix it

Maybe we should add quotes in every command not just APKTool in case there is more space in users' path

@nwalsh-lnk nwalsh-lnk added the bug label Jan 9, 2019
@nwalsh-lnk nwalsh-lnk changed the title "Error: Unable to access jarfile c:\program" in Windows Does not handle APKs with spaces in the name properly Jan 9, 2019
@vin01 vin01 linked a pull request Jul 12, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants