【发布时间】:2014-11-13 13:59:00
【问题描述】:
各位大神!我真的需要帮助~
在iOS8之前,我使用PrivateFrameworks SpringBoardServices监控前台运行的App是可以的。像下面的代码:
#define SPRINGBOARDPATH "/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices"
....
+(void) monitoringFrontApp {
mach_port_t *port;
void *uikit = dlopen(SPRINGBOARDPATH, RTLD_LAZY);
int (*SBSSpringBoardServerPort)() =
dlsym(uikit, "SBSSpringBoardServerPort");
port = (mach_port_t *)SBSSpringBoardServerPort();
//dynamic link sys mothed
void* (*SBFrontmostApplicationDisplayIdentifier)(mach_port_t* port,char * result) =
dlsym(uikit, "SBFrontmostApplicationDisplayIdentifier");
//call mothed
char frontmostAppS[256];
memset(frontmostAppS,sizeof(frontmostAppS),0);
SBFrontmostApplicationDisplayIdentifier(port,frontmostAppS);
NSString * app_id = [NSString stringWithUTF8String:frontmostAppS];
NSLog(@"front display app Identifier----%@", app_id);
//dynamic link sys mothed
CFStringRef (*SBSCopyLocalizedApplicationNameForDisplayIdentifier)(CFStringRef displayIdentifier) =
dlsym(uikit, "SBSCopyLocalizedApplicationNameForDisplayIdentifier");
//call mothed
CFStringRef locName = SBSCopyLocalizedApplicationNameForDisplayIdentifier((__bridge CFStringRef)app_id);
NSString *app_name = [NSString stringWithFormat:@"%@",locName];
if (locName != NULL)CFRelease(locName);
NSLog(@"front display app name----%@", app_name);
}
但是…… 最近发布的iOS8,一切都变了。 我无法通过调用 'SBFrontmostApplicationDisplayIdentifier' 来获取前置显示应用程序标识符,并且 'SBSCopyLocalizedApplicationNameForDisplayIdentifier' 无效。
所以,我在google上搜索了很长时间没有结果,请大家回复!!!
以下是我认为有价值的信息:
http://blog.lazerwalker.com/blog/2013/10/16/faking-touch-events-on-ios-for-fun-and-profit https://github.com/Cykey/ios-reversed-headers/blob/c613e45f3ee5ad9f85ec7d43906cf69ee812ec6a/SpringBoardServices/SpringBoardServices.h
【问题讨论】:
-
我认为它已修复 cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4361 可能需要授权才能在 iOS8 上工作
-
@creker ,我们必须在权利中添加什么?请您在此处清楚地提及解决此问题的方法。谢谢。
-
我不知道它的确切名称。对于苹果来说,这似乎是显而易见的事情。他们总是这样做 - 使用权利关闭对私有 API 的访问。这里archives.neohapsis.com/archives/bugtraq/2014-09/0106.html 说“这个问题已通过额外的访问控制得到解决”,这表明它确实是一项新权利。
-
谢谢@creker,没有从那个链接得到任何东西来弥补:(
-
@gary.zhan ,你有解决这个跳板问题的办法吗?
标签: ios8 jailbreak iphone-privateapi springboard