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

Fix jarsigner executing on Windows environment #640

Merged
merged 1 commit into from
Jan 31, 2015
Merged
Changes from all 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: 6 additions & 2 deletions src/app/FakeLib/XamarinHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,14 @@ let AndroidSignAndAlign setParams apkFile =
if param.KeystoreAlias = "" then failwith "You must provide the keystore's alias"

param


let quotesSurround (s:string) = if EnvironmentHelper.isMono then sprintf "'%s'" s else sprintf "\"%s\"" s

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}", param.KeystorePath, param.KeystorePassword, fullSignedFilePath, file.FullName, param.KeystoreAlias)
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)

executeCommand param.JarsignerPath jarsignerArgs

let fullAlignedFilePath = Regex.Replace(fullSignedFilePath, "-Signed.apk$", "-SignedAndAligned.apk")
Expand Down