0
votes

I am trying to add some custom build steps to eclipse build when build my android project.

For this I have added a new ant build task to Project Properties->Builders

The ant build unpacks the apk, changes some files, zips it back, and then use jarsigner to sign it.

However I am getting "please specify alias name" when it tries to sign using jarsigner. If I do this outside the eclipse this works properly.

Any help is really appreciated. I am struggling on this for two days now.

Ant task

<exec executable="C:\Program Files\Java\jdk1.7.0_03\bin\jarsigner.exe" dir="E:\Android\trunk\Source">
    <arg value=" -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore &quot;E:\Android\trunk\Builder\MyKeyStore&quot; -storepass &quot;password&quot; -keypass &quot;password&quot; &quot;E:\Android\trunk\Source\bin\MyProject.apk&quot; keystorealias" />
</exec>

Output

 [exec] 
 [exec] Please type jarsigner -help for usage
 [exec] Please specify alias name
 [exec] Result: 1
1

1 Answers

0
votes

Found a way to do it and thought of posting so that it could help others. I used SignJar ant task. It works without any issue with the same set of arguments.