Skip to content

Commit

Permalink
fix: escape keystore_info params passed to bundletool
Browse files Browse the repository at this point in the history
Hi, I tried to use your action but I am currently facing some problems, I keep getting the following error

```sh
[20:59:20]: Bundletool could not extract universal apk from aab at /home/runner/work/***/***/android/app/build/outputs/bundle/release/app-release.aab. 
Error message
 sh: 1: stGAXs: not found
[BT:0.11.0] Error: Incorrect keystore password.
com.android.tools.build.bundletool.model.exceptions.CommandExecutionException: Incorrect keystore password.
	at com.android.tools.build.bundletool.model.SigningConfiguration.extractFromKeystore(SigningConfiguration.java:116)
	at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:457)
	at com.android.tools.build.bundletool.commands.BuildApksCommand.fromFlags(BuildApksCommand.java:417)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:74)
	at com.android.tools.build.bundletool.BundleToolMain.main(BundleToolMain.java:46)
```

After a bit of debugging it looks like the parameters passed down to bundle tools are not escaped, with this simple fix we should now be able to use special chars as a password.

Let me know if something is missing in this pr, thanks for this nice plugin!
  • Loading branch information
pradel authored Oct 13, 2020
1 parent f5d7a93 commit 3651593
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def self.run_bundletool!(aab_path, keystore_info)
keystore_params = ''

unless keystore_info.empty?
keystore_params = "--ks=\"#{keystore_info[:keystore_path]}\" --ks-pass=pass:#{keystore_info[:keystore_password]} --ks-key-alias=#{keystore_info[:alias]} --key-pass=pass:#{keystore_info[:alias_password]}"
keystore_params = "--ks=\"#{keystore_info[:keystore_path]}\" --ks-pass=\"pass:#{keystore_info[:keystore_password]}\" --ks-key-alias=\"#{keystore_info[:alias]}\" --key-pass=\"pass:#{keystore_info[:alias_password]}\""
end

cmd = "java -jar #{@bundletool_temp_path}/bundletool.jar build-apks --bundle=\"#{aab_path}\" --output=\"#{output_path}\" --mode=universal #{keystore_params}"
Expand Down

0 comments on commit 3651593

Please sign in to comment.