Как контролировать приложение, работающее на переднем плане в iOS8, используйте PrivateFrameworks SpringBoardServices

Всем Великий Бог!Мне очень нужна помощь~

До iOS8 я использовал PrivateFrameworks SpringBoardServices, отслеживая приложение, работающее на переднем плане, в порядке. Как следующий код:

#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


person gary.zhan    schedule 19.09.2014    source источник
comment
Я думаю, что это было исправлено cve.mitre.org/cgi -bin/cvename.cgi?name=CVE-2014-4361 Вероятно, требуется разрешение для работы на iOS8.   -  person creker    schedule 19.09.2014
comment
@creker, что мы должны добавить в права?, не могли бы вы четко указать здесь, что будет исправлено для этой проблемы. благодарю вас.   -  person Saroj Kumar ojha    schedule 23.09.2014
comment
Я не знаю его точного названия. Это кажется очевидным для Apple. Они всегда так делали — закрывали доступ к приватным API с помощью прав. Здесь archives.neohapsis.com/archives/bugtraq/2014-09/0106 .html говорится, что эта проблема устранена путем дополнительного контроля доступа, который предполагает, что это действительно новое право.   -  person creker    schedule 23.09.2014
comment
Спасибо @creker, по этой ссылке ничего не получилось :(   -  person Saroj Kumar ojha    schedule 23.09.2014
comment
@gary.zhan, вы нашли решение этой проблемы с трамплином?   -  person Saroj Kumar ojha    schedule 23.09.2014
comment
@SarojKumarojha, в настоящее время не решает эту проблему. Если я узнаю, я поделюсь с вами. Вы тоже   -  person gary.zhan    schedule 26.09.2014


Ответы (1)


Право:

<?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>

Ссылка находится здесь & здесь

person SAM    schedule 04.07.2018