Question

I want to use that anti piracy code for my app.

NSString* bundlePath = [[NSBundle mainBundle] bundlePath];
BOOL fileExists = [[NSFileManager defaultManager] fileExistsAtPath:(@"%@/_CodeSignature", bundlePath)];
if (!fileExists) {
    //Pirated
    NSLog(@"Pirated");
}
BOOL fileExists2 = [[NSFileManager defaultManager] fileExistsAtPath:(@"%@/CodeResources", bundlePath)];
if (!fileExists2) {
    //Pirated
    NSLog(@"Pirated2");
}
BOOL fileExists3 = [[NSFileManager defaultManager] fileExistsAtPath:(@"%@/ResourceRules.plist", bundlePath)];
if (!fileExists3) {
    //Pirated
    NSLog(@"Pirated3");
}

Has anyone used it before? Can it be used for some basic protection, or is it just crap? What suggestions do you have on this topic?

Was it helpful?

Solution

My two cents is that I think you are going to spend a lot of time trying to stop something that you cannot fully stop. From what is said in some of the comments it sounds like you are concerned about piracy because there are a lot of jailbroken phones in Greece. Greece is just one part of the world and I suspect if you stop thinking locally and start thinking globally you will find that the majority of phones are not jailbroken and are running legit apps.

My suggestion would be to concentrate on those customers who will pay. Spend your time making your app so appealing that they will jump at the chance to buy it.

Second, I would suggest that you look for ways to endear the jailbreakers so that they like your app and want to give you money or buy it. There is a lot of discussion on the net about new business models and how the older piracy hating models are just not working. Hunt around and I think you will find cases where people have embraced the fact that their product is being copied and used it to their advantage. Can you pull off the same trick? If you can, then concerns about piracy will disappear and the people concerned will quite likely become an asset rather than a liability.

Just my thoughts :-)

OTHER TIPS

It's better than nothing. Note that it can be very easily worked around by just creating empty files with the corresponding names. And figuring out said filenames is easy, someone could just use strings on your binary.

I've used this code in apps before, but I don't stop the pirate from using my app. I just have a message displayed to try and guilt the user into purchasing the app.

If you really want to prevent pirates from using your app you should check the encryption of your app binary. Like this: http://landonf.bikemonkey.org/2009/02/index.html

It can be used if the cracker algorithm is not smart enough to add fake ResourceRules etc. files.

Checkout mtiks for Mobile app anti-piracy and real-time analytics. Completely free for developers. It takes only 5 minutes to integrate the library.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top