I do check sum of classes.dex in native code as indicated here: Check .apk-signature in C/native Code
- Calculate checksum of classes.dex
- compare with hardcoded value - xxx
- if it's true, pass and go on
- if it's not true, exit the app
What I do is log the checksum value for the first build, then change the if (checksum == xxx) in native code to be the same as the logged value.
However, with using Dexguard, the checksum is different for every different build, means that if I change xxx, and generate the signed apk again, the check will always be false. I think Dexguard generate something random into the classes.dex that makes every build different.
Any ideas to get around this problem ? Thanks