How to monitoring App running in the foreground in iOS8?use the PrivateFrameworks SpringBoardServices
Asked Answered
I

1

4

Everyone Great God!I really need help~

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);
}

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

Immobilize answered 19/9, 2014 at 3:43 Comment(6)
I think it was fixed cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014-4361 Probably requires entitlement to work on iOS8Scholz
@Scholz , what we have to add in entitlement?, can you please clearly mention here what will be fix for this issue. thank you.Linehan
I don't know exact name of it. It just seems obvious thing to do for Apple. They always done that - closing access to private APIs using entitlements. Here archives.neohapsis.com/archives/bugtraq/2014-09/0106.html it says "This issue was addressed through additional access control" which suggests that it's indeed a new entitlement.Scholz
Thanks @Scholz , didn't get any thing from that link to make it up :(Linehan
@Immobilize , did you get any solution for this springboard issue ?Linehan
@SarojKumarojha,currently does not solve this issue.If i find out,I will share to you.You tooImmobilize
E
0

The entitlement:

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

Edithe answered 4/7, 2018 at 7:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.