Skip to content

Commit 66a5fc2

Browse files
authored
chore: Merge branch dev to main (#318)
2 parents d5c2740 + 2b41fe6 commit 66a5fc2

File tree

5 files changed

+55
-14
lines changed

5 files changed

+55
-14
lines changed

CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# [4.6.0-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.5.1-dev.1...v4.6.0-dev.1) (2024-03-14)
2+
3+
4+
### Bug Fixes
5+
6+
* Use correct option description ([45a2ffa](https://github.com/ReVanced/revanced-cli/commit/45a2ffa2dd95ee8ac3c4d466463c9a5b869b8da1))
7+
8+
9+
### Features
10+
11+
* Use more consistent option name ([223629c](https://github.com/ReVanced/revanced-cli/commit/223629c663dcd94d237110e09e4e152aa03867f9))
12+
13+
## [4.5.1-dev.1](https://github.com/ReVanced/revanced-cli/compare/v4.5.0...v4.5.1-dev.1) (2024-03-12)
14+
15+
16+
### Bug Fixes
17+
18+
* Copy APK to output path when it is not being signed ([366f400](https://github.com/ReVanced/revanced-cli/commit/366f400c5a46491f3f262c7ff4b0df1ae3721f74))
19+
120
# [4.5.0](https://github.com/ReVanced/revanced-cli/compare/v4.4.2...v4.5.0) (2024-03-11)
221

322

docs/2_building.md

+11
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,15 @@ To build ReVanced CLI, follow these steps:
2323
./gradlew build
2424
```
2525

26+
> [!NOTE]
27+
> If the build fails due to authentication, you may need to authenticate to GitHub Packages.
28+
> Create a PAT with the scope `read:packages` [here](https://github.com/settings/tokens/new?scopes=read:packages&description=ReVanced) and add your token to ~/.gradle/gradle.properties.
29+
>
30+
> Example `gradle.properties` file:
31+
>
32+
> ```properties
33+
> gpr.user = user
34+
> gpr.key = key
35+
> ```
36+
2637
After the build succeeds, the built JAR file will be located at `build/libs/revanced-cli-<version>-all.jar`.

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
org.gradle.parallel = true
22
org.gradle.caching = true
33
kotlin.code.style = official
4-
version = 4.5.0
4+
version = 4.6.0-dev.1

gradle/libs.versions.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kotlin = "1.9.22"
44
kotlinx-coroutines-core = "1.7.3"
55
picocli = "4.7.5"
66
revanced-patcher = "19.3.1"
7-
revanced-library = "2.2.1"
7+
revanced-library = "2.3.0"
88

99
[libraries]
1010
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }

src/main/kotlin/app/revanced/cli/command/PatchCommand.kt

+23-12
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package app.revanced.cli.command
22

33
import app.revanced.library.ApkUtils
44
import app.revanced.library.ApkUtils.applyTo
5-
import app.revanced.library.ApkUtils.sign
65
import app.revanced.library.Options
76
import app.revanced.library.Options.setOptions
87
import app.revanced.library.adb.AdbManager
@@ -86,6 +85,7 @@ internal object PatchCommand : Runnable {
8685
names = ["-o", "--out"],
8786
description = ["Path to save the patched APK file to. Defaults to the same directory as the supplied APK file."],
8887
)
88+
@Suppress("unused")
8989
private fun setOutputFilePath(outputFilePath: File?) {
9090
this.outputFilePath = outputFilePath?.absoluteFile
9191
}
@@ -115,7 +115,6 @@ internal object PatchCommand : Runnable {
115115
)
116116
private var keystoreFilePath: File? = null
117117

118-
// key store password
119118
@CommandLine.Option(
120119
names = ["--keystore-password"],
121120
description = ["The password of the keystore to sign the patched APK file with. Empty password by default."],
@@ -124,16 +123,26 @@ internal object PatchCommand : Runnable {
124123

125124
@CommandLine.Option(
126125
names = ["--alias"],
127-
description = ["The alias of the key from the keystore to sign the patched APK file with."],
126+
description = ["The alias of the keystore entry to sign the patched APK file with."],
128127
showDefaultValue = ALWAYS,
129128
)
130-
private var alias = "ReVanced Key"
129+
private fun setKeyStoreEntryAlias(alias: String = "ReVanced Key") {
130+
logger.warning("The --alias option is deprecated. Use --keystore-entry-alias instead.")
131+
keyStoreEntryAlias = alias
132+
}
133+
134+
@CommandLine.Option(
135+
names = ["--keystore-entry-alias"],
136+
description = ["The alias of the keystore entry to sign the patched APK file with."],
137+
showDefaultValue = ALWAYS,
138+
)
139+
private var keyStoreEntryAlias = "ReVanced Key"
131140

132141
@CommandLine.Option(
133142
names = ["--keystore-entry-password"],
134143
description = ["The password of the entry from the keystore for the key to sign the patched APK file with."],
135144
)
136-
private var password = "" // Empty password by default
145+
private var keyStoreEntryPassword = "" // Empty password by default
137146

138147
@CommandLine.Option(
139148
names = ["--signer"],
@@ -307,19 +316,21 @@ internal object PatchCommand : Runnable {
307316
// region Save
308317
apk.copyTo(temporaryFilesPath.resolve(apk.name), overwrite = true).apply {
309318
patcherResult.applyTo(this)
310-
}.let {
319+
}.let { patchedApkFile ->
311320
if (!mount) {
312-
sign(
313-
it,
321+
ApkUtils.signApk(
322+
patchedApkFile,
314323
outputFilePath,
315-
ApkUtils.SigningOptions(
324+
signer,
325+
ApkUtils.KeyStoreDetails(
316326
keystoreFilePath,
317327
keyStorePassword,
318-
alias,
319-
password,
320-
signer,
328+
keyStoreEntryAlias,
329+
keyStoreEntryPassword,
321330
),
322331
)
332+
} else {
333+
patchedApkFile.copyTo(outputFilePath, overwrite = true)
323334
}
324335
}
325336

0 commit comments

Comments
 (0)