gpt4 book ai didi

ios8 - iOS8如何监控前台运行的App?使用PrivateFrameworks SpringBoardServices

转载 作者:行者123 更新时间:2023-12-05 01:04:59 27 4
gpt4 key购买 nike

各位大神!我真的需要帮助~

在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”无效。

所以,我在谷歌上搜索了很长时间没有结果,大家回复将不胜感激!!!

以下是我认为有值(value)的信息:

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

最佳答案

权利:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.private.accounts.allaccounts</key>
<true/>
<key>application-identifier</key>
<string>CircleJoinRequested</string>
<key>keychain-cloud-circle</key>
<true/>
<key>com.apple.springboard.opensensitiveurl</key>
<true/>
<key>com.apple.securebackupd.access</key>
<true/>
<key>keychain-access-groups</key>
<array>
<string>keychain-cloud-circle</string>
<string>com.apple.ProtectedCloudStorage</string>
</array>
</dict>
</plist>

请找到链接 here & here

关于ios8 - iOS8如何监控前台运行的App?使用PrivateFrameworks SpringBoardServices,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25926026/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com