Reputation: 397
Recently Google has introduced security metadata that is added to every app uploaded into Google Play. We used to have a tampering protection that's calculating the app's signature (hash) in runtime and check if it's equal to hash that was calculated during the release. This worked fine for years, but now the GP is modifying the app's binary by adding the security metadata.
Upvotes: 1
Views: 672
Reputation: 13842
Another option which works if you occasionally have online access (which I assume you do if you are checking a hash) is to use the SafetyNet attestation API to check your app, and verify the signature offline on the server. Again, many big name developers use this successfully.
Upvotes: 2
Reputation: 17437
Not directly answering your questions, sorry, but posting anyway in case that helps you or anyone else in the same case: instead of checking the hash, have you considered verifying the signature of the APK? Apksig is an open source library and would allow you to achieve a similar result in a more robust way.
Upvotes: 0