Skip to content

Commit

Permalink
Merge pull request #1025 from Dexyon/master
Browse files Browse the repository at this point in the history
Allow override of the signature algorithm and message digest algorithm
  • Loading branch information
forki committed Dec 1, 2015
2 parents d863a4b + 4e9c08c commit 6a15fe0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/app/FakeLib/XamarinHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,10 @@ type AndroidSignAndAlignParams = {
KeystorePassword: string
/// (Required) Alias for keystore
KeystoreAlias: string
/// Specifies the name of the signature algorithm to use to sign the JAR file.
SignatureAlgorithm: string
/// Specifies the name of the message digest algorithm to use when digesting the entries of a JAR file.
MessageDigestAlgorithm: string
/// Path to jarsigner tool, defaults to assuming it is in your path
JarsignerPath: string
/// Path to zipalign tool, defaults to assuming it is in your path
Expand All @@ -272,6 +276,8 @@ let AndroidSignAndAlignDefaults = {
KeystorePath = ""
KeystorePassword = ""
KeystoreAlias = ""
SignatureAlgorithm = "SHA1withRSA"
MessageDigestAlgorithm = "SHA1"
JarsignerPath = "jarsigner"
ZipalignPath = "zipalign"
}
Expand All @@ -292,8 +298,8 @@ let AndroidSignAndAlign setParams apkFile =

let signAndAlign (file:FileInfo) (param:AndroidSignAndAlignParams) =
let fullSignedFilePath = Regex.Replace(file.FullName, ".apk$", "-Signed.apk")
let jarsignerArgs = String.Format("-sigalg SHA1withRSA -digestalg SHA1 -keystore {0} -storepass {1} -signedjar {2} {3} {4}",
quotesSurround(param.KeystorePath), param.KeystorePassword, quotesSurround(fullSignedFilePath), file.FullName, param.KeystoreAlias)
let jarsignerArgs = String.Format("-sigalg {0} -digestalg {1} -keystore {2} -storepass {3} -signedjar {4} {5} {6}",
param.SignatureAlgorithm, param.MessageDigestAlgorithm, quotesSurround(param.KeystorePath), param.KeystorePassword, quotesSurround(fullSignedFilePath), file.FullName, param.KeystoreAlias)

executeCommand param.JarsignerPath jarsignerArgs

Expand Down Expand Up @@ -347,4 +353,4 @@ let iOSArchive setParams =

iOSArchiveDefaults
|> setParams
|> archiveProject
|> archiveProject

0 comments on commit 6a15fe0

Please sign in to comment.