From 366f400c5a46491f3f262c7ff4b0df1ae3721f74 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Tue, 12 Mar 2024 14:47:35 +0100 Subject: [PATCH] fix: Copy APK to output path when it is not being signed When `--mount` is used, signing is skipped. For that reason the APK was never copied to the output path. --- src/main/kotlin/app/revanced/cli/command/PatchCommand.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt index b440d62e..616a0c67 100644 --- a/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt +++ b/src/main/kotlin/app/revanced/cli/command/PatchCommand.kt @@ -307,10 +307,10 @@ internal object PatchCommand : Runnable { // region Save apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply { patcherResult.applyTo(this) - }.let { + }.let { patchedApkFile -> if (!mount) { sign( - it, + patchedApkFile, outputFilePath, ApkUtils.SigningOptions( keystoreFilePath, @@ -320,6 +320,8 @@ internal object PatchCommand : Runnable { signer, ), ) + } else { + patchedApkFile.copyTo(outputFilePath, overwrite = true) } }