0

I am developing an iPhone application which is used for business purposes and it is storing many number of records in SQlite database. So my client don't want the app to run on the jailbroken devices.

So how to identify the jail broken devices during the app launch and preventing the user from proceeding further by showing some message.

Thanks in advance.

Jeevan
  • 15
  • 1
  • 7

1 Answers1

5

You can detect through code that if the app is running on a jail broken device or not.
Through that way you can pop up a alert and close the app.
You can do whatever you want to do.

Here is a tutorial for it.

Detection

NSString *filePath = @"/Applications/Cydia.app";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
{
   // do something useful
}

Also if you want complete solution you can see in tapjoy sdk code.

They are detecting jailbroken iphone.

Here is tapjoy URL tapjoy

Fls'Zen
  • 4,594
  • 1
  • 29
  • 37
  • Thanks for immediate response and i will try this... – Jeevan Apr 18 '13 at 13:14
  • Grt Tarun..+1 for nice ans – SRam Apr 18 '13 at 13:20
  • 3
    Good answer but incomplete. This code will check if Cydia application is installed on the device, so yes, if Cydia is installed it's mean the device is jailbroken but the opposite is not true : It's not because Cydia is not installed that the device is not jailbroken. A device can be jailbroken without Cydia being installed. – Ashbay Apr 18 '13 at 13:56
  • Hi Ashbay, that's fine. Any other suggestions on how to detect jailbroken devices in all the scenario? – Jeevan Apr 19 '13 at 05:06
  • And this method won't work if user install some jb-hide plugin such as Xcon. – MasterBeta Nov 16 '17 at 07:21
  • Don't use fileExistsAtPath only, try more c methods such as stat. It will cost more effort to hook the output. – MasterBeta Nov 16 '17 at 07:24