Hi all,
one way to extend what Hamo suggests above is to have the customer log in to your website and input its "unique" device ID; a function will calculate an hash value based on some secret code combined with the device ID and return this token.
Once the user inputs the token in your app it is recorded on the device (just to not ask it at each run) and compared with the result from an identical hash function embedded in the code. If they match the app will go from "pirate or demo" version to "regular version".
The above will protect against simple apk sharing between users, not from a real pirate.
Just had a thought... what if I could set a 'destruction date' for the app for example app dies on Dec 31, 2015 > On that date, numerous 'things' could happen to the app... just pondering what exactly In my case, it would have to disrupt the 1 (and only) activity in the app.
Wondering if anyone has clever ideas to make this happen?
Idea 1: load new layout if date = Dec 31, 2015 (if this is possible)
The problem is that real "pirates" decompile the whole app and then make changes to it, removing such protections.
There is no 100% secure app against real pirates
Even if you download the entire code and then execute it, they can alter the code, redirecting to their servers for the download, using a proxy.
You could do that easily. When the user starts the app, the app compares the date and if the "date > destruction" date, then the app will force close or show a message.
But beware: "Pirates" could change that date to 2099 or someting like that. Whatsapp do such checks, forcing that you have downloaded the newest version in order to use it. But there are hacked versions on the web, where they put that date to 2099.