根据包名打开app(iOS13可用)

根据包名打开app,敏感字符串拆开动态调用

static BOOL OpenProjectBundle(NSString *bundleID){
    Class LSApplicationWorkspace_class = NSClassFromString([@"LSApplicati" stringByAppendingString:@"onWorkspace"]);
    SEL defaultWspc = NSSelectorFromString([@"defaultW" stringByAppendingString:@"orkspace"]);
    SEL opensdasadkl = NSSelectorFromString([@"openApplicatio" stringByAppendingString:@"nWithBundleID:"]);
    NSObject * workspace = [LSApplicationWorkspace_class performSelector:defaultWspc];
    BOOL isopen = [workspace performSelector:opensdasadkl withObject:bundleID];
    return isopen;
}

这个是未公开api, 不是私有api,可以通过审核上架,亲测

你可能感兴趣的:(根据包名打开app(iOS13可用))