Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to resolve invalid SHA1 signature when signing the Android app?

Tags:

android

When I verify the signature of my application:

jarsigner -verify -verbose -certs testapp.apk

it gives me the error:

jarsigner: java.lang.SecurityException: invalid SHA1 signature file digest for res/drawable-xhdpi/breadcrumb_grey_white.png

How to resolve this?

like image 447
ChanGan Avatar asked Dec 09 '22 00:12

ChanGan


2 Answers

make sure to delete the META_INF folder in the apk before signing it. Also, if you are using JDK 7, then include the the option -sigalg MD5withRSA when signing with the jarsigner along with -digestalg SHA1 mentioned by Andrejs

like image 145
Padmanabha V Avatar answered May 14 '23 11:05

Padmanabha V


Ripped from here.

Here is the solution:

jarsigner -keystore mykeystore -digestalg SHA1 jarfile alias

To verify:

jarsigner -verify -verbose -certs jarfile
like image 43
Andrejs Cainikovs Avatar answered May 14 '23 11:05

Andrejs Cainikovs