如何监控iOS8中前台运行的App?使用PrivateFrameworks SpringBoardServices [英] How to monitoring App running in the foreground in iOS8?use the PrivateFrameworks SpringBoardServices

查看:560
本文介绍了如何监控iOS8中前台运行的App?使用PrivateFrameworks SpringBoardServices的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

每个人都是伟大的上帝!我真的需要帮助〜

Everyone Great God!I really need help~

在iOS8之前,我使用PrivateFrameworks SpringBoardServices监控在前台运行的App很好。如下代码:

Before iOS8,I use the PrivateFrameworks SpringBoardServices monitoring the App running in foreground is fine. Like the following code:

#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'是invaild。

But... Recently released iOS8,Everything is change. I cann't get by call 'SBFrontmostApplicationDisplayIdentifier' to front display app Identifier,and 'SBSCopyLocalizedApplicationNameForDisplayIdentifier' is invaild.

因此,我在谷歌上搜索了一个很久没有结果,大家回复将不胜感激!!!

so, I searched on google for a long time not have result, everyone reply would be appreciated!!!

以下是我查看的有价值的信息:

The following is my view valuable information:

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>

请找到链接这里& 此处

Please found the link here & here

这篇关于如何监控iOS8中前台运行的App?使用PrivateFrameworks SpringBoardServices的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆