Change system applications: original AndroidManifest.xml is required, but why?

Basic steps for editing the APK system:

  • Make a backup copy of the APK.
  • Decompile the working APK.
  • Makes a change.
  • Recompile the working APK.
  • Copy / paste both the META-INF folder and AndroidManifest.xml from the backup APK (which never decompiled) to the recompiled working APK. Done!

META-INF contains a signature: it makes sense. But what is the purpose of AndroidManifest.xml in keeping the original signature? I tested this myself, and Android did not load the APK with recompiled AndroidManifest.xml (i.e., the original AndroidManifest.xml would not be)

Many manuals indicate the need to copy both META-INF and AndroidManfest.xml from the original APK to the modified APK.

The closest answer I found is that recompiling corrupts AndroidManifest.xml (see http://rootzwiki.com/topic/268-guide-newbies-how-to-port-themes/ ), but I compared the original and the message -recompiling AndroidManifest.XML, and they are identical (says WinMerge, and they have the same MD5 and SHA1 hashes). Another person ( http://miuiandroid.com/community/threads/q-remove-miui-torch-app.16013/ ) suggests that META-INF and AndroidManifest.xml are somehow related to each other.

Everyone does this, but does anyone know why?

+4
source share
1 answer

When checking the APK system, Android verifies the signature of a subset of the files in the APK to make sure they have not been tampered with. These files include AndroidManifest.xml , classes.dex and others. If the SHA-1 digests (stored in META-INF/MANIFEST.MF and META-INF/CERT.SF ) of the source files do not match the digest of files in the modified APK, then Android will refuse to download the APK.

+1
source

All Articles