-1

Today I downloaded the demo version of PhoneView app and for my surprise I'm able to change the contents in the files that resides in Documents/Library folder with this PhoneView app.

I want to restrict users from accessing files in my app and want to make these files invisible to these 3rd party tools ? Is there a way to achieve it ?

2
  • Is this a jailbreak app?
    – user523234
    Mar 27, 2013 at 10:00
  • No its not. You can connect the device to Mac and open the PhoneView app to browse through the device including apps downloaded from app store.
    – nkongara
    Mar 27, 2013 at 14:18

3 Answers 3

2

Restricting access to files is not possible. But if you want to prevent people from viewing the files, you can encrypt them. This might be helpful (the CommonCrypto part). You would need to generate an encryption key (I think you can use CFUUIDCreate for this) and store it in your app's keychain.

6
  • The problem with encrypting the files is that it can be painful to maintain, and there isn't really much point unless there is information you don't want the user to view or modify, like passwords or game high scores, because they can still move, rename, delete or corrupt the files.
    – Greg
    Mar 27, 2013 at 6:20
  • That's not really secure either, as the key will be in your users' possession. Mar 27, 2013 at 6:22
  • @PartiallyFinite I agree that encrypting files is difficult to maintain. Regarding your second point, I did indeed say "restricting access to files is not possible".
    – fumoboy007
    Mar 28, 2013 at 5:38
  • @CarlVeazey Users have access to their iOS keychain?
    – fumoboy007
    Mar 28, 2013 at 5:38
  • @fumoboy007 The keychain is just a .db file that sits somewhere in the file system. I did come across it awhile ago when I was poking around; I can't remember where exactly it is now.
    – Greg
    Mar 28, 2013 at 5:42
1

PhoneView and similar apps access the iOS device file system directly to the extent that they can access, which is the same as iTunes, so they are able to browse and modify all media that is accessible by iTunes on your device, including music, videos, apps, and all the data they create.

Basically, there is no way you can prevent them from seeing your app data, because they do not respect any visibility keys and just list everything there is in the file system.

So if you are really desperate to hide your app data from users who go snooping around the contents of their device file system, you'll have to encode all the files in some unreadable format, that way users will still be able to change and delete the data, but won't be able to make sense of it.

Short answer: there really isn't much you can do to prevent this, and I would strongly recommend just leaving your app data as is.

2
  • End users are supposed to protect the entire filesystem from being read by unauthorized computers by enabling passcode lock and only synchronizing device with trusted computers. You might want to explain it somewhere at application info.
    – A-Live
    Mar 27, 2013 at 6:21
  • If the app is a game, it'd be helpful to store the high scores in an obscure format so they can't be modified. If the app stores sensitive information, encryption is probably the best option. Otherwise, if it's just internal app settings that are necessary to the functioning of the app but don't contain sensitive user data, there's no point trying to protect them, because after all, it's the user's fault if they go and delete random files from an app's internal documents folder.
    – Greg
    Mar 27, 2013 at 6:24
0

Maybe the only way is encode and decode your files which you don't like others see. The Documents folder on iOS is as same as the Documents of OS x , all app or people can read it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.