用私有API得到iOS系统里安装的所有APP

#include <objc/runtime.h>
Class LSApplicationWorkspace_class = objc_getClass("LSApplicationWorkspace");
NSObject* workspace = [LSApplicationWorkspace_class performSelector:@selector(defaultWorkspace)];
NSLog(@"apps: %@", [workspace performSelector:@selector(allApplications)]);

可以用于非越狱iOS系统。也许可以靠混淆拼接字符串绕过审核,值得一试。

    原文作者:洪亮
    原文地址: https://segmentfault.com/a/1190000000696925
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞