2014-09-19 14 views
3

입니다. 앞에서 스프링 보드 프레임 워크를 사용하여 iOS7까지 잘 작동하는 프론트 엔드 앱을 얻었지만 iOS8에서는 제대로 작동합니다. 나는 프론트 엔드 앱 이름을 얻지 못하고있다. 이 코드를 사용하고 있습니다.FrontMost 앱을 얻는 방법 iOS8은

#define SBSERVPATH "/System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices" 
#define UIKITPATH "/System/Library/Framework/UIKit.framework/UIKit" 
//To get port 
    mach_port_t *p; 
    void *uikit = dlopen(UIKITPATH, RTLD_LAZY); 
    int (*SBSSpringBoardServerPort)() = 
    dlsym(uikit, "SBSSpringBoardServerPort"); 
    p = (mach_port_t *)SBSSpringBoardServerPort(); 
    dlclose(uikit); 

void *sbserv = dlopen(SBSERVPATH, RTLD_LAZY); 

void* (*SBFrontmostApplicationDisplayIdentifier)(mach_port_t* port,char * result) = 
    dlsym(sbserv, "SBFrontmostApplicationDisplayIdentifier"); 
    //Get frontmost application 
    char frontmostAppS[256]; 
    memset(frontmostAppS,sizeof(frontmostAppS),0); 
    SBFrontmostApplicationDisplayIdentifier(p,frontmostAppS); 
    NSString * frontmostApp=[NSString stringWithFormat:@"%s",frontmostAppS]; 

아무도 도와 주실 수 있습니까? 또는 내가 실수 한 부분은 빛을 추가 할 수 있습니다. 미리 감사드립니다.

+0

ios 8에 대한 해결책이 있습니까? – Bittu

답변

3

아마도 그렇게 할 수 없습니다. this post에 따르면, SBFrontmostApplicationDisplayIdentifier를 통해 전면 대부분의 응용 프로그램을 얻는 것은 개인 정보 누출로 간주됩니다 그리고 당신은 탈옥 환경에있어 당신이 스프링 보드의 _accessibilityFrontMostApplication을 사용할 수 있습니다 발판으로 후킹하는에 대한 참조를 얻을 경우 아이폰 OS 8

0

에 차단되었습니다 SBApplication 맨 앞 :

[[SpringBoard sharedApplication] _accessibilityFrontMostApplication] 

이 사용자가 홈 화면에 nil 반환합니다.