.mobileconfig是苹果系统配置描述文件,目前常用于苹果超级签获取设备UDID。
官方介绍:
配置描述⽂件是XML ⽂件,包含以下内容:设备安全策略、VPN 配置信息、Wi-Fi 设置、APN 设置、Exchange帐户设置、邮件设置以及允许 iPhone 和 iPod touch 与企业系统配合使⽤的证书。
“iPhone配置实⽤⼯具”可让您轻松地创建、维护和安装配置描述⽂件及对配置描述⽂件进⾏加密,跟踪和安装预置描述⽂件与授权的应⽤程序,以及采集包括控制台⽇志在内的设备信息。(这个⼯具可以从官⽹上进⾏下载)
⽬前所知的,安装这个配置⽂件除了上述的使⽤“iphone配置实⽤⼯具”之外,还可以通过邮件附件或通过使⽤safari浏览包含有下载的⽹页的⽅式激活安装(install profile窗⼝)。
1、代码示例
PayloadContent PayloadDisplayName LDAP Settings PayloadType com.apple.ldap.account PayloadVersion 1 PayloadUUID 6df7a612-ce0a-4b4b-bce2-7b844e3c9df0 PayloadIdentifier com.example.iPhone.settings.ldap LDAPAccountDescription Company Contacts LDAPAccountHostName ldap.example.com LDAPAccountUseSSL LDAPAccountUserName uid=username,dc=example,dc=com LDAPSearchSettings LDAPSearchSettingDescription Company Contacts LDAPSearchSettingSearchBase LDAPSearchSettingScope LDAPSearchSettingScopeSubtree LDAPSearchSettingDescription Sales Departments LDAPSearchSettingSearchBase ou=Sales,dc=example,dc=com LDAPSearchSettingScope LDAPSearchSettingScopeSubtree PayloadDisplayName Email Settings PayloadType com.apple.mail.managed PayloadVersion 1 PayloadUUID 362e5c11-a332-4dfb-b18b-f6f0aac032fd PayloadIdentifier com.example.iPhone.settings.email EmailAccountDescription Company E-mail EmailAccountName Full Name EmailAccountType EmailTypeIMAP EmailAddress username@example.com IncomingMailServerAuthentication EmailAuthPassword IncomingMailServerHostName imap.example.com IncomingMailServerUseSSL IncomingMailServerUsername username@es2eng.com OutgoingPasswordSameAsIncomingPassword OutgoingMailServerAuthentication EmailAuthPassword OutgoingMailServerHostName smtp.example.com OutgoingMailServerUseSSL OutgoingMailServerUsername username@example.com PayloadOrganization Your Organization's Name PayloadDisplayName Organization iPhone Settings PayloadVersion 1 PayloadUUID 954e6e8b-5489-484c-9b1d-0c9b7bf18e32 PayloadIdentifier com.example.iPhone.settings PayloadDescription Sets up Organization's LDAP directories and email on the iPhone PayloadType Configuration
2、超级签获取UDID mobileconfig文件示例
PayloadContent URL http://127.0.0.1/receive.php DeviceAttributes UDID IMEI ICCID VERSION PRODUCT PayloadOrganization com.sssss.orgName PayloadDisplayName 获取设备UDID PayloadVersion 1 PayloadUUID 3C4DC7D2-E475-3375-489C-0BB8D737A653 PayloadIdentifier dev.skyfox.profile-service PayloadDescription 获取设备UDID PayloadType Profile Service
3、PHP服务端接收receive.php
$data = file_get_contents('php://input');$plistBegin = '';$data2 = substr($data, strpos($data, $plistBegin), strpos($data, $plistEnd) - strpos($data, $plistBegin));$xml = xml_parser_create();$UDID = "";$CHALLENGE = "";$DEVICE_NAME = "";$DEVICE_PRODUCT = "";$DEVICE_VERSION = "";$iterator = 0;$arrayCleaned = array();$data = "";xml_parse_into_struct($xml, $data2, $vs);xml_parser_free($xml);foreach ($vs as $v) { if ($v['level'] == 3 && $v['type'] == 'complete') { $arrayCleaned[] = $v; }} foreach ($arrayCleaned as $elem) { switch ($elem['value']) { case "CHALLENGE": $CHALLENGE = $arrayCleaned[$iterator + 1]['value']; break; case "DEVICE_NAME": $DEVICE_NAME = $arrayCleaned[$iterator + 1]['value']; break; case "PRODUCT": $DEVICE_PRODUCT = $arrayCleaned[$iterator + 1]['value']; break; case "UDID": $UDID = $arrayCleaned[$iterator + 1]['value']; break; case "VERSION": $DEVICE_VERSION = $arrayCleaned[$iterator + 1]['value']; break; } $iterator++;}header('HTTP/1.1 301 Moved Permanently'); //这⾥⼀定要301跳转,否则设备安装会提⽰"⽆效的描述⽂件"$url = "127.0.0.1/udid.php?udid=".$UDID."&version='.$DEVICE_VERSION.'&device_name='.$DEVICE_PRODUCT;header("Location: ".$url);
4、PHP服务端信息处理 udid.php
$UDID = $_GET['UDID'];$version = $_GET['version'];$device_name = $_GET['device_name'];
来源地址:https://blog.csdn.net/qq_24138677/article/details/128546025