Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect if iOS app hacked

My friend got a jailbroken iPad. When he installed Business Model Generation App from Installous and tried to use it, the application showed a UIAlertView with the following message: Hacked Version

Does anybody know how to do that?

I have 2 ideas:

  1. If there is some set flag when you download app from the App Store, then you can use this flag: if flag = NO, you show the UIAlertView.
  2. Something with a server (but in this case, you should know all device IDs and who installed your application from the App Store).

Am I right? How can I implement this feature?

like image 713
Eugene Trapeznikov Avatar asked Jul 23 '12 09:07

Eugene Trapeznikov


2 Answers

You can detect two files: SC_Info and iTunesMetadata.​plist.

If you can't find them, then your app was pirated: these files are installed after downloading from the App Store.

This is the code to check:

NSString * bundlePath = [ [NSBundle mainBundle] bundlePath ];
if ( ! [ [NSFileManager defaultManager] fileExistsAtPath: ( @"%@/SC_Info", bundlePath ) ] )
{
    // jailbroken
}
if ( ! [ [NSFileManager defaultManager] fileExistsAtPath: ( @"%@/iTunesMetadata.​plist", bundlePath ) ] )
{
    // jailbroken
}
like image 172
Eugene Trapeznikov Avatar answered Oct 06 '22 23:10

Eugene Trapeznikov


There are some libraries around which can detect if an app is cracked (and jailbroken as well), this question gives a good overview but basically its done by checking the signer identity

one library is AntiCrack. I havent used this library so I dont know how well it works

like image 32
wattson12 Avatar answered Oct 06 '22 23:10

wattson12