有什么办法在非越狱情况下iphone上代码安装本地ipa ios

sexiong306 2015-05-13 05:21:30
最近研究ios的app安装方法,看到XY苹果助手的安装方式有闪装和下载安装两种方式,前者应该是itms-services协议的安装方式,但是后者看表现是应该是先将ipa下载到本地然后本地安装,但是查了半天只查到私有api(MobileInstallationInstall)方法,但是这个在非越狱的ios8.3(据说IOS6上就不行)上一直返回-1,有没有高手知道其他不越狱也能实现安装本地ipa的方法,下面是我查到的私有api的实现方法,但是目前没法用
typedef int (*MobileInstallationInstall)(NSString *path, NSDictionary *dict, void *na, NSString *path2_equal_path_maybe_no_use);
IPAResult IPAInstall(NSString *path)
{
void *lib = dlopen("/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation", RTLD_LAZY);
if (lib)
{
MobileInstallationInstall pMobileInstallationInstall = (MobileInstallationInstall)dlsym(lib, "MobileInstallationInstall");
if (pMobileInstallationInstall)
{
NSString *name = [@"Install_" stringByAppendingString:path.lastPathComponent];
NSString* temp = [NSTemporaryDirectory() stringByAppendingPathComponent:name];
if (![[NSFileManager defaultManager] copyItemAtPath:path toPath:temp error:nil]) return IPAResultFileNotFound;

int ret = (IPAResult)pMobileInstallationInstall(temp, [NSDictionary dictionaryWithObject:@"User" forKey:@"ApplicationType"], 0, path);
[[NSFileManager defaultManager] removeItemAtPath:temp error:nil];
return ret;
}
}
return IPAResultNoFunction;
}
...全文
654 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
q439133919 2016-05-29
  • 打赏
  • 举报
回复
楼主弄好了么?
john_lml 2015-12-11
  • 打赏
  • 举报
回复
xcode7 就可以随便装了....
baidu_32725121 2015-12-10
  • 打赏
  • 举报
回复
楼主实现代码的安装了吗
andylist 2015-11-15
  • 打赏
  • 举报
回复
在淘宝花10-15元买个证书就可以了
baidu_32725121 2015-11-11
  • 打赏
  • 举报
回复
楼主实现了吗
十万个逗 2015-11-11
  • 打赏
  • 举报
回复
公司企业账号 随便安。

29,027

社区成员

发帖
与我相关
我的任务
社区描述
主要讨论与iOS相关的软件和技术
社区管理员
  • iOS
  • 大熊猫侯佩
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧