From c951d6ed5286cf77b7b766769f0d44e458fc36f6 Mon Sep 17 00:00:00 2001 From: Bentley O'Kane-Chase Date: Thu, 16 Nov 2023 11:49:49 +1000 Subject: [PATCH 1/3] Specify keystore alias and alias password to fix #7054 --- cli/src/android/build.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/src/android/build.ts b/cli/src/android/build.ts index 73c31ebf6f..8b6c3e0b14 100644 --- a/cli/src/android/build.ts +++ b/cli/src/android/build.ts @@ -92,6 +92,10 @@ async function signWithApkSigner( buildOptions.keystorepath, '--ks-pass', `pass:${buildOptions.keystorepass}`, + '--ks-key-alias', + buildOptions.keystorealias, + '--key-pass', + `pass:${buildOptions.keystorealiaspass}`, '--in', `${join(releasePath, unsignedReleaseName)}`, '--out', From fd06a03302cf7894def42e3e7e00bd009a27570a Mon Sep 17 00:00:00 2001 From: Bentley O'Kane-Chase Date: Thu, 21 Dec 2023 11:59:44 +1000 Subject: [PATCH 2/3] Check keystore options are passed in before adding to signing args --- cli/src/android/build.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cli/src/android/build.ts b/cli/src/android/build.ts index 8b6c3e0b14..18a1c1f316 100644 --- a/cli/src/android/build.ts +++ b/cli/src/android/build.ts @@ -92,16 +92,20 @@ async function signWithApkSigner( buildOptions.keystorepath, '--ks-pass', `pass:${buildOptions.keystorepass}`, - '--ks-key-alias', - buildOptions.keystorealias, - '--key-pass', - `pass:${buildOptions.keystorealiaspass}`, '--in', `${join(releasePath, unsignedReleaseName)}`, '--out', `${join(releasePath, signedReleaseName)}`, ]; + if (buildOptions.keystorealias) { + signingArgs.push('--ks-key-alias', buildOptions.keystorealias) + } + + if (buildOptions.keystorealiaspass) { + signingArgs.push('--key-pass', buildOptions.keystorealiaspass) + } + await runTask('Signing Release', async () => { await runCommand('apksigner', signingArgs, { cwd: config.android.platformDirAbs, From c597c4e388f23a68a3300ca52cd0dd3819fd6737 Mon Sep 17 00:00:00 2001 From: Joseph Pender Date: Tue, 2 Jan 2024 12:09:36 -0600 Subject: [PATCH 3/3] fmt --- cli/src/android/build.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/android/build.ts b/cli/src/android/build.ts index 18a1c1f316..01cb5884b0 100644 --- a/cli/src/android/build.ts +++ b/cli/src/android/build.ts @@ -99,11 +99,11 @@ async function signWithApkSigner( ]; if (buildOptions.keystorealias) { - signingArgs.push('--ks-key-alias', buildOptions.keystorealias) + signingArgs.push('--ks-key-alias', buildOptions.keystorealias); } if (buildOptions.keystorealiaspass) { - signingArgs.push('--key-pass', buildOptions.keystorealiaspass) + signingArgs.push('--key-pass', buildOptions.keystorealiaspass); } await runTask('Signing Release', async () => {