What is the purpose of signing .apk files?

54 Views Asked by At

I read that .apk files have to be signed for the security reasons, but how does it prevent me from using apktool to add anything I want to the .apk and then using a different tool to sigh it and then distribute it?

How does it make it secure?

1

There are 1 best solutions below

0
Robert On

APK files are signed to make the update process secure.

If you have an app installed and want to update it to a newer version Android enforces that the update APK file contains an APK signature generated by the same private key as the original installed APK file.

This prevent attacks where people publish unofficial "special versions" (malicious) of common apps and decoy users of the app to install this unofficial update and get access to the app internal data like authentication data or other sensitive data.

And that you can modify an APK using apktool and the resign it with a different key and it still works is because the app developer forgot to use the existing functions to verify the app is properly signed with the correct signature key.