jacksight / xina520_official_jailbreak

This is the official download website for xina520's jailbreak
442 stars 24 forks source link

task_for_pid fails with error "(os/kern) failure" #58

Closed zx500xl closed 9 months ago

zx500xl commented 1 year ago

I have a code like this:

func get_task(pid: pid_t) throws -> mach_port_t {
    var task: mach_port_t = 0
    let taskResult = task_for_pid(mach_task_self_, pid, &task)
    if taskResult != 0 {
        throw MachOError.message("Failed to find get task, error: \(machError(code: taskResult))")
    }
    return (pid, task)
}

It fails with message:

Error: message("Failed to find get task, error: #5: \"(os/kern) failure\"")

my entitlements contain:

...
<key>get-task-allow</key>
<true/>
<key>com.apple.system-task-ports.control</key>
<true/>
<key>com.apple.system-task-ports.token.control</key>
<true/>
<key>task_for_pid-allow</key>
<true/>
<key>com.apple.security.get-task-allow</key>
<true/>
...
jacksight commented 1 year ago

I'll ask Xina about this