Upload and download ITMS service protocol of ipa file in APP publishing system

Project requirements: internal test and distribution of APP, upload and download of ipa file of publishing system, use ITMS service protocol and jump and download in safari web page

  1. It is divided into download page (dl.html), text.plist file and test.ipa file address
  2. . ipa file upload to server download address
  3. Generate plist file xml format to upload to the file system and return to the download address
  4. Download page provides jump link

dl.html is as follows:

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>download</title>
<script type="text/javascript">

function $G(){

var Url=top.window.location.href;

var u,g,StrBack='';

if(arguments[arguments.length-1]=="#")

   u=Url.split("#");

else

   u=Url.split("?");

if (u.length==1) g='';

else g=u[1];

if(g!=''){

   gg=g.split("&");

   var MaxI=gg.length;

   str = arguments[0]+"=";

   for(i=0;i<MaxI;i++){

      if(gg[i].indexOf(str)==0) {

        StrBack=gg[i].replace(str,"");

        break;

      }

   }

}

return StrBack;

}
var id =$G('id');
if(!id){
alert("Illegal link, missing parameter!");
}
var id =$G('id');
//api generates xml dynamically according to id parameters
var url = 'https://xxx.xxx./api/plist';
//This is the key point. All parameters after index.php must be encoded to be valid
var en = encodeURIComponent("?id="+id);
url += en;
window.location.href = "itms-services://?action=download-manifest&url=" + url;
</script>
</head>
<body>
</body>
</html>

plist format is as follows:

<?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>https://xxx.com/test.ipa</string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>cn.vrv.im-inhouse</string>
<key>bundle-version</key>
<string>1.1</string>
<key>kind</key>
<string>software</string>
<key>subtitle</key>
<string>download</string>
<key>title</key>
<string>install</string>
</dict>
</dict>
</array>
</dict>
</plist>

Note that plist address and ipa file address are https addresses https://xxx.com/test.ipa

Published address https://xxx.com/dl.html?id=100 Generate plist file dynamically according to id and download ipa for installation

Reference tutorial: Install ipa online through itms:services: / /? Across app store https://www.cnblogs.com/sakura-panda/p/3628694.html

Tags: Programming xml Javascript PHP encoding

Posted on Fri, 13 Mar 2020 10:57:06 -0400 by cliffdodger