From 5b8537e6b7922f1b44058c3a4fc2f56cb4e15e89 Mon Sep 17 00:00:00 2001 From: Itroublve <51215044+Itroublve@users.noreply.github.com> Date: Wed, 22 Jun 2022 19:22:19 +0200 Subject: [PATCH] fix: keystore file not found exception (#57) * fix: keystore file not found exception * the fix * fix oopsies --- src/main/kotlin/app/revanced/cli/signing/Signing.kt | 5 ++--- src/main/kotlin/app/revanced/utils/signing/Signer.kt | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/app/revanced/cli/signing/Signing.kt b/src/main/kotlin/app/revanced/cli/signing/Signing.kt index 01e87270..80eb2388 100644 --- a/src/main/kotlin/app/revanced/cli/signing/Signing.kt +++ b/src/main/kotlin/app/revanced/cli/signing/Signing.kt @@ -18,10 +18,9 @@ object Signing { // the reason is, in case the signer fails // it does not damage the output file println("[signing]") - val keyStore = Signer(signingOptions).signApk(alignedOutput, signedOutput) + Signer(signingOptions).signApk(alignedOutput, signedOutput) - // afterwards copy over the file and the keystore to the output + // afterwards copy over the file to the output signedOutput.copyTo(outputFile, true) - keyStore.copyTo(outputFile.resolveSibling(keyStore.name), true) } } diff --git a/src/main/kotlin/app/revanced/utils/signing/Signer.kt b/src/main/kotlin/app/revanced/utils/signing/Signer.kt index ad164373..7f9bfdaa 100644 --- a/src/main/kotlin/app/revanced/utils/signing/Signer.kt +++ b/src/main/kotlin/app/revanced/utils/signing/Signer.kt @@ -49,7 +49,7 @@ internal class Signer( return JcaX509CertificateConverter().getCertificate(builder.build(signer)) to pair.private } - fun signApk(input: File, output: File): File { + fun signApk(input: File, output: File) { Security.addProvider(BouncyCastleProvider()) // TODO: keystore should be saved securely @@ -74,7 +74,5 @@ internal class Signer( signer.setOutputApk(output) signer.build().sign() - - return ks } } \ No newline at end of file