views:

752

answers:

3

Hi,

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.

+1  A: 

This question has been asked a few times already:

Ben Gottlieb
I think you have not read what I wrote. What I said is that using the technique of trying to access a file outside the sandbox can be seen as apple as a try to use a unauthorized functionality or a kind of "hacking" attempt and this can make them do not approve the app for sale.
Digital Robot
You're right, I misread you. Sorry!
Ben Gottlieb
+1  A: 

there are a couple techniques here:

http://stackoverflow.com/questions/413242/how-do-i-detect-that-an-sdk-app-is-running-on-a-jailbroken-phone

jspcal
I think you have not read what I wrote. What I said is that using the technique of trying to access a file outside the sandbox can be seen as apple as a try to use a unauthorized functionality or a kind of "hacking" attempt and this can make them do not approve the app for sale.
Digital Robot
read the thread, there are other options besides accessing a file outside the sandbox
jspcal
+1  A: 

fonik's answer (the second answer) to

http://stackoverflow.com/questions/413242/how-do-i-detect-that-an-sdk-app-is-running-on-a-jailbroken-phone

should meet your criteria. It would not require doing anything that apple would consider hacking

Michelle Six