0

I have this

KEY_STORE_PATH=/home/userr/mykeystore

jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore "$KEY_STORE_PATH" bin/PName-release-unsigned.apk alias_name

and it doesn't work, after this command the apk file it is not signed...

But when I do this it works just fine

jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore /home/userr/mykeystore bin/PName-release-unsigned.apk alias_name

EDIT: actually what I do is the following

echo ` echo "pass" | jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore "$KEY_STORE_PATH" bin/PName-release-unsigned.apk alias_name`

no I can guess what is the problem but , is there solution for this kind of situation ?

EDIT 2

I did short test

In shell

 #  asd=123
 #  echo `echo $asd`
 #  123

it print 123 correctly so I think something else is the problem

Lukap
  • 31,523
  • 64
  • 157
  • 244
  • 1
    Are you calling both lines from the same shell session or script? – choroba Oct 12 '12 at 09:46
  • @choroba nice question I think I realize the problem, see my edit – Lukap Oct 12 '12 at 10:49
  • Try the following: `echo \`echo jarsigner -verbose -sigalg MD5withRSA -digestalg SHA1 -keystore "$KEY_STORE_PATH" bin/PName-release-unsigned.apk alias_name\``. The point is to see whether the variable is substituted (as it should). Also, please check for a potential typo. Finally, what errors are you getting? – January Oct 12 '12 at 11:16

1 Answers1

0

If you call jarsigner from inside of a subshell / another script, you should export your environmental variable:

export KEY_STORE_PATH=/home/userr/mykeystore
January
  • 16,320
  • 6
  • 52
  • 74