Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/Xamarin.Android.Build.Tasks/Tasks/AndroidSignPackage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ public class AndroidSignPackage : AndroidToolTask

public string TimestampAuthorityCertificateAlias { get; set; }

protected override string GenerateCommandLineCommands ()
public string SigningAlgorithm { get; set; }

protected override string GenerateCommandLineCommands ()
{
var cmd = new CommandLineBuilder ();

Expand All @@ -42,8 +44,8 @@ protected override string GenerateCommandLineCommands ()
cmd.AppendSwitchIfNotNull ("-storepass ", StorePass);
cmd.AppendSwitchIfNotNull ("-keypass ", KeyPass);
cmd.AppendSwitchIfNotNull ("-digestalg ", "SHA1");
cmd.AppendSwitchIfNotNull ("-sigalg ", "md5withRSA");
cmd.AppendSwitchIfNotNull ("-signedjar ", String.Format ("{0}{1}{2}-Signed-Unaligned.apk", SignedApkDirectory, Path.DirectorySeparatorChar, Path.GetFileNameWithoutExtension (UnsignedApk)));
cmd.AppendSwitchIfNotNull ("-sigalg ", string.IsNullorWitespace(SigningAlgorithm) ? "md5withRSA" : SigningAlgorithm);
cmd.AppendSwitchIfNotNull ("-signedjar ", String.Format ("{0}{1}{2}-Signed-Unaligned.apk", SignedApkDirectory, Path.DirectorySeparatorChar, Path.GetFileNameWithoutExtension (UnsignedApk)));

cmd.AppendFileNameIfNotNull (UnsignedApk);
cmd.AppendSwitch (KeyAlias);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2439,6 +2439,7 @@ because xbuild doesn't support framework reference assemblies.
ToolExe="$(JarsignerToolExe)"
TimestampAuthorityUrl="$(JarsignerTimestampAuthorityUrl)"
TimestampAuthorityCertificateAlias="$(JarsignerTimestampAuthorityCertificateAlias)"
SigningAlgorithm="$(_ApkSigningAlgorithm)"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we should use ApkSigningAlgorithm rather than _ApkSigningAlgorithm. In msbuild the convention is _ prefixed properties are private and should not be used by the end user. Ones without are public. So we should remove the _ since we expect the user to override this.

/>
<Message Text="Signed android package '$(ApkFileSigned)'" />
<ItemGroup>
Expand Down