@Alapjeet I think he is checking packages names and storing them in a variable… And if someone tries to hack he checks its package name is same as of original if not then he sets values to zero
And most probably also chcking the presence of lucky patcher in app list
If its pressent then we can set app not to run just quit. Something similar
The simple solution that I think for security is calling the values from online server everytime instead of storing in a variable. Like points, coins, gems, etc. This way if anyone modified the values, it will just be the change in the design. The value will still remain the original on the server.
Also using a local DB for these things is not a good idea.