debug build: META-INF/CERT.SF has invalid digest

Viewed 1244

My debug builds are not installing on some earlier devices. During install, Android is logging an error such as:

java.lang.SecurityException: META-INF/CERT.SF has invalid digest for ...

I'm pretty sure this has something to do with the using SHA1 versus SHA256 in signing the debug APK. It installs on Android 5 and up but not on Android 4.1. My release builds install on both, where I specify to use both V1 and V2 signing.

This problem started happening recently when I updated my development environment. I realize v2 signing has been around for a while, but evidently something got "stuck in the past" during my earlier updates and only now is truly using v2 signing.

Here's a few lines from CERT.SF of an earlier build, which installs on Android 4.1:

Signature-Version: 1.0
X-Android-APK-Signed: 2
SHA1-Digest-Manifest: 5uKyIdhWpwJ5DqL2eY6yywRve60=
Created-By: 1.0 (Android)

Name: res/drawable-hdpi-v4/task_priority_full_mask.png
SHA1-Digest: mgbQEI7yIlWN/S81eXILs9yQsx0=

Name: res/layout/intrinsic_calendar_item.xml
SHA1-Digest: fDHWqyZu4G7746oUndD2w3+SEpU=

Name: res/drawable-hdpi-v4/call_outgoing.png
SHA1-Digest: qjFodzSd/IiusVuP/fmJp8AMwpM=

And, here's a few lines from the new CERT.SF, which fails to install:

Signature-Version: 1.0
X-Android-APK-Signed: 2
SHA-256-Digest-Manifest: oYH6iW7P/SZv6wI2m3sLn/GAfEtKxfO8gok/TVB6n1Y=
Created-By: 1.0 (Android)

Name: res/drawable-hdpi-v4/task_priority_full_mask.png
SHA-256-Digest: LfLVegeMx7B2i8CF5ctrZ+Ab2FHqlpxVPJgsgojbp6A=

Name: res/layout/intrinsic_calendar_item.xml
SHA-256-Digest: 5hrCEplQJgsiRbbJssNvd8faCTkHGAmAptub/ZPHPdk=

Name: res/drawable-hdpi-v4/call_outgoing.png
SHA-256-Digest: EXwgtHDkKbPUezjL9rOuuButu4w7E6e5r9YMTGxQhh8=

Notice that the newer version has a SHA-256 digest whereas the older version has a SHA1 digest.

0 Answers
Related