Compare commits

..

7 Commits

Author SHA1 Message Date
semantic-release-bot
c9716be205 chore(release): 1.4.1 [skip ci]
## [1.4.1](https://github.com/revanced/revanced-cli/compare/v1.4.0...v1.4.1) (2022-06-14)

### Bug Fixes

* move the keystore to the output directory ([6ceb449](6ceb449cf8))
2022-06-14 22:01:33 +00:00
oSumAtrIX
6ceb449cf8 fix: move the keystore to the output directory 2022-06-14 23:59:59 +02:00
semantic-release-bot
6c6abafe95 chore(release): 1.4.0 [skip ci]
# [1.4.0](https://github.com/revanced/revanced-cli/compare/v1.3.3...v1.4.0) (2022-06-14)

### Features

* chcon on mount ([e1c7d10](e1c7d1082a))
2022-06-14 13:31:37 +00:00
Kinsteen
e1c7d1082a feat: chcon on mount
Co-authored-by: PaulF <paul.francon@pi.esisar.grenoble-inp.fr>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2022-06-14 15:30:14 +02:00
semantic-release-bot
7444e4e67d chore(release): 1.3.3 [skip ci]
## [1.3.3](https://github.com/revanced/revanced-cli/compare/v1.3.2...v1.3.3) (2022-06-13)

### Bug Fixes

* missing implementation ([48102c6](48102c6607))
2022-06-13 23:24:05 +00:00
Sculas
48102c6607 fix: missing implementation 2022-06-14 01:22:48 +02:00
Sculas
70258e251c chore: use Kotlin plugin for dependencies 2022-06-14 01:21:29 +02:00
5 changed files with 34 additions and 8 deletions

View File

@@ -1,3 +1,24 @@
## [1.4.1](https://github.com/revanced/revanced-cli/compare/v1.4.0...v1.4.1) (2022-06-14)
### Bug Fixes
* move the keystore to the output directory ([6ceb449](https://github.com/revanced/revanced-cli/commit/6ceb449cf8539a92d89eeba8136fdc686319e2ef))
# [1.4.0](https://github.com/revanced/revanced-cli/compare/v1.3.3...v1.4.0) (2022-06-14)
### Features
* chcon on mount ([e1c7d10](https://github.com/revanced/revanced-cli/commit/e1c7d1082a6946d1082c8744a1d0118c1a2263ea))
## [1.3.3](https://github.com/revanced/revanced-cli/compare/v1.3.2...v1.3.3) (2022-06-13)
### Bug Fixes
* missing implementation ([48102c6](https://github.com/revanced/revanced-cli/commit/48102c66077c4ae17e3de1076e9da72de5f00366))
## [1.3.2](https://github.com/revanced/revanced-cli/compare/v1.3.1...v1.3.2) (2022-06-13) ## [1.3.2](https://github.com/revanced/revanced-cli/compare/v1.3.1...v1.3.2) (2022-06-13)

View File

@@ -29,14 +29,13 @@ repositories {
} }
dependencies { dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.7.0") implementation(kotlin("stdlib"))
implementation(kotlin("reflect"))
implementation("app.revanced:revanced-patcher:1.1.0") implementation("app.revanced:revanced-patcher:1.1.0")
implementation("info.picocli:picocli:4.6.3") implementation("info.picocli:picocli:4.6.3")
implementation("com.android.tools.build:apksig:7.2.1") implementation("com.android.tools.build:apksig:7.2.1")
implementation("com.github.revanced:jadb:master-SNAPSHOT") // updated fork implementation("com.github.revanced:jadb:master-SNAPSHOT") // updated fork
implementation("org.bouncycastle:bcpkix-jdk15on:1.70") implementation("org.bouncycastle:bcpkix-jdk15on:1.70")
implementation("org.jetbrains.kotlin:kotlin-reflect:1.7.0")
} }
tasks { tasks {
@@ -50,4 +49,4 @@ tasks {
attributes("Implementation-Version" to project.version) attributes("Implementation-Version" to project.version)
} }
} }
} }

View File

@@ -16,9 +16,10 @@ object Signing {
// sign the alignedOutput and write to signedOutput // sign the alignedOutput and write to signedOutput
// 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
Signer(cn, password).signApk(alignedOutput, signedOutput) val keyStore = Signer(cn, password).signApk(alignedOutput, signedOutput)
// afterwards copy over the file to the output // afterwards copy over the file and the keystore to the output
signedOutput.copyTo(outputFile, true) signedOutput.copyTo(outputFile, true)
keyStore.copyTo(outputFile.resolveSibling(keyStore.name), true)
} }
} }

View File

@@ -54,6 +54,8 @@ internal object Constants {
base_path="$PATH_REVANCED_APP" base_path="$PATH_REVANCED_APP"
stock_path=${'$'}( pm path $PLACEHOLDER | grep base | sed 's/package://g' ) stock_path=${'$'}( pm path $PLACEHOLDER | grep base | sed 's/package://g' )
chcon u:object_r:apk_data_file:s0 ${'$'}base_path
mount -o bind ${'$'}base_path ${'$'}stock_path mount -o bind ${'$'}base_path ${'$'}stock_path
""".trimIndent() """.trimIndent()
} }

View File

@@ -48,10 +48,11 @@ 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) { fun signApk(input: File, output: File): File {
Security.addProvider(BouncyCastleProvider()) Security.addProvider(BouncyCastleProvider())
val ks = File(input.parent, "revanced-cli.keystore") // TODO: keystore should be saved securely
val ks = File(input.parent, "${output.nameWithoutExtension}.keystore")
if (!ks.exists()) newKeystore(ks) if (!ks.exists()) newKeystore(ks)
val keyStore = KeyStore.getInstance("BKS", "BC") val keyStore = KeyStore.getInstance("BKS", "BC")
@@ -70,5 +71,7 @@ internal class Signer(
signer.setOutputApk(output) signer.setOutputApk(output)
signer.build().sign() signer.build().sign()
return ks
} }
} }