1、已经越狱的 iPhone、iPad 设备,当通过其自带的 safari 浏览器访问 ipa 应用下载网站时,利用 itms-services 协议,可以一键安装 ipa 文件的 iOS 应用,例如:
<a href="itms-services://?action=download-manifest&url=http://blog.s135.com/demo/ios/jhsmyt.plist">通过越狱的iOS设备浏览器访问本页,点这儿一键安装APP应用。</a>
2、jhsmyt.plist 的内容如下:
<?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>items</key>
<array>
<dict>
<key>assets</key>
<array>
<dict>
<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>http://blog.s135.com/demo/ios/jhsmyt.ipa</string>
</dict>
<dict>
<key>kind</key>
<string>display-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>http://blog.s135.com/demo/ios/jhsmyt_logo.png</string>
</dict>
<dict>
<key>kind</key>
<string>full-size-image</string>
<key>needs-shine</key>
<true/>
<key>url</key>
<string>http://blog.s135.com/demo/ios/jhsmyt_logo.png</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>com.yijia.juhuasuan</string>
<key>bundle-version</key>
<string>1.0.0</string>
<key>kind</key>
<string>software</string>
<key>subtitle</key>
<string>聚划算每一天</string>
<key>title</key>
<string>聚划算每一天</string>
</dict>
</dict>
</array>
</dict>
</plist>
需要修改之处:
3、如果通过 iPhone、iPad 上的二维码扫描软件,还可以实现类似 Android 系统的扫描二维码下载 app 应用:
二维码内的网址地址为 http://blog.s135.com/demo/ios/autodown.htm 内容如下:
<html>
<head>
<title>iOS 越狱版安装</title>
<meta http-equiv="Content-Type" content="text/HTML; charset=utf-8">
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<script type="text/javascript">
function doLocation(url)
{
var a = document.createElement("a");
if(!a.click) {
window.location = url;
return;
}
a.setAttribute("href", url);
a.style.display = "none";
document.body.appendChild(a);
a.click();
}
</script>
</head>
<body >
<script type="text/javascript">
doLocation('itms-services://?action=download-manifest&url=http://blog.s135.com/demo/ios/jhsmyt.plist');
</script>
</body>
</html>
4、完整的 Demo 示例: