Skip to content

Commit

Permalink
fix: keystore file not found exception (ReVanced#57)
Browse files Browse the repository at this point in the history
* fix: keystore file not found exception

* the fix

* fix oopsies
  • Loading branch information
Itroublve committed Jun 22, 2022
1 parent 7d8a61c commit 5b8537e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
5 changes: 2 additions & 3 deletions src/main/kotlin/app/revanced/cli/signing/Signing.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
4 changes: 1 addition & 3 deletions src/main/kotlin/app/revanced/utils/signing/Signer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -74,7 +74,5 @@ internal class Signer(
signer.setOutputApk(output)

signer.build().sign()

return ks
}
}

0 comments on commit 5b8537e

Please sign in to comment.