Skip to content

Commit

Permalink
Clean up handling of relative input paths
Browse files Browse the repository at this point in the history
Closes #135
  • Loading branch information
niklashigi committed Apr 21, 2024
1 parent 09f3190 commit 973f246
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -64,22 +64,21 @@ 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')
showSupportedCertificateExtensions()
}

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()

Expand Down

0 comments on commit 973f246

Please sign in to comment.