title: Signing application with Jenkins
body: <p>Usually I sign my application through Eclipse, with the Android Tools -> Export Signed Application.</p>
  
  <p>Now, I want to use Jenkins to automatically build and sign my application.
  Therefore I have installed Jenkins on a Mac Mini and created a file <code>ant.properties</code> with my keystore credentials. But signing my application with Jenkins fails:</p>
  
  <pre><code>BUILD FAILED
  The following error occurred while executing this line:
  Keystore was tampered with, or password was incorrect: Password verification failed
  </code></pre>
  
  <p>Currently I have 2 issues which could be causing the signing to fail:</p>
  
  <p><strong>1) My Alias contains a space</strong></p>
  
  <p>But since I use "" (quotes) I don't think this should be the problem.</p>
  
  <p><strong>2) My Keystorepass contains a non-utf8 character</strong></p>
  
  <p>Here's my <code>ant.properties</code> files, used for signing with Jenkins
  <code>ant.properties</code>:</p>
  
  <pre><code>key.store=mykey.store
  key.alias="My Alias"
  key.store.password=*€*
  key.alias.password=***
  </code></pre>
  
  <p>As you can see, I have a non-utf8 character which I think is causing the signing process to fail. When using Eclipse, I can just copy and paste my password and everything works as expected. But with Jenkins it fails everytime.</p>
  
  <p><strong>Tried so far:</strong></p>
  
  <p>I tried to manually sign my application through the command line (on windows 7) and jarsigner by using this line (note, the € sign is replaced by a ? on my windows 7 cmd line, when i paste the password):</p>
  
  <pre><code>jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mykey.store MyApp.apk "My Alias" -storepass *?* -keypass ***
  </code></pre>
  
  <p>And this works. </p>
  
  <p>However, my Jenkins installation runs on a mac mini, where the same command asks me to input my keystore pass. When I enter my pass, or copy/paste it, it gives me the following error:</p>
  
  <pre><code>RuntimeException: keystore load: keystore was tampered with, or password was incorrect
  </code></pre>
  
  <p><strong>Strange</strong></p>
  
  <p>Due to the password having a non-utf8 character, it appears different on each platform when I copy and paste it. E.g. currently I have seen the following characters:</p>
  
  <pre><code>WINDOWS TXT FILE (ORIGINAL): *€*
  WINDOWS PASTE IN CMD: *?*
  MACMINI OPEN ORIGINAL FILE: *Ä*
  </code></pre>
  
  <p>Any suggestions?</p>