Skip to content

Commit

Permalink
Merge pull request #640 from rflechner/AndroidSigning
Browse files Browse the repository at this point in the history
Fix jarsigner executing on Windows environment
  • Loading branch information
forki committed Jan 31, 2015
2 parents dcc0a24 + 1b584a0 commit 3a0a0bd
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 3a0a0bd

Please sign in to comment.