I want to inject some functions to Backboardd, because of some reasons, I can not use plist to restrict it, so I want to use "if" to determine whether it's inside Backboardd.I know in 'Logos' I can use like that:
%ctor{ if (%c(SpringBoard)) { } }
But without Logos, can I do it like below?It doesn't work.
MSInitialize { if (objc_getClass("Backboardd")) { CFMessagePortRef local = CFMessagePortCreateLocal(NULL, CFSTR(MACH_PORT_NAME), messageCallBack, NULL, NULL); CFRunLoopSourceRef source = CFMessagePortCreateRunLoopSource(NULL, local, 0); CFRunLoopAddSource(CFRunLoopGetCurrent(), source, kCFRunLoopDefaultMode); } }