Skip to content

Instantly share code, notes, and snippets.

@tonycn
Created July 16, 2013 05:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save tonycn/6006098 to your computer and use it in GitHub Desktop.
Save tonycn/6006098 to your computer and use it in GitHub Desktop.
iOS OTA plist
'<div>',
'<img src="' + ((retina && item.icon2x) ? item.icon2x : item.icon) + '" />',
'<h3>' + item.name + "&nbsp;&nbsp;&nbsp;&nbsp;" + item.version + '</h3>',
'<p>' + item.created_at + '</p>',
'<a href="itms-services://?action=download-manifest&url=' + item.install_plist_url + '">下载App</a> &nbsp; &nbsp; &nbsp; &nbsp;',
'<a href="' + item.provisioning + '">下载证书</a>',
'</div>'
<?php
require "config.php";
$tmpl = <<<EOF
<?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>__URL__</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>__BUNDLE_ID__</string>
<key>bundle-version</key>
<string>1</string>
<key>kind</key>
<string>software</string>
<key>subtitle</key>
<string>__APP_VERSION__</string>
<key>title</key>
<string>__APP_NAME__</string>
</dict>
</dict>
</array>
</dict>
</plist>
EOF;
try {
$site_url_path ='http://' . $_SERVER['SERVER_NAME'].($site_subpath ? "/" . $site_subpath : "") ;
$app_base_path = $_GET['app_path'];
$app_info_array = parse_ini_file($app_base_path . "/app.ini");
$output_plist = str_replace("__URL__", $site_url_path . '/' . $app_base_path . "/app.ipa" ,$tmpl);
$output_plist = str_replace("__APP_VERSION__", $app_info_array["app_version"], $output_plist);
$output_plist = str_replace("__APP_NAME__", $app_info_array["app_name"] ,$output_plist);
$output_plist = str_replace("__BUNDLE_ID__", $app_info_array["app_bundle_id"] ,$output_plist);
header('Content-type: text/xml');
echo $output_plist;
} catch (Exception $e) {
echo 'Caught exception';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment