Skip to content

Commit 7aa836f

Browse files
committed
Fix unexpected character escaping
1 parent 01e65c6 commit 7aa836f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/decompiler/impl/JadxDecompiler.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class JadxDecompiler implements SmaliDecompiler {
4040
if (!config.path) throw new DecompileError("The jadx executable path has not been configured")
4141
if (!(await fsAsync.stat(config.path)).isFile()) throw new DecompileError("Illegal jadx executable path")
4242
const outputFilePath = this.getOutputFilePath(smaliClassName)
43-
const { stdout, stderr } = await execAsync(`${await config.path} "${smaliFileUri.fsPath}" -ds "${this.sourceOutputDir}" ${config.options ?? ""}`)
43+
const { stdout, stderr } = await execAsync(`${await config.path} ${this.quote(smaliFileUri.fsPath)} -ds ${this.quote(this.sourceOutputDir)} ${config.options ?? ""}`)
4444
this.outputChannel.append(stdout)
4545
if (stderr && stderr.length > 0) {
4646
this.outputChannel.show()
@@ -57,4 +57,11 @@ export class JadxDecompiler implements SmaliDecompiler {
5757
path: outputFilePath
5858
})
5959
}
60+
61+
private quote(str: string) {
62+
if (process.platform == "win32") {
63+
return `"${str}"`
64+
}
65+
return `'${str}'`
66+
}
6067
}

0 commit comments

Comments
 (0)