Xcode 中的 get-task-allow 有什么作用?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1003066/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does get-task-allow do in Xcode?
提问by Codebeef
So when I set up my entitlements in my iPhone app project, I create a new Entitlements.plist, and set the value of get-task-allow to false. But why? What does this key represent?
因此,当我在 iPhone 应用程序项目中设置我的权利时,我创建了一个新的 Entitlements.plist,并将 get-task-allow 的值设置为 false。但为什么?这个键代表什么?
EDIT
编辑
Note this is related to this question- I found that flipping the value of this key to true allowed me to install the app on my device)
请注意,这与此问题有关- 我发现将此键的值翻转为 true 允许我在我的设备上安装该应用程序)
回答by Codebeef
From this thread on ADC:
get-task-allow, when signed into an application, allows other processes (like the debugger) to attach to your app. Distribution profiles require that this value be turned off, while development profiles require this value to be turned on (otherwise Xcode would never be able to launch and attach to your app).
get-task-allow 在登录应用程序时允许其他进程(如调试器)附加到您的应用程序。分发配置文件要求关闭此值,而开发配置文件要求打开此值(否则 Xcode 将永远无法启动并附加到您的应用程序)。
回答by cdespinosa
The ability to debug your application on the iPhone.
在 iPhone 上调试应用程序的能力。
回答by iAlex11
While your answeris correct, I just want to be more specific on this just so people who want to know what does exactly get_task_allow
mean, can.
虽然您的回答是正确的,但我只是想更具体地说明这一点,以便那些想知道究竟是什么get_task_allow
意思的人可以。
get_task_allow
is an entitlement that allows other apps to get the task port of your app. This means that if any other app runs task_for_pid()
with your app process ID they'll get the task port of your app so they can do things like for example writing and reading things on the memory, therefore being able to patch things and modify the behavior of your app.
get_task_allow
是一种权利,允许其他应用程序获取您应用程序的任务端口。这意味着,如果任何其他应用程序task_for_pid()
使用您的应用程序进程 ID运行,他们将获得您应用程序的任务端口,以便他们可以执行诸如在内存上写入和读取内容之类的事情,因此能够修补事物并修改其行为你的应用程序。
If you take a look at how a jailbreak works, you'll notice one of the first things they do is get task_for_pid(mach_task_self(),0,&kernel_task);
being that kernel_task
is a mach_port_t
with value 0
, so they are able to touch the kernel's memory.
如果你看看怎么越狱的作品,你会发现他们做的第一件事就是让task_for_pid(mach_task_self(),0,&kernel_task);
被认为kernel_task
是一个mach_port_t
具有价值0
,使他们能够接触到内核的内存。
As kernel entitlements do not have get_task_allow
entitlement, and Apple has even removed the possibility of doing tfp0
(task_for_pid 0
), they need a patch.
由于内核权限没有get_task_allow
权限,Apple 甚至已经取消了执行tfp0
( task_for_pid 0
)的可能性,因此他们需要一个补丁。
So basically as Xcode needs to touch your app's memory and work with it to debug it, you'll need to enable this for debugging, but you'll need to disable this to distribute your app or else any app would be able to get your task port.
所以基本上因为 Xcode 需要接触你的应用程序的内存并使用它来调试它,你需要启用它进行调试,但你需要禁用它来分发你的应用程序,否则任何应用程序都可以得到你的任务端口。
回答by Yi?it
For xcode 4:you have to create Entitlements.plist file from new file. and Targets->build Settings->Code Signing Entitlements you have to write here "Entitlements.plist"
对于 xcode 4:您必须从新文件创建 Entitlements.plist 文件。和 Targets->build Settings->Code Signing Entitlements 你必须在这里写“Entitlements.plist”
I did this and xcode don not get anymore error
我这样做了,xcode 不再出现错误