From 973f24681a82b1775eeebce4a17c4c0818ef920a Mon Sep 17 00:00:00 2001 From: Niklas Higi Date: Sun, 21 Apr 2024 14:27:45 +0200 Subject: [PATCH] Clean up handling of relative input paths Closes #135 --- src/cli.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cli.ts b/src/cli.ts index 3eb0082..e0606f1 100644 --- a/src/cli.ts +++ b/src/cli.ts @@ -54,7 +54,7 @@ async function main() { showHelp() process.exit(1) } - const inputPath = path.resolve(process.cwd(), input) + const inputPath = path.resolve(input) const { taskFunction, skipDecode, isAppBundle, outputName } = await determineTask(inputPath) @@ -64,7 +64,7 @@ async function main() { let certificatePath: string | undefined const mapsApiKey: string | undefined = args['maps-api-key'] if (args.certificate) { - certificatePath = path.resolve(process.cwd(), args.certificate) + certificatePath = path.resolve(args.certificate) let certificateExtension = path.extname(certificatePath) if (certificateExtension !== '.pem' && certificateExtension !== '.der') @@ -72,14 +72,13 @@ async function main() { } let tmpDir = args['tmp-dir'] - ? path.resolve(process.cwd(), args['tmp-dir']) + ? path.resolve(args['tmp-dir']) : tempy.directory({ prefix: 'apk-mitm-' }) await fs.mkdir(tmpDir, { recursive: true }) - process.chdir(tmpDir) const apktool = new Apktool({ frameworkPath: path.join(tmpDir, 'framework'), - customPath: args.apktool, + customPath: path.resolve(args.apktool), }) const uberApkSigner = new UberApkSigner()