Reality check – people are going to steal your game. For whatever reason they do it, you probably want to do something in response. Let's suppose that we want to detect whether or not someone has pirated our application and if they have stream them an advertisement movie from the web before continuing to a demo version of our application.
Let's walk through the steps that would be necessary for this application functionality:
void Start () { if ( iPhoneUtils.isApplicationGenuine ) { Application.LoadLevel("RegularGame"); } else { Application.LoadLevel("DemoLevel"); } }
We can determine if our application hasn't been signed by Apple by checking the iPhoneUtils.isApplicationGenuine
property. It is important to note that when you're building the application on your local machine it will return false
. It will not return true
until it has been signed by Apple and is on its way to the AppStore. Therefore, you do not want to simply check to see if the application is genuine and then refuse to load if it isn't as the reviewer may determine that your app doesn't work and then reject it accordingly.
When the unity player starts we check to see if this is an authentic version of our application. If Unity detects that the application has been tampered with it will send the user to an ad and a demo version of the game.
But let's stop for a second. Pirates will STILL be able to get around this and they will be able to write a specific patch for your application. At this time there is no fool-proof mechanism for detecting or preventing piracy of any iOS application. As long as an iOS device can be jailbroken, people can get around any mechanism you put in place to prevent piracy. I put this example in here so that you will have some idea about creative ways to work with the reality of the situation, but don't expect that this alone will prevent piracy of your app.
18.118.0.240