Skip to content

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

@ViperLiu

Description

@ViperLiu

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions