feat: add option to specify keystore file path

This commit is contained in:
oSumAtrIX
2022-06-22 13:45:52 +02:00
parent 07f6bdf330
commit 9331594706
4 changed files with 30 additions and 13 deletions

View File

@@ -7,7 +7,7 @@ import app.revanced.utils.signing.align.ZipAligner
import java.io.File
object Signing {
fun start(inputFile: File, outputFile: File, cn: String, password: String) {
fun start(inputFile: File, outputFile: File, signingOptions: SigningOptions) {
val cacheDirectory = File(args.pArgs!!.cacheDirectory)
val alignedOutput = cacheDirectory.resolve("${outputFile.nameWithoutExtension}_aligned.apk")
val signedOutput = cacheDirectory.resolve("${outputFile.nameWithoutExtension}_signed.apk")
@@ -22,7 +22,7 @@ object Signing {
// sign the alignedOutput and write to signedOutput
// the reason is, in case the signer fails
// it does not damage the output file
val keyStore = Signer(cn, password).signApk(alignedOutput, signedOutput)
val keyStore = Signer(signingOptions).signApk(alignedOutput, signedOutput)
// afterwards copy over the file and the keystore to the output
signedOutput.copyTo(outputFile, true)