This technique details how to ensure that your .apk has been signed with your developer certificate, and leverages the fact that the certificate remains consistent and that only you have access to it.
We can break this technique into 3 simple steps:
Find your developer certificate signature.
Embed your signature in a String constant in your app.
Check that the signature at runtime
matches our embedded developer signature.
Here's the code snippet:
This modified text is an extract of the original Stack Overflow Documentation created by following contributors and released under CC BY-SA 3.0