移动基板调整的root权限 [英] Root privileges for mobile substrate tweak

查看:88
本文介绍了移动基板调整的root权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在进行一项调整,即可以访问互联网时它会执行某些操作.这是通过Apple的可达性API完成的.该调整已加载到SpringBoard中.我有一个.plist文件,其中包含/MyTweaksFolder中的一些信息.我可以阅读,但无法修改或更改.我想这与SpringBoard的特权有关.

I'm developing a tweak that when internet is reachable it does something. This is done with Apple's reachability API. The tweak is loaded in SpringBoard. I have a .plist file containing some information in /MyTweaksFolder. I can read it but I can't modify or change it. I'm guessing it has to do with the privileges of SpringBoard.

我的问题是:如何在SpringBoard调整中授予root访问权限?

My question is: How can I grant root access in a SpringBoard tweak?

推荐答案

您不向调整项授予特权,而是将特权授予该调整项被加载到的进程(在您的情况下为SpringBoard).但是我不建议这样做.我记得尝试过,但SpringBoard不能正常工作.

You do not grant privileges to a tweak, you grant them to the process the tweak is loaded into (SpringBoard in your case). But I wouldn't recommend doing that. I remember trying and SpringBoard wasn't working properly.

如果需要root特权,则应创建一个守护程序.据我了解,您正在挂钩SpringBoard方法.因此,这将是一个调整和一个守护进程.当您需要以root用户身份执行操作时,您的调整将向守护程序发送通知.您甚至可以得到适当的答复.例如,CFMessagePort API使您可以非常轻松地对守护程序进行IPC,甚至可以同步获取响应以简化代码.就像您只是调用一个函数一样.

If you need root privileges you should create a daemon. As I understand, you're hooking SpringBoard methods. So it will be a tweak and a daemon. When you need to do something as root your tweak will send notification to the daemon. You can even get a proper response. For example, CFMessagePort API allows you to do IPC with your daemon pretty easely and even get a response synchronously to simplify the code. It will like you just calling a function.

仅此而已.在您的情况下,您只需要将.plist文件放在SpringBoard拥有写许可权的其他目录中即可.好的地方将在/var/mobile/中的某个目录中.找到一个可行的文件,然后将.plist放置在那里.

That's all for a general case. In your case you just need to place your .plist file in a different directory where SpringBoard has write permissions. Good place would some directory in /var/mobile/. Find the one that works and place .plist there.

这篇关于移动基板调整的root权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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