Compare commits

..

6 Commits

Author SHA1 Message Date
semantic-release-bot
61d3b99313 chore(release): 1.10.2 [skip ci]
## [1.10.2](https://github.com/revanced/revanced-cli/compare/v1.10.1...v1.10.2) (2022-06-22)

### Bug Fixes

* keystore file not found exception ([#57](https://github.com/revanced/revanced-cli/issues/57)) ([5b8537e](5b8537e6b7))
2022-06-22 17:23:50 +00:00
Itroublve
5b8537e6b7 fix: keystore file not found exception (#57)
* fix: keystore file not found exception

* the fix

* fix oopsies
2022-06-22 19:22:19 +02:00
semantic-release-bot
7d8a61c3ba chore(release): 1.10.1 [skip ci]
## [1.10.1](https://github.com/revanced/revanced-cli/compare/v1.10.0...v1.10.1) (2022-06-22)

### Bug Fixes

* show actual version in CLI ([1dcdbc9](1dcdbc9fe9))
2022-06-22 14:52:53 +00:00
Lucaskyy
1dcdbc9fe9 fix: show actual version in CLI 2022-06-22 16:51:29 +02:00
Lucaskyy
4cc2f5269f Merge remote-tracking branch 'origin/main' into main 2022-06-22 16:44:17 +02:00
Lucaskyy
46056956fe refactor: fix consistency in logging 2022-06-22 16:44:07 +02:00
5 changed files with 28 additions and 9 deletions

View File

@@ -1,3 +1,17 @@
## [1.10.2](https://github.com/revanced/revanced-cli/compare/v1.10.1...v1.10.2) (2022-06-22)
### Bug Fixes
* keystore file not found exception ([#57](https://github.com/revanced/revanced-cli/issues/57)) ([5b8537e](https://github.com/revanced/revanced-cli/commit/5b8537e6b7922f1b44058c3a4fc2f56cb4e15e89))
## [1.10.1](https://github.com/revanced/revanced-cli/compare/v1.10.0...v1.10.1) (2022-06-22)
### Bug Fixes
* show actual version in CLI ([1dcdbc9](https://github.com/revanced/revanced-cli/commit/1dcdbc9fe9e3ad2fe232ad3baa76d186817532a4))
# [1.10.0](https://github.com/revanced/revanced-cli/compare/v1.9.3...v1.10.0) (2022-06-22) # [1.10.0](https://github.com/revanced/revanced-cli/compare/v1.9.3...v1.10.0) (2022-06-22)

View File

@@ -1,2 +1,2 @@
kotlin.code.style = official kotlin.code.style = official
version = 1.10.0 version = 1.10.2

View File

@@ -13,8 +13,16 @@ import picocli.CommandLine.*
import java.io.File import java.io.File
import java.nio.file.Files import java.nio.file.Files
private class CLIVersionProvider : IVersionProvider {
override fun getVersion() = arrayOf(
MainCommand::class.java.`package`.implementationVersion ?: "unknown"
)
}
@Command( @Command(
name = "ReVanced-CLI", version = ["1.0.0"], mixinStandardHelpOptions = true name = "ReVanced-CLI",
mixinStandardHelpOptions = true,
versionProvider = CLIVersionProvider::class
) )
internal object MainCommand : Runnable { internal object MainCommand : Runnable {
@ArgGroup(exclusive = false, multiplicity = "1") @ArgGroup(exclusive = false, multiplicity = "1")

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,13 +49,13 @@ 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
val ks = File(signingOptions.keyStoreFilePath) val ks = File(signingOptions.keyStoreFilePath)
if (!ks.exists()) newKeystore(ks) else { if (!ks.exists()) newKeystore(ks) else {
println("found existing keystore: ${ks.nameWithoutExtension}") println("[found] existing keystore: ${ks.nameWithoutExtension}")
} }
val keyStore = KeyStore.getInstance("BKS", "BC") val keyStore = KeyStore.getInstance("BKS", "BC")
@@ -74,7 +74,5 @@ internal class Signer(
signer.setOutputApk(output) signer.setOutputApk(output)
signer.build().sign() signer.build().sign()
return ks
} }
} }