bubblewrap icon indicating copy to clipboard operation
bubblewrap copied to clipboard

fix(cli): remove literal quotes from keystore path and passwords when calling apksigner/jarsigner

Open BigodeHR opened this issue 3 months ago • 1 comments

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 Build class to facilitate unit testing.
  • Add packages/cli/src/spec/lib/cmds/BuildSpec.ts unit test that mocks AndroidSdkTools/JarSigner and asserts unquoted passwords are passed.

How to test manually:

  1. Run bubblewrap init, choose to create a new keystore and use any password.
  2. Run bubblewrap build and verify it succeeds and apksigner/jarsigner do not produce BadPaddingException.

This PR includes tests; CI should be run to validate behavior.

BigodeHR avatar Nov 27 '25 19:11 BigodeHR

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.

google-cla[bot] avatar Nov 27 '25 19:11 google-cla[bot]