How to update digests in Android MANIFEST.MF?
-
29-09-2019 - |
Pergunta
We need to enable our customers to update some components in Android application, like icon/logo, dictionary file etc.
I saw the .APK can be opened like a JAR with 7-zip, and hope files can be edited/replaced there. But it is need to update MANIFEST.MF file in it, containing a digest for each .APK component' like:
Manifest-Version: 1.0 Created-By: 1.0 (Android)
Name: res/raw/icon.png SHA1-Digest: 6Un2G/VIkYfIGfMxruadIHtDABc=
Name: res/raw/logo.png SHA1-Digest: zsIQqGWSu9w5m7gsl0jQoziy7JA= ...
How to update these digests?
Solução
The SHA1-digest entries are base64-encoded strings of digests computed using SHA1 algorithm. You'll also have to update Cert.rsa and Cert.sf though, the .rsa file contains the actual digital signature. You can start with http://java.sun.com/developer/Books/javaprogramming/JAR/sign/intro.html for more info.