Sportica   Sportica

//暴力打开某个APP iOS 私有API LSApplicationWorkspace

//暴力打开某个APP  = 。=   如果可以打开。直接打开不解释
+(BOOL)isOpenApp:(NSString*)appIdentifierName
{
    Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
    NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
    BOOL isOpenApp = [workspace performSelector:@selector(openApplicationWithBundleID:) withObject:appIdentifierName];
    
    return isOpenApp;
}

 

posted @ 2016-04-28 18:02  qingjoin  阅读(1858)  评论(0编辑  收藏  举报
  Sportica