Ever since the App store has come about, people have wanted to crack apps so they don't have to pay for them. The most famous app or this to happen to is Super Monkey Ball, but now almost every paid app is online for people to download for free. It seems developers such as you and me are losing the fight, but are we?
There are a couple of ways to find out whether the app a user is running is cracked, and you can implement this in your app so you obtain all the money you deserve (the procedure is taken from the website at the bottom of the post).
There are 3 approaches to detecting a cracked app at runtime. If you downloaded your cracked app (IPA) from somewhere like RapidShare then you'll notice that the timestamps of Info.plist and your application binary are different.
To stop hackers, we'll look at Info.plist modifications. There are a few easy checks that you can perform at runtime to see if your Info.plist has been modified after you've built a distribution release:
Check the size of Info.plist. You know the size of the file after it's been built so hardcode a check into your application, rebuild for distribution, and push to the App Store.
Check if Info.plist is plaintext XML. The distribution copy is converted to a binary .plist and most IPA cracks convert this file back to either UTF-8 or ASCII. Again, do this check in your application before pushing it to the App Store.
Why the hell are they modifying Info.plist anyway? Well... the cracker added the key-pair {SignedIdentity, Apple iPhone OS Application Signing} to this file. Check for this modification at runtime - it shouldn't be there!
The first two points are simple and are left as an exercise for you intrepid and enterprising App Store developers.
The third and last point is what I'll expand on below.
Quote:
|
{SignedIdentity, Apple iPhone OS Application Signing}
|
Well what the hell is that doing in your Info.plist? It's not part of the XCode template and it's definitely not something that you put in there.
This key-value pair basically tells the application loader that the application is decrypted and can be trusted. Consider it to be a skeleton key that lets you run any application on the iPhone.
I'm not sure of the implementation details of the application loader so don't bother asking me.
The one thing for certain is that THIS KEY-VALUE PAIR SHOULD NOT BE IN ANY APP STORE APPLICATION. If you do find it during runtime then you know your application has been compromised.
Below is some rudimentary code that checks if this key-value pair is present in your application bundle's Info.plist.
Quote:
NSBundle *bundle = [NSBundle mainBundle];
NSDictionary *info = [bundle infoDictionary];
if ([info objectForKey: @"SignedIdentity"] != nil)
{
/* do something */
}
|
Now you're going to say, how come you're not checking for the value of the key-value pair? Well, I say, you don't need to. If you didn't put that key-value pair into your Info.plist then you definitely didn't put that key in.
Source:
How to Thwart iPhone IPA Crackers