【发布时间】:2015-09-19 20:09:02
【问题描述】:
我正在尝试在 iOS 8 上的应用和控制台应用(使用 theos)之间发送数据。
我试过了:
应用程序:
CFMessagePortRef port = CFMessagePortCreateLocal(kCFAllocatorDefault, CFSTR("co.test"), &message_callback, NULL, NULL);
这很好用。 NSLog(@"%@", port) 返回:
<CFMessagePort 0x17018bef0 [0x198094f50]>{locked = Maybe, valid = Yes, remote = No, name = co.test, source = 0x0, callout = message_callback (0x1000e979c), context = <CFMessagePort context 0x0>}
但是,当尝试在控制台应用上执行相同操作时:
CFMessagePortRef port = CFMessagePortCreateLocal(kCFAllocatorDefault, CFSTR("co.test"),
&message_callback, NULL, NULL);
我总是得到错误:
*** CFMessagePort: bootstrap_register(): failed 1100 (0x44c) 'Permission denied', port = 0xc03, name = 'co.test'
即使我对两者使用相同的com.apple.security.application-groups 权利:
<key>com.apple.security.application-groups</key>
<array>
<string>co.test</string>
</array>
任何人都可以解释一下 - 也许上面的方法很糟糕,我错过了一种更简单的方法来实现我的目标?
我的目标是能够在 SpringBoard 上运行的应用程序和使用 theos 构建的守护程序之间传递 NSDictionary。
注意:我无意在应用商店分发此应用
【问题讨论】:
-
不知道是什么问题,您甚至不需要为此的权利。但是你总是可以使用 tcp 套接字
-
所以我只是在一个新的theos工具中尝试了这个,只有
CFMessagePortRef port = CFMessagePortCreateLocal(kCFAllocatorDefault, CFSTR("co.test"), &message_callback, NULL, NULL);的行,运行它就可以了。没有签字。也许是签约?无论哪种方式,感谢您的帮助! -
或许,我还是第一次看到这种权利。
标签: ios objective-c ipc jailbreak theos