您现在的位置是:首页 > 技术教程 正文

IOS系统mobileconfig的作用,mobileconfig文件如何使用,苹果超级签实现

admin 阅读: 2024-03-29
后台-插件-广告管理-内容页头部广告(手机)

.mobileconfig是苹果系统配置描述文件,目前常用于苹果超级签获取设备UDID。

官方介绍:

配置描述⽂件是XML ⽂件,包含以下内容:设备安全策略、VPN 配置信息、Wi-Fi 设置、APN 设置、Exchange帐户设置、邮件设置以及允许 iPhone 和 iPod touch 与企业系统配合使⽤的证书。

“iPhone配置实⽤⼯具”可让您轻松地创建、维护和安装配置描述⽂件及对配置描述⽂件进⾏加密,跟踪和安装预置描述⽂件与授权的应⽤程序,以及采集包括控制台⽇志在内的设备信息。(这个⼯具可以从官⽹上进⾏下载)

⽬前所知的,安装这个配置⽂件除了上述的使⽤“iphone配置实⽤⼯具”之外,还可以通过邮件附件或通过使⽤safari浏览包含有下载的⽹页的⽅式激活安装(install profile窗⼝)。

1、代码示例

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. PayloadContent
  3. PayloadDisplayName
  4. LDAP Settings
  5. PayloadType
  6. com.apple.ldap.account
  7. PayloadVersion
  8. 1
  9. PayloadUUID
  10. 6df7a612-ce0a-4b4b-bce2-7b844e3c9df0
  11. PayloadIdentifier
  12. com.example.iPhone.settings.ldap
  13. LDAPAccountDescription
  14. Company Contacts
  15. LDAPAccountHostName
  16. ldap.example.com
  17. LDAPAccountUseSSL
  18. LDAPAccountUserName
  19. uid=username,dc=example,dc=com
  20. LDAPSearchSettings
  21. LDAPSearchSettingDescription
  22. Company Contacts
  23. LDAPSearchSettingSearchBase
  24. LDAPSearchSettingScope
  25. LDAPSearchSettingScopeSubtree
  26. LDAPSearchSettingDescription
  27. Sales Departments
  28. LDAPSearchSettingSearchBase
  29. ou=Sales,dc=example,dc=com
  30. LDAPSearchSettingScope
  31. LDAPSearchSettingScopeSubtree
  32. PayloadDisplayName
  33. Email Settings
  34. PayloadType
  35. com.apple.mail.managed
  36. PayloadVersion
  37. 1
  38. PayloadUUID
  39. 362e5c11-a332-4dfb-b18b-f6f0aac032fd
  40. PayloadIdentifier
  41. com.example.iPhone.settings.email
  42. EmailAccountDescription
  43. Company E-mail
  44. EmailAccountName
  45. Full Name
  46. EmailAccountType
  47. EmailTypeIMAP
  48. EmailAddress
  49. username@example.com
  50. IncomingMailServerAuthentication
  51. EmailAuthPassword
  52. IncomingMailServerHostName
  53. imap.example.com
  54. IncomingMailServerUseSSL
  55. IncomingMailServerUsername
  56. username@es2eng.com
  57. OutgoingPasswordSameAsIncomingPassword
  58. OutgoingMailServerAuthentication
  59. EmailAuthPassword
  60. OutgoingMailServerHostName
  61. smtp.example.com
  62. OutgoingMailServerUseSSL
  63. OutgoingMailServerUsername
  64. username@example.com
  65. PayloadOrganization
  66. Your Organization's Name
  67. PayloadDisplayName
  68. Organization iPhone Settings
  69. PayloadVersion
  70. 1
  71. PayloadUUID
  72. 954e6e8b-5489-484c-9b1d-0c9b7bf18e32
  73. PayloadIdentifier
  74. com.example.iPhone.settings
  75. PayloadDescription
  76. Sets up Organization's LDAP directories and email on the iPhone
  77. PayloadType
  78. Configuration

2、超级签获取UDID mobileconfig文件示例

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. PayloadContent
  3. URL
  4. http://127.0.0.1/receive.php
  5. DeviceAttributes
  6. UDID
  7. IMEI
  8. ICCID
  9. VERSION
  10. PRODUCT
  11. PayloadOrganization
  12. com.sssss.orgName
  13. PayloadDisplayName
  14. 获取设备UDID
  15. PayloadVersion
  16. 1
  17. PayloadUUID
  18. 3C4DC7D2-E475-3375-489C-0BB8D737A653
  19. PayloadIdentifier
  20. dev.skyfox.profile-service
  21. PayloadDescription
  22. 获取设备UDID
  23. PayloadType
  24. Profile Service

3、PHP服务端接收receive.php

  1. $data = file_get_contents('php://input');
  2. $plistBegin = '<?xml version="1.0"';
  3. $plistEnd = '';
  4. $data2 = substr($data, strpos($data, $plistBegin), strpos($data, $plistEnd) - strpos($data, $plistBegin));
  5. $xml = xml_parser_create();
  6. $UDID = "";
  7. $CHALLENGE = "";
  8. $DEVICE_NAME = "";
  9. $DEVICE_PRODUCT = "";
  10. $DEVICE_VERSION = "";
  11. $iterator = 0;
  12. $arrayCleaned = array();
  13. $data = "";
  14. xml_parse_into_struct($xml, $data2, $vs);
  15. xml_parser_free($xml);
  16. foreach ($vs as $v) {
  17. if ($v['level'] == 3 && $v['type'] == 'complete') {
  18. $arrayCleaned[] = $v;
  19. }
  20. }
  21. foreach ($arrayCleaned as $elem) {
  22. switch ($elem['value']) {
  23. case "CHALLENGE":
  24. $CHALLENGE = $arrayCleaned[$iterator + 1]['value'];
  25. break;
  26. case "DEVICE_NAME":
  27. $DEVICE_NAME = $arrayCleaned[$iterator + 1]['value'];
  28. break;
  29. case "PRODUCT":
  30. $DEVICE_PRODUCT = $arrayCleaned[$iterator + 1]['value'];
  31. break;
  32. case "UDID":
  33. $UDID = $arrayCleaned[$iterator + 1]['value'];
  34. break;
  35. case "VERSION":
  36. $DEVICE_VERSION = $arrayCleaned[$iterator + 1]['value'];
  37. break;
  38. }
  39. $iterator++;
  40. }
  41. header('HTTP/1.1 301 Moved Permanently'); //这⾥⼀定要301跳转,否则设备安装会提⽰"⽆效的描述⽂件"
  42. $url = "127.0.0.1/udid.php?udid=".$UDID."&version='.$DEVICE_VERSION.'&device_name='.$DEVICE_PRODUCT;
  43. header("Location: ".$url);

4、PHP服务端信息处理 udid.php

  1. $UDID = $_GET['UDID'];
  2. $version = $_GET['version'];
  3. $device_name = $_GET['device_name'];

标签:
声明

1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,请转载时务必注明文章作者和来源,不尊重原创的行为我们将追究责任;3.作者投稿可能会经我们编辑修改或补充。

在线投稿:投稿 站长QQ:1888636

后台-插件-广告管理-内容页尾部广告(手机)
关注我们

扫一扫关注我们,了解最新精彩内容

搜索
排行榜