fix(cli): remove literal quotes from keystore path and passwords when calling apksigner/jarsigner
Fixes an issue causing apksigner/jarsigner to fail when the keystore is created by bubblewrap init. The CLI previously passed passwords and keystore path with literal quotes that became part of the values passed to apksigner and jarsigner. This caused Java KeyStore decryption to fail with BadPaddingException.
This change removes the literal quotes before calling apksigner and jarsigner and adds a unit test to ensure passwords are passed without quotes.
Changes:
- Remove literal quoting of signing key path and passwords in
packages/cli/src/lib/cmds/build.ts. - Export
Buildclass to facilitate unit testing. - Add
packages/cli/src/spec/lib/cmds/BuildSpec.tsunit test that mocks AndroidSdkTools/JarSigner and asserts unquoted passwords are passed.
How to test manually:
- Run
bubblewrap init, choose to create a new keystore and use any password. - Run
bubblewrap buildand verify it succeeds and apksigner/jarsigner do not produce BadPaddingException.
This PR includes tests; CI should be run to validate behavior.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).
View this failed invocation of the CLA check for more information.
For the most up to date status, view the checks section at the bottom of the pull request.