每个应用程序都可以在越狱的iPhone中写入文件吗? [英] Is there a path every app can write files in the jailbreak iPhone?

查看:148
本文介绍了每个应用程序都可以在越狱的iPhone中写入文件吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该钩住每个应用程序的UIResponder,包括SpringBoard和任何其他应用程序.在挂钩过程中,我将向指定的文件中写入内容.如果我将路径设置为Cydia推荐的/var/mobile/Library/MyApp,我发现只有SpringBoard和MyApp可以成功写入.

I should hook UIResponder of every app, including SpringBoard and any others. In the hooking, I will write something to the specified file. If I set the path to /var/mobile/Library/MyApp, recommended by Cydia, I found that only the SpringBoard and MyApp could write successfully.

那么每个应用程序都可以写和读一个地方吗?

So is there a place every app can write and read?

推荐答案

我承认我对此内容不是100%肯定,但我的猜测是否,没有一个路径可以让每个应用程序将文件写入越狱的iPhone .

I admit that I'm not 100% sure on this one, but my guess would be no, there is not a path that every app can writes files to on a jailbroken iPhone.

当然,越狱电话上的越狱应用程序(安装在/Applications/中)可以写入可以在那些越狱应用程序之间共享的位置.但是,据我所知,您想将代码注入正常的App Store应用程序中,以便这些应用程序也可以读写共享位置.我认为那部分是不可能的,因为越狱并不能完全禁用正常安装的第三方应用程序的沙箱,在/var/mobile/Applications/下.

Certainly, jailbreak apps (installed in /Applications/) on a jailbroken phone can write to locations that can be shared between those jailbreak apps. But, as I understand your question, you would like to inject code into normal, App Store apps, so that those apps can also read and write to the shared location. That part I don't think is possible, because jailbreaking does not completely disable the sandbox for 3rd-party apps installed normally, under /var/mobile/Applications/.

现在,可能是一种解决方法.有些共享文件夹可以出于某些目的供所有应用程序访问.例如,任何应用程序都可以将图像写入已保存的相册.您可以尝试在UIImage中(例如,使用[UIImage imageWithData:])获取要写入的文件的内容,并将其编码为伪造的图像数据.您可能需要向数据添加有效的图像标题.然后,使用类似的

Now, there might be a workaround. There are some shared folders that are accessible to all apps for certain purposes. For example, any app can write images to the saved photos album. What you could try is to take the content of the file you want to write, and encode it as fake image data, in a UIImage (e.g. with [UIImage imageWithData:]). You'd probably need to add a valid image header to the data. Then, you save the file to the photos album, using something like

然后另一个应用可以通过枚举保存的照片相册,然后再

Another app could then find the fake photo by enumerating the saved photos album, and then converting the asset back to image representation to pull the real data back out.

但是,这似乎很复杂,可能无法正常工作(我没有尝试过).也许您可以告诉我们为什么,您想要此共享文件.也许有一种更好的方式来共享数据,而无需使用可全局访问的文件?

However, this seems quite complicated, and possibly wouldn't work (I haven't tried it). Perhaps you could tell us why you want this shared file. Maybe there's a better way to share the data, without using a globally-accessible file?

这篇关于每个应用程序都可以在越狱的iPhone中写入文件吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆