开发者

IPHONE - name of an application on /Applications on jailbroken iphones

I have an application using in-app purchase. Apparently, if the user has a jailbroken device with Cydia and is using Cydia's AppSync, the user cannot buy any in-app object, because AppSync interferers with the application.

The problem is that the error message Apple shows the user do not makes clear where the problem is.

I don't have any jailbroken iphone, so I cannot test this.

What I want to do is to use a code to identify programmatically if the i开发者_JAVA百科phone is jailbroken and then show a message before the user clicks to buy the in-app purchase.

this is the code

NSString *filePath = @"/Applications/Mail.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];  

    }

my idea is to check to see if I can find Mail.app on /Applications. As any locked iphone cannot check outside its environment and jailbroken iphones can, this code will show the alert when the file is found... in other words, when the iphone can find Mail.app.

My first question is: 1) is the mail application on the iPhone called Mail.app? I am guessing it is. If this is not true, please tell me a name of an application that exist in any iphone out-of-the-box.

Can someone with a jailbroken iphone test this code to see if it is working? thanks for any help.


I might suggest that if you're willing to invest the time in it, jailbreaking temporarily isn't hard to do with blackra1n.

Back up your phone, jailbreak it, develop the code to detect the jailbreak, and then restore the phone from your backup, which will de-jailbreak it again. I've done this myself to try out some of the Cydia stuff and then go back again. Worked fine under the current 3.x release of the iPhone firmware.

This way you can just test it yourself anytime you like.

[Note to downvoters: yes, I know I didn't tell him "the answer". The idea was to give him a tools to be able to answer other such questions in the future. It's the kind of answer I prefer, myself.]


The mail app is called MobileMail.app. I have a jail-broken iPhone with Cydia installed but have successfully used in-app purchases (Epic Chef Wars).


apparently there's no way to use this code without risking having the app rejected by apple, as they should think you are trying to circumvent the sandbox...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜