Helpful Anti-Piracy Code

Hey guys, I stumbled into a little snippet of code on how to detect if your app is pirated or not. I added a few features into it and here it is:

Add this to AppController.mm (about 75% of the way down) under “applicationDidFinishLaunching”

NSBundle *bundle = [NSBundle mainBundle];
	NSDictionary *info = [bundle infoDictionary];
	if ([info objectForKey: @"SignerIdentity"] != nil)
	{
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"YOUR TITLE" message:@"YOUR MESSAGE"
												   delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
	[alert show];	
	[alert release];
	}

This checks to see if the app has been cracked. If the app has been cracked, it opens up a little alert window (which you can modify to say whatever you want) with an okay button.

Here’s the landscape version:

NSBundle *bundle = [NSBundle mainBundle];
	NSDictionary *info = [bundle infoDictionary];
	if ([info objectForKey: @"SignerIdentity"] != nil)
	{		
		[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO ];
		
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"A Message From AppStoreGamer" message:@"We are aware this is a pirated version of our app. We will continue to allow you to use this application, just remember it takes a lot of time and effort to produce what you are about to use."
												   delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
	[alert show];	
	[alert release];
	}

and here’s my own little version which incorporates part of the Flurry API (a great analytical program for iPhone apps). If the app is cracked, it sends the Flurry servers a “Pirate” string in which you can keep count how many pirates vs legit users you have. (this one’s landscape)

NSBundle *bundle = [NSBundle mainBundle];
	NSDictionary *info = [bundle infoDictionary];
	if ([info objectForKey: @"SignerIdentity"] != nil)
	{
		[FlurryAPI logEvent:@"Pirate"];
		
		[[UIApplication sharedApplication] setStatusBarOrientation: UIInterfaceOrientationLandscapeRight animated: NO ];
		
		UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"A Message From AppStoreGamer" message:@"We are aware this is a pirated version of our app. We will continue to allow you to use this application, just remember it takes a lot of time and effort to produce what you are about to use."
												   delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
	[alert show];	
	[alert release];
	}

Hope this helps you guys!

Here’s some pics just to show the functionality of it (btw, the dialog box does NOT come up if the app was bought from the App Store. ONLY if it is cracked)

173181--6217--$img_0088_962.png
173181--6218--$img_0087_160.png

Is there a way that people playing pirated versions can be url’d to meatspin?

If you don’t know what meatspin is… Don’t google it. Don’t ask.

OH MY GOD! I didn’t think any1 really knew about meatspin!

HAHAHAHAHAHA

A great idea, but I think it uses flash (idk, I haven’t exactly checked)

It does use Flash.

But at least the tanlines are gorgeous. :shock:

There’s already an existing thread about this same topic:

http://forum.unity3d.com/viewtopic.php?t=20259

Crack detection, that is, not meatspin.

Haha Meatspin, really funny.

i know this is a super old thread,and you can’t say “don’t ask” because it makes you want to ask even more, what is Meat spin?

i’m at work sooooo thanks guys. googled it, opened it. Massive panic attack.