Time for action – Yarr! There be pirates!

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:

  1. The first step in this process is to create a demo scene.
  2. In this scene put all of your assets that you want to comprise this scene. In my case I'll create a simple scene that displays a simple puppy sitting by some rocks. You can control the puppy and move him around the scene.
  3. Now let's create a demo version of the scene. For demo purposes I'll use the same puppy, but I will just set him up in a sleep animation loop in this scene. Whenever a user enters the demo world, all the puppies that they find will be asleep.
  4. Based on conditional logic, display the demo scene.
    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.

What just happened?

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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.0.240