读取属于其他iOS应用程序的文件
我目前正在为 iOS 编写一个备份应用程序,我希望有一些选项可以让用户备份应用程序数据(其他应用程序的文档等)、联系人、Safari 书签以及所有有趣的东西。
我想知道这是否可能,我会如何做到,以及这些文件的存储位置,最重要的是,苹果是否真的允许这样做。我通读了他们的文档,没有看到任何反对的内容。
I am currently coding a backup app for iOS, and I want to have options to let the user back up things like Application Data (other app's documents, etc,) Contacts, Safari Bookmarks, and all that fun stuff.
I'd like to know if that's possible, how I'd do it, and where those files are stored, and most importantly, if this is actually allowed by Apple. I read through their docs, and I haven't seen anything that speaks against it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是不可能的。您的应用程序甚至无法读取其他应用程序中的文档。这是通过沙箱完成的。您的应用程序尝试对文件系统进行的每次读/写都会由内核检查,以确保您留在沙箱内。属于其他应用程序的文档位于您的沙箱之外,因此您无法看到它们。
It's not possible. Your app isn't even capable of reading the documents from other apps. This is accomplished via sandboxing. Every read/write your application tries to do to the filesystem is checked by the kernel to ensure you're staying within your sandbox. The documents belonging to other apps are outside of your sandbox, so you cannot see them.
他们是不被允许的。所有 iOS 应用程序均已沙盒化,无法访问其他应用程序的数据。
They aren't allowed. All iOS apps are sandboxed, and can't access other apps' data.
您的应用程序自然位于沙箱中,它不允许您在应用程序之外进行阅读。如果您对设备进行越狱,那么是的,这是可能的。
Your app, naturally is in a sandbox, which does not allow you to read outside of the app. If you jailbreak your device, then yes, it is possible.