Skip to content

Commit 223629c

Browse files
committed
feat: Use more consistent option name
1 parent 45a2ffa commit 223629c

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

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

+18-8
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
}
@@ -126,13 +126,23 @@ internal object PatchCommand : Runnable {
126126
description = ["The alias of the keystore entry to sign the patched APK file with."],
127127
showDefaultValue = ALWAYS,
128128
)
129-
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"
130140

131141
@CommandLine.Option(
132142
names = ["--keystore-entry-password"],
133143
description = ["The password of the entry from the keystore for the key to sign the patched APK file with."],
134144
)
135-
private var password = "" // Empty password by default
145+
private var keyStoreEntryPassword = "" // Empty password by default
136146

137147
@CommandLine.Option(
138148
names = ["--signer"],
@@ -308,15 +318,15 @@ internal object PatchCommand : Runnable {
308318
patcherResult.applyTo(this)
309319
}.let { patchedApkFile ->
310320
if (!mount) {
311-
sign(
321+
ApkUtils.signApk(
312322
patchedApkFile,
313323
outputFilePath,
314-
ApkUtils.SigningOptions(
324+
signer,
325+
ApkUtils.KeyStoreDetails(
315326
keystoreFilePath,
316327
keyStorePassword,
317-
alias,
318-
password,
319-
signer,
328+
keyStoreEntryAlias,
329+
keyStoreEntryPassword,
320330
),
321331
)
322332
} else {

0 commit comments

Comments
 (0)