SBSLaunchApplicationWithIdentifier 不能在Daemon打开吗?

原先之前有使用cydia的插件open 去打开一个app,是可以实现的,但是每次安装deb的时候就得先安装open,也挺麻烦的,现在想直接在daemon打开app,但是一直报 SBSLaunchApplicationWithIdentifier 没有定义:
Undefined symbols for architecture armv7:
“SBSLaunchApplicationWithIdentifier(__CFString const*, unsigned char)”, referenced from:

该添加的,SpringBoardServices和-SEntitlements.plist 都添加了,想请教下,这是有哪个地方出错了?

@NavilleZhang @snakeninny

通过dlopen 解决了这问题了~ 想不通为何 .m的文件 执行SBSLaunchApplicationWithIdentifier 可以编译通过,.mm的文件去执行的情况编译就不能通过!!

我猜:
你在.m里,定义的是
extern void SBSLaunchApplicationWithIdentifier(__CFString const*, unsigned char)
对吧?

不是的。

.m文件的定义是

#ifndef SPRINGBOARDSERVICES_H_
extern int SBSLaunchApplicationWithIdentifier(CFStringRef identifier, Boolean suspended);
extern CFStringRef SBSApplicationLaunchingErrorString(int error);
#endif

在.mm里,改成:

#ifndef SPRINGBOARDSERVICES_H_
extern "C" int SBSLaunchApplicationWithIdentifier(CFStringRef identifier, Boolean suspended);
extern "C" CFStringRef SBSApplicationLaunchingErrorString(int error);
#endif

然后再编译试试

嗯 好的! 谢谢! 还有一个问题,就是daemon 为写入plist 是可以的,tweak 写入不成功!是权限不足吧,只能通过与daemon通信才能写入到plist文件吗?