What is the best way to access iOS filesystem from an app? - ios

I'll be working on a cryptographic app for iPad soon. Along to some other features, I'd like to be able to get documents within the iPad's file system to work with them.
So far, I haven't experimented with that, but I've seen apps such as pdf readers that don't share their files with other apps and can't reach files belonging to other apps. Is it possible -and legal- to reach all the files in the iPad from an app?
Thank you very much!

No. This is not possible unless you Jailbreak your device. All applications are sandboxed and can only access files they are in the their individual sandbox.

Related

How do I access ipa files from an iPad?

I want to inspect one of the applications that I have downloaded from the iPad app store on my iPad 15.
I assume that it comes with an ipa file.
To locate the app folder or any ipa file, I open the "Files" app and enter "ipa".
Nothing is found.
Are these files hidden from the user?
How do I access / find them?
Thank you!
ps: The app is only available on the iPad app store, not for Mac.
ps2: I know that this board does not fit 100%.
However, I don't see which other board might fit.
ps3:
When I search for "How do I access files on an iPad", I find hundreds of entries explaining how to find documents that the user has created on an iPad, but not where the apps themselves are stored.
AppStore hides this information due to security reasons, so you would not be able to access or locate the ipa file so one would be prevented performing reverse engineering or any other ways to violate the security and data that app provides.

How safe is to store files into the document directory?

I am writing an iOS app in Swift and Xcode where I allow users to download some files from a server and to store them into the iPhone's document directory.
How safe is it to do so?
Is it possible for a user to access one of these files from outside the app, for example by connecting their phone to a computer, and move them around or share them? If a user has a jailbroken iPhone, could he get a way to access the downloaded files in other ways other than the one I allow within my app?
And if so, should I encrypt my files when I download them?
For jailbroken iPhone i think yes it's possible to access apps directories.
For normal iPhone I'm pretty sure other apps can't access it as all third-party apps are “sandboxed"
https://support.apple.com/en-gb/guide/security/sec15bfe098e/web#:~:text=Sandboxing,information%20stored%20by%20other%20apps.
And no idea about connecting their phone to a computer.

iOS equivalent of Android external/public storage

Is there any equivalent of Android's external/public storage concept in IOS
https://developer.android.com/guide/topics/data/data-storage.html#filesExternal
I don't want the physical external storage in iOS but at least a common public folder where multiple apps can read/write from.
Also i want to check if there is any way to share a file between two applications on a same device. My file can get huge
AFAIK with air drop i can share files between applications in different devices.
Best Regards,
Saurav
App groups can be a possible solution for your case if you are going to share data among your apps.
Otherwise creating an extension & allow user to store data in cloud storage could be a possible solution.
https://www.centerdevice.de/document-and-share-extensions-in-ios/

Firemonkey iOS access one file from different apps

I am writing multiple apps for iPad. All these apps have some settings in common. I therefore would like to have one app that handles the settings and write them to a file - the respective apps will then retrieve their settings from this single file. Is there a way to access one file from different apps on iOS?
The iOS Keychain may help -> http://shaune.com.au/ios-keychain-sharing-data-between-apps/ though a Google search for FireMonkey APIs for the keychain has proven fruitless. At least it could be a starting point.

Specific constraints of iOS sandboxing

I would like read access to the files in the iPhones music directory:
~/Media/iTunes_Control/Music/F**/*.{M4A,MP3}
1) I can't seem to figure out from the docs whether iOS apps are sandboxed such that I would or would not have this permission.
2) Is it necessary to ask for read or write permissions to directories outside the iOS App sandbox ? Only write permissions ? How does one do this, or is it just up to the discretion of the team that reviews the App for app store release ?
3) I have found a lot of information in the apple docs on sandboxing of OS X apps but not of iOS apps. Is there a similar sandboxing/entitlements process for iOS as for OS X apps ? Any useful links I should read ?
Update: as accepted answer says below, 1,2, and 3 are impossible, however it is possible to obtain a copy of a file in the media library, which is in some sense equivalent to having read access to the original - because of course the digital information is identical. This question contains code that does that:
Application crashed while importing songs from Ipod library in Iphone for iOs 5.0
You will not have permission to read/write outside your application.
You will not have permission to read/write outside your application.
You will not have permission to read/write outside your application.
You can use the Media Player framework to access information about the user's library, but nothing using the filesystem.
Sandboxing on iOS is done for you, there is no need to set that up.
You can not write files outside your applications sandbox.
I have not attempted to access music stored by the iPod app, but there is access to media types. It functions much like access photos.
Here is the link to the Apple docs for MPMediaPickerController.

Resources