@@ -47,6 +47,11 @@ import java.io.StringWriter
4747import java.util.concurrent.Callable
4848import java.util.logging.Logger
4949
50+ private const val DEFAULT_KEYSTORE_ALIAS = " Morphe"
51+ private const val DEFAULT_KEYSTORE_PASSWORD = " Morphe"
52+ private const val LEGACY_KEYSTORE_ALIAS = " Morphe Key"
53+ private const val LEGACY_KEYSTORE_PASSWORD = " "
54+
5055@OptIn(ExperimentalSerializationApi ::class )
5156@VisibleForTesting
5257@CommandLine.Command (
@@ -196,13 +201,13 @@ internal object PatchCommand : Callable<Int> {
196201 description = [" Alias of the private key and certificate pair keystore entry." ],
197202 showDefaultValue = ALWAYS ,
198203 )
199- private var keyStoreEntryAlias = " Morphe " // Default now matches Manager
204+ private var keyStoreEntryAlias = DEFAULT_KEYSTORE_ALIAS // Default now matches Manager
200205
201206 @CommandLine.Option (
202207 names = [" --keystore-entry-password" ],
203208 description = [" Password of the keystore entry." ],
204209 )
205- private var keyStoreEntryPassword = " Morphe " // Default now matches Manager
210+ private var keyStoreEntryPassword = DEFAULT_KEYSTORE_PASSWORD // Default now matches Manager
206211
207212 @CommandLine.Option (
208213 names = [" --signer" ],
@@ -676,7 +681,7 @@ internal object PatchCommand : Callable<Int> {
676681 )
677682 } catch (e: Exception ){
678683 // We retry with legacy keystore defaults here. Need to move to new defaults eventually!
679- if (keyStoreEntryAlias == " Morphe " && keyStoreEntryPassword == " Morphe " && keystoreFilePath.exists()){
684+ if (keyStoreEntryAlias == DEFAULT_KEYSTORE_ALIAS && keyStoreEntryPassword == DEFAULT_KEYSTORE_PASSWORD && keystoreFilePath.exists()){
680685 logger.info(" Retrying with legacy keystore credentials..." )
681686
682687 ApkUtils .signApk(
@@ -686,8 +691,8 @@ internal object PatchCommand : Callable<Int> {
686691 ApkUtils .KeyStoreDetails (
687692 keystoreFilePath,
688693 keyStorePassword,
689- " Morphe Key " ,
690- " " ,
694+ LEGACY_KEYSTORE_ALIAS ,
695+ LEGACY_KEYSTORE_PASSWORD ,
691696 )
692697 )
693698 } else {
0 commit comments