Skip to content

Commit

Permalink
fix: handle whitespaces in paths
Browse files Browse the repository at this point in the history
  • Loading branch information
vin01 committed Aug 9, 2019
1 parent ba1b265 commit 84e9071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions qark/decompiler/decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@

DECOMPILERS_PATH = os.path.join(LIB_PATH, "decompilers")

APK_TOOL_COMMAND = ("java -Djava.awt.headless=true -jar {apktool_path}/apktool.jar "
"d {path_to_source} --no-src --force -m --output {build_directory}")
DEX2JAR_COMMAND = "{dex2jar_path} {path_to_dex} -o {build_apk}.jar"
APK_TOOL_COMMAND = ("java -Djava.awt.headless=true -jar '{apktool_path}/apktool.jar' "
"d '{path_to_source}' --no-src --force -m --output '{build_directory}'")
DEX2JAR_COMMAND = "'{dex2jar_path}' '{path_to_dex}' -o '{build_apk}.jar'"


def escape_windows_path(path):
Expand Down
6 changes: 3 additions & 3 deletions qark/decompiler/external_decompiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):
ExternalDecompiler.__init__(self,
name="cfr",
path_to_decompiler=os.path.join(PATH_TO_DECOMPILERS, "cfr_0_124.jar"),
command="java -jar {path_to_decompiler} {jar} --outputdir {build_directory}/cfr")
command="java -jar '{path_to_decompiler}' '{jar}' --outputdir '{build_directory}/cfr'")


class Procyon(ExternalDecompiler):
Expand All @@ -28,7 +28,7 @@ def __init__(self):
name="procyon",
path_to_decompiler=os.path.join(PATH_TO_DECOMPILERS,
"procyon-decompiler-1.0.jar"),
command="java -jar {path_to_decompiler} {jar} -o {build_directory}/procyon")
command="java -jar '{path_to_decompiler}' '{jar}' -o '{build_directory}/procyon'")


class Fernflower(ExternalDecompiler):
Expand All @@ -37,7 +37,7 @@ def __init__(self):
name="fernflower",
path_to_decompiler=os.path.join(PATH_TO_DECOMPILERS,
"fernflower.jar"),
command="java -jar {path_to_decompiler} -ren=1 {jar} {build_directory}/fernflower")
command="java -jar '{path_to_decompiler}' -ren=1 '{jar}' '{build_directory}/fernflower'")


DECOMPILERS = (CFR(), Procyon(), Fernflower())

0 comments on commit 84e9071

Please sign in to comment.