0

I signed my apk using the command:

jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore MyFocusKeystore.keystore C:\Users\Public\Documents\Unity_Projects\Shapes\Focus.apk myfocus

and zipaligned it using the command:

zipalign -v 4 "C:\Program Files\Android\Android Studio\jre\bin\Focus.apk" "C:\Program Files\Android\Android Studio\jre\bin\Focus-zipaligned.apk"

I verified everything and uploaded it in Google Developer Console. But I got the below upload error:

RSA uses digest algorithm SHA-256 and signature algorithm RSA which is not supported on API Level(s) 16-17 for which this APK is being verified.

Error that I got in Google Developer Console

Could someone help me fix this problem? Thanks in advance!

Fredrik Widerberg
  • 3,068
  • 10
  • 30
  • 42
Aravind
  • 31
  • 2
  • 11

1 Answers1

1

Add the flag -sigalg SHA1withRSA to the command.

The default value of this flag is SHA256withRSA and SHA256 is not supported on SDK 16 and 17 apparently.

Note that if you switch to using apksigner (available in SDK Tools) to sign your app, you won't have to think about this since it will automatically select the best algorithms for your app based on the minSdkVersion. If you decide to switch (which I'd recommend you to), keep in mind that you'll need to sign after you zip-align.

Pierre
  • 15,865
  • 4
  • 36
  • 50
  • Is it like this: jarsigner -verbose -sigalg=SHA1withRSA -digestalg SHA1 -keystore MyFocusKeystore.keystore Focus.apk mygame ?? If not could you rewrite my command with your suggestion?please? – Aravind Aug 10 '18 at 23:01
  • That's right. You probably don't need the "=" sign actually, I realize. I'll update my answer. – Pierre Aug 10 '18 at 23:33
  • But that's how I did initially right?check my question description – Aravind Aug 10 '18 at 23:48
  • Anyway...I did it with apksigner manually and uploaded the apk successfully :) – Aravind Aug 10 '18 at 23:50
  • Mhm, that's strange then. Maybe you had previously signed the APK without the -sigalg flag? I don't know. Glad you sorted it out eventually :) – Pierre Aug 11 '18 at 05:15