Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIMOB-18441] Add --sigalg option on cli for overriding keystore signing algorithm. #9484

Merged
merged 7 commits into from
Oct 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion android/cli/commands/_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,12 @@ AndroidBuilder.prototype.config = function config(logger, config, cli) {
order: 120,
required: true,
values: _t.targets
},
'sigalg': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add a default property with a value of 'MD5withRSA' so that it signifies the default value in the help screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Thank you :)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy, I messed up. Specifying a default will properly show the correct default in the help screen, but then this.sigalg will always have a value and it never falls back to the auto-detected this.keystoreAlias.sigalg.

My apologies. Please remove the default value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh! It's really easy thing. I have committed. Thank you for your kind review. 👍

desc: __('the type of a digital signature algorithm. only used when overriding keystore signing algorithm'),
hint: __('signing'),
order: 170,
values: [ 'MD5withRSA', 'SHA1withRSA', 'SHA256withRSA' ]
}
}
};
Expand Down Expand Up @@ -1796,6 +1802,7 @@ AndroidBuilder.prototype.initialize = function initialize(next) {
this.keystore = argv.keystore;
this.keystoreStorePassword = argv['store-password'];
this.keystoreKeyPassword = argv['key-password'];
this.sigalg = argv['sigalg'];
if (!this.keystore) {
this.keystore = path.join(this.platformPath, 'dev_keystore');
this.keystoreStorePassword = 'tirocks';
Expand Down Expand Up @@ -4313,7 +4320,7 @@ AndroidBuilder.prototype.createUnsignedApk = function createUnsignedApk(next) {
};

AndroidBuilder.prototype.createSignedApk = function createSignedApk(next) {
const sigalg = this.keystoreAlias.sigalg || 'MD5withRSA',
const sigalg = this.sigalg || this.keystoreAlias.sigalg || 'MD5withRSA',
signerArgs = [
'-sigalg', sigalg,
'-digestalg', 'SHA1',
Expand Down
3 changes: 2 additions & 1 deletion android/cli/locales/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"%s options have been %s, please use %s": "%s options have been %s, please use %s",
"Available Emulators:": "Available Emulators:",
"the password for the keystore private key (defaults to the store-password)": "the password for the keystore private key (defaults to the store-password)",
"the type of a digital signature algorithm. only used when overriding keystore signing algorithm": "the type of a digital signature algorithm. only used when overriding keystore signing algorithm",
"What is the keystore's __key password__?": "What is the keystore's __key password__?",
"(leave blank to use the store password)": "(leave blank to use the store password)",
"Bad key password": "Bad key password",
Expand Down Expand Up @@ -372,4 +373,4 @@
"Connected Android Devices": "Connected Android Devices",
"ID": "ID",
"State": "State"
}
}