Skip to content

Commit 8f354f6

Browse files
authored
Merge pull request #2 from CyrilHu/master
fix: temp not found issue on macOS #1
2 parents 91007eb + c31946c commit 8f354f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/decompiler/JadxDecompiler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { promises as fs } from "fs"
77
export class JadxDecompiler implements SmaliDecompiler {
88
constructor(public jadxPath: String, public sourceOutputDir: string, public smaliClassName: string) { }
99
async decompile(inputFilePath: string, outputChannel: OutputChannel, options?: string): Promise<string> {
10-
const outputFilePath = join(this.sourceOutputDir, this.smaliClassName + ".java")
10+
const outputFilePath = join(this.sourceOutputDir, (this.smaliClassName.includes("/") ? "" : "defpackage/") + this.smaliClassName + ".java")
1111
try {
1212
await fs.stat(outputFilePath)
1313
await fs.unlink(outputFilePath)
1414
} catch { }
1515
return new Promise<string>((resolve, reject) => {
16-
exec(`${this.jadxPath} "${inputFilePath}" -ds ${this.sourceOutputDir} ${options ?? ""}`, async (err, stdout, stderr) => {
16+
exec(`${this.jadxPath} "${inputFilePath}" -ds "${this.sourceOutputDir}" ${options ?? ""}`, async (err, stdout, stderr) => {
1717
outputChannel.append(stdout)
1818
if (err || stderr.length > 0) {
1919
outputChannel.show()

0 commit comments

Comments
 (0)