You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/07/05 13:09:59 UTC

[GitHub] [cordova-android] ttencate opened a new issue #761: Password from keystore password prompt is not used, placeholder "__unset" used as actual keystore password

ttencate opened a new issue #761: Password from keystore password prompt is not used, placeholder "__unset" used as actual keystore password
URL: https://github.com/apache/cordova-android/issues/761
 
 
   # Bug Report
   
   ## Problem
   
   ### What is expected to happen?
   
   Without specifying `"storePassword"` or `"password"` in `build.json`, `cordova build android --release` will prompt for the password, and that password should be used to access the keystore.
   
   ### What does actually happen?
   
   We get an error, even if the password was typed correctly:
   
   ```
   > com.android.ide.common.signing.KeytoolException: Failed to read key my_key from store "my.keystore": Keystore was tampered with, or password was incorrect
   ```
   
   ## Information
   <!-- Include all relevant information that might help understand and reproduce the problem -->
   
   If I change both passwords in the store to `__unset` (which is used in `app/build.gradle`), then the signing step completes successfully, regardless of which password I entered in the prompt.
   
   ### Command or Code
   <!-- What command or code is needed to reproduce the problem? -->
   
   ```sh
   $ cordova create my_app
   $ cd my_app
   $ cordova platform add android
   $ echo '{"android": {"release": {"keystore": "my.keystore", "alias": "my_key"}}}' > build.json
   $ keytool -genkey -keystore my.keystore -alias my_key -v -keyalg RSA -keysize 2048 -validity 10000 -keypass testtest -storepass testtest
   # Press Enter until "[no]" appears, then type "[yes]"
   $ cordova build android --release
   # Enter "testtest" at both password prompts
   ...
   Execution failed for task ':app:packageRelease'.
   > com.android.ide.common.signing.KeytoolException: Failed to read key my_key from store "/tmp/repro/my_app/my.keystore": Keystore was tampered with, or password was incorrect
   ```
   
   But if the passwords happen to be `__unset`, it's better:
   
   ```sh
   $ rm my.keystore 
   $ keytool -genkey -keystore my.keystore -alias my_key -v -keyalg RSA -keysize 2048 -validity 10000 -keypass __unset -storepass __unset
   # Press Enter until "[no]" appears, then type "[yes]"
   $ cordova build android --release
   ...
   43 actionable tasks: 2 executed, 41 up-to-date
   Built the following apk(s): 
   	/.../my_app/platforms/android/app/build/outputs/apk/release/app-release.apk
   ```
   
   ### Environment, Platform, Device
   <!-- In what environment, on what platform or on which device are you experiencing the issue? -->
   
   Arch Linux on x86_64
   
   ### Version information
   <!-- 
   What are relevant versions you are using?
   For example:
   Cordova: Cordova CLI, Cordova Platforms, Cordova Plugins 
   Other Frameworks: Ionic Framework and CLI version
   Operating System, Android Studio, Xcode etc.
   -->
   
   * Cordova CLI 9.0.0
   * Cordova lib 9.0.1
   * Cordova Android 8.0.0
   * Android SDK build tools 29.0.0
   
   ## Checklist
   <!-- Please check the boxes by putting an x in the [ ] like so: [x] -->
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org