@@ -2,7 +2,6 @@ package app.revanced.cli.command
2
2
3
3
import app.revanced.library.ApkUtils
4
4
import app.revanced.library.ApkUtils.applyTo
5
- import app.revanced.library.ApkUtils.sign
6
5
import app.revanced.library.Options
7
6
import app.revanced.library.Options.setOptions
8
7
import app.revanced.library.adb.AdbManager
@@ -86,6 +85,7 @@ internal object PatchCommand : Runnable {
86
85
names = [" -o" , " --out" ],
87
86
description = [" Path to save the patched APK file to. Defaults to the same directory as the supplied APK file." ],
88
87
)
88
+ @Suppress(" unused" )
89
89
private fun setOutputFilePath (outputFilePath : File ? ) {
90
90
this .outputFilePath = outputFilePath?.absoluteFile
91
91
}
@@ -126,13 +126,23 @@ internal object PatchCommand : Runnable {
126
126
description = [" The alias of the keystore entry to sign the patched APK file with." ],
127
127
showDefaultValue = ALWAYS ,
128
128
)
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"
130
140
131
141
@CommandLine.Option (
132
142
names = [" --keystore-entry-password" ],
133
143
description = [" The password of the entry from the keystore for the key to sign the patched APK file with." ],
134
144
)
135
- private var password = " " // Empty password by default
145
+ private var keyStoreEntryPassword = " " // Empty password by default
136
146
137
147
@CommandLine.Option (
138
148
names = [" --signer" ],
@@ -308,15 +318,15 @@ internal object PatchCommand : Runnable {
308
318
patcherResult.applyTo(this )
309
319
}.let { patchedApkFile ->
310
320
if (! mount) {
311
- sign (
321
+ ApkUtils .signApk (
312
322
patchedApkFile,
313
323
outputFilePath,
314
- ApkUtils .SigningOptions (
324
+ signer,
325
+ ApkUtils .KeyStoreDetails (
315
326
keystoreFilePath,
316
327
keyStorePassword,
317
- alias,
318
- password,
319
- signer,
328
+ keyStoreEntryAlias,
329
+ keyStoreEntryPassword,
320
330
),
321
331
)
322
332
} else {
0 commit comments