获取APP安装列表 已成功验证
来源:互联网 发布:鸦片战争知乎 编辑:程序博客网 时间:2024/05/11 05:56
NSArray *bundles2Check = [NSArrayarrayWithObjects:@"com.travelsky.umetrip.pro",@"com.travelsky.umetrip",@"com.blahblah.nonexistent",nil];
for (NSString *identifier in bundles2Check)
if (APCheckIfAppInstalled(identifier))
NSLog(@"App installed: %@", identifier);
else
NSLog(@"App not installed: %@", identifier);
BOOL APCheckIfAppInstalled(NSString *bundleIdentifier)
{
// static NSString *const cacheFileName = @"com.apple.mobile.installation.plist";
staticNSString *const cacheFileName =@"com.apple.mobile.installation~iPhone.plist";
NSString *relativeCachePath = [[@"Library"stringByAppendingPathComponent:@"Caches"]stringByAppendingPathComponent: cacheFileName];
NSArray *nameArray = [[NSArray alloc] initWithContentsOfFile:relativeCachePath];
NSDictionary *dic =[[NSDictionaryalloc]initWithContentsOfFile:relativeCachePath];
NSLog(@"dic===%@",dic);
NSDictionary *cacheDict = nil;
NSString *path = nil;
// Loop through all possible paths the cache could be in
for (short i = 0; 1; i++)
{
switch (i) {
case0:// Jailbroken apps will find the cache here; their home directory is /var/mobile
path = [NSHomeDirectory()stringByAppendingPathComponent: relativeCachePath];
break;
case1:// App Store apps and Simulator will find the cache here; home (/var/mobile/) is 2 directories above sandbox folder
path = [[NSHomeDirectory()stringByAppendingPathComponent:@"../.."]stringByAppendingPathComponent: relativeCachePath];
break;
case2:// If the app is anywhere else, default to hardcoded /var/mobile/
path = [@"/var/mobile"stringByAppendingPathComponent: relativeCachePath];
break;
default:// Cache not found (loop not broken)
return NO;
break; }
BOOL isDir = NO;
// path =@"/Users/luppy01/Library/Application Support/iPhone Simulator/6.0/Library/Caches/com.apple.mobile.installation.plist";
// path =@"/Users/luppy01/Library/Application Support/iPhone Simulator/7.0/Applications/0B627EE2-B818-4A7F-9A08-D7F856ACE4A8/Library/Caches/com.apple.mobile.installation.plist";
// if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] && !isDir) // Ensure that file exists
if ([[NSFileManagerdefaultManager]fileExistsAtPath: path ] )// Ensure that file exists
cacheDict = [NSDictionarydictionaryWithContentsOfFile: path];
if (cacheDict)// If cache is loaded, then break the loop. If the loop is not "broken," it will return NO later (default: case)
break;
}
NSDictionary *system = [cacheDictobjectForKey:@"System"];// First check all system (jailbroken) apps
if ([system objectForKey: bundleIdentifier])returnYES;
NSDictionary *user = [cacheDictobjectForKey:@"User"];// Then all the user (App Store /var/mobile/Applications) apps
if ([user objectForKey: bundleIdentifier])returnYES;
// If nothing returned YES already, we'll return NO now
returnNO;
}
实现`MobileInstallation.framework`相关方法
比较早的东西呢,拿出来和大家分享一下。
最近又开始研究越狱开发了,所以顺手把之前做的这个拿来。
Mobile Installation 是 iOS 中负责安装 IPA 和管理安装app的 Framework
91助手,同步推,itools,pp助手,等等都是用这写api
这是获取安装程序列表的一个demo:
http://www.iloss.me/post/kai-fa/2014-03-07-mobileinstallation
分析过程(ida)之前发过一次,时间久了找不到了。
完整代码: github
- 获取APP安装列表 已成功验证
- iOS获取app已安装列表和安装app
- 获取已安装应用列表
- 获取已安装应用列表
- ios获取本机已安装的app列表 前提是必须越狱才能获取
- 获取当前安装app列表
- ios获取已安装的应用列表
- Android---获取已安装应用列表
- 获取Windows已安装程序列表
- 获取系统已安装应用列表
- android 获取已安装app应用信息
- 获取已安装APP的信息
- 获取已安装APP的apk文件
- ADB检查APP已安装列,是否已安装,获取已安装APP的版本号,
- 获取iphone用户安装的app列表
- 获取iphone用户安装的app列表
- 获取手机安装的所有app列表
- jail brak 获取当前安装app列表
- hdu 1257 最少拦截系统
- SQL Server 2012 服务无法启动 Windows不能在本地计算机启动SQL Server(SQLEXPRESS)
- 曝孙杨已获驾照 曾无证驾车载年轻女子肇事
- Codeforces 392B Tower of Hanoi
- sproxy工具用法
- 获取APP安装列表 已成功验证
- 如何开笔记本电脑的无线WIFI(有图有真相)
- 《机器学习》学习笔记_0.参考书、学术资源
- linux串口编程
- fatal error LNK1123: 转换到 COFF 期间失败: 文件无效或损坏
- 保函
- hibernate mapping配置详解
- SDL Game Development-第四章(2)-输入处理2-处理鼠标移动
- 网站内容营销的要点