fix: keystore file not found exception (#57)

* fix: keystore file not found exception

* the fix

* fix oopsies
This commit is contained in:
Itroublve 2022-06-22 19:22:19 +02:00 committed by GitHub
parent 7d8a61c3ba
commit 5b8537e6b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 6 deletions

View File

@ -18,10 +18,9 @@ object Signing {
// the reason is, in case the signer fails // the reason is, in case the signer fails
// it does not damage the output file // it does not damage the output file
println("[signing]") 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) signedOutput.copyTo(outputFile, true)
keyStore.copyTo(outputFile.resolveSibling(keyStore.name), true)
} }
} }

View File

@ -49,7 +49,7 @@ internal class Signer(
return JcaX509CertificateConverter().getCertificate(builder.build(signer)) to pair.private 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()) Security.addProvider(BouncyCastleProvider())
// TODO: keystore should be saved securely // TODO: keystore should be saved securely
@ -74,7 +74,5 @@ internal class Signer(
signer.setOutputApk(output) signer.setOutputApk(output)
signer.build().sign() signer.build().sign()
return ks
} }
} }