2013-07-24 23:25:47
原创作品,允许转载,转载时请务必以超链接形式标明文章
原始出处 、作者信息和本声明。否则将追究法律责任。
http://chenjohney.blog.51cto.com/4132124/1256610
1
2
|
#import "dlfcn.h"
typedefint (*MobileInstallationInstall)(NSString *path, NSDictionary *dict,
void
*na, NSString *path2_equal_path_maybe_no_use);
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
- (
int
)IPAInstall:(NSString *)path
{
void
*lib = dlopen(
"/System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation"
, RTLD_LAZY);
if
(lib)
{
MobileInstallationInstall pMobileInstallationInstall = (MobileInstallationInstall)dlsym(lib,
"MobileInstallationInstall"
);
if
(pMobileInstallationInstall){
int
ret = pMobileInstallationInstall(path, [NSDictionarydictionaryWithObject:@
"User"
forKey:@
"ApplicationType"
], nil, path);
dlclose(lib);
return
ret;
}
}
return
-
1
;
}
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<?
xml
version
=
"1.0"
encoding
=
"UTF-8"
?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<
plist
version
=
"1.0"
>
<
dict
>
<
key
>com.apple.private.mobileinstall.allowedSPI</
key
>
<
array
>
<
string
>Install</
string
>
<
string
>Browse</
string
>
<
string
>Uninstall</
string
>
<
string
>Archive</
string
>
<
string
>RemoveArchive</
string
>
</
array
>
</
dict
>
</
plist
>
|
1
|
ldid -Sentitlements.xml InstallApp.app
/InstallApp
|
1
|
ldid -e InstallApp.app
/InstallApp
|