1

Possible Duplicate:
How do I detect that an SDK app is running on a jailbroken phone?

I'd like to be able to tell if a device is jailbroken. If it is, I want to stop my app, or at least warn the user that they may face untested and unstable situations.

Is this possible? How?

Community
  • 1
  • 1
Moshe
  • 57,511
  • 78
  • 272
  • 425
  • 2
    @thejh - It's likely that jailbroken users are stealing my app via Cydia or whatever. – Moshe Dec 07 '10 at 18:09
  • 1
    @thejh - Also, Jailbreaking can cause things to be unstable and then I get blamed. If I know it's jailbroken, I don't need that. I'd rather say, "sorry, you're device is at fault, I'm not taking blame for this one" and walk away. – Moshe Dec 07 '10 at 18:11
  • 2
    @Moshe - Although if you are worried about users bootlegging your applications, a question like [Reducing piracy of iPhone applications](http://stackoverflow.com/questions/846309/reducing-piracy-of-iphone-applications) is more appropriate. Jailbreaking does not imply the use of cracked applications. – Brad Larson Dec 07 '10 at 18:13
  • @BradLarson It's not just piracy, it's also me getting blamed for the damaged firmware malfunctioning. – Moshe Dec 07 '10 at 18:15
  • @Moshe - True, there are crashers that only appear on jailbroken devices. The first question I linked should provide several means of detecting these jailbroken systems. – Brad Larson Dec 07 '10 at 18:18

2 Answers2

0

You can try this, but it's untested.

if ([[[NSBundle mainBundle] infoDictionary] objectForKey: @"SignerIdentity"] != nil) {
  //If this runs, then your app has been modified (Implying a jailbroken device)
}
sudo rm -rf
  • 29,408
  • 19
  • 102
  • 161
  • 1
    Your response is not entirely correct. If the app was bought legitimately the "SignerIdentity" will be non-nil. This is not a test of whether or not the device is jailbroken. Rather, it is a test of whether it's pirated. – Benjamin Egelund-Müller Dec 07 '10 at 18:31
  • Okay thanks, I'll edit my post to reflect your comment. – sudo rm -rf Dec 07 '10 at 18:33
0

For the detection of piracy, check out this tutorial. It will allow you to detect whether or not your app is pirated. If your app is pirated, the user does not deserve to use it, so you could simply block them off — or at least give them a guilt-causing message. Note that all the credit for this goes to the author of the post - I'm just passing on the link for your convenience.