3

I am trying to detect if an iphone/ipod is jailbreak. Then I thought the application could try to access a file outside its area, for example, try to see if MobileMail.app is there...

here is the code

NSString *filePath = @"/Applications/MobileMail.app";
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath])
    {
        NSString *title = @"problem";
        NSString *message = @"you are using a jailbroken iphone";
        NSString * buttonOK = @"OK";

        UIAlertView *alert = [[UIAlertView alloc] title message  
                        delegate:self  cancelButtonTitle: buttonOK   otherButtonTitles:nil];  
        [alert show];  
        [alert release];  

    }

as jailbroken iphones can access areas outside its sandbox and the normal iphone can't, this code, in theory, would show if a device was jailbroken or not, but this is the problem.

Someone raised the point that Apple could not approve an application using this code as it may think the Application was trying to access a file outside its sandbox.

Is this true? If yes, can you guys suggest any other code that could verify if the application is running on a jailbreak device?

thanks for any help.

Duck
  • 34,902
  • 47
  • 248
  • 470

0 Answers0