0

I am developing an app for Jailbroken iOS devices that access Safari history. History.plist file is placed at following path.

/private/var/mobile/Library/Safari/History.plist

I have successfully installed my app on jailbroken iphone by following tutorial Use your jailbroken iPhone in Xcode for developing

When I try to access above path using fopen command of C, I can not access it. My code is below

FILE *fp = fopen("/private/var/mobile/Library/Safari/History.plist","r"); // read mode
        if( fp == NULL )
        {
            NSLog(@"This file does not exist");

        }else{
            NSLog(@"This file exists");
        }

It returns NULL file pointer. I have Googled this and got to know that since my app is still in sandbox so I am not able to access above path. Couple of posts including [Why SandBox in iOS 6.1.1 still exists for App even after I have jailbreak?][2]

[2]: Why SandBox in iOS 6.1.1 still exists for App even after I have jailbreak? and [how to get the message when receiving the “kCTMessageReceivedNotification” notification on IOS5][2]

[2]: how to get the message when receiving the "kCTMessageReceivedNotification" notification on IOS5 suggest that the app needs to move outside sandbox in order to access the complete file system. I am confused about this. Can you please guide me how can I access this path? Best Regards

Community
  • 1
  • 1
Aqueel
  • 1,246
  • 3
  • 23
  • 46
  • Usually you will get a message in the console saying you that access was denied. As for moving outside sandbox, you can copy your application into `/Applications` directory where all system apps are. You can do it using ssh, iExplorer or anything else that can access root folder of iOS device. Read this http://iphonedevwiki.net/index.php/Xcode, the "The actual signing part" part. You can skip ldid stuff, you don't really need to sign anything unless you have entitlements. – creker Jul 13 '14 at 16:44
  • Thanks Creker for the reply. I have this option but since I will be selling this app soon so is there any way that I can achieve this some programming or scripting? Can you please guide me that if I use your technique to test my app then would my customer also need to do the same to make app work on their devices? – Aqueel Jul 13 '14 at 16:58
  • I don't really understand your question but if your app requires some access that can only be granted outside the sandbox (like browser history access) then you and your customers need to place it in `/Applications` directory. Otherwise it will not work. How you implement that is up to you (debian package, manually installing application with ssh). – creker Jul 13 '14 at 17:23
  • Actually I will be selling this app on my website so I believe it will be hard for my customers to put it in /Applications directory manually. Is there a better way to handle this situation? Thanks – Aqueel Jul 13 '14 at 18:03
  • If you're developing application for jailbroken devices only then debian package is the way to go. The easiest way to sell it would be to use public cydia repositories like modmyi or bigboss that support paid apps. If you want you could create your own repository and ask customers to add it to Cydia on their device to install the app. Of course it means that you will have to handle all the payments and licensing stuff. – creker Jul 13 '14 at 18:25
  • Okay thanks. Can you please post your comment as an answer so that I can accept it? – Aqueel Jul 14 '14 at 10:40

1 Answers1

1

Usually you will get a message in the console saying that access was denied. If the sandbox is indeed doesn't allow you to access browser history then you need to move your application outside of the sandbox. To do that you can copy your application into /Applications directory where all system apps are. You can do it using ssh, iExplorer or anything else that can access root folder of iOS device. Read this, the "The actual signing part" part. You can skip ldid stuff, you don't really need to sign anything unless you need to sign your app with entitlements.

creker
  • 9,400
  • 1
  • 30
  • 47