MDM服务器未向设备发送推送通知

时间:2013-12-19 12:08:35

标签: apple-push-notifications mdm

用于测试的设备:iOS版本为4.2.1的iPhone 3GS

我设置简单mdm服务器的步骤

  1. 使用OSX服务器上的Server app获取推送通知证书。见下面的链接
    http://www.mountainlionserver.com/enable-push-notifications-in-os-x-mountain-lion-server/
    一旦获得,APNS安装在钥匙串中,从钥匙串导出APSP:XXXXX为.p12并使用“openssl pkcs12 -in pushCert.p12 -out pushCert.pem”转换为pem。使用删除密码短语openssl rsa -in pushCert.pem -out plainkey.pem。然后在文本编辑器中,将pushCert.pem中的加密RSA私钥部分替换为plainkey.pem的内容。
  2. 使用keychaing
  3. 创建了自签名的根CA.
  4. 使用带有mdm有效负载的IPCU创建配置文件,主题为“com.apple.mgmt.XServer.xxxxxxxxxxxxxxxxxxxx”并保存为.mobileconfig
  5. 运行python MDM服务器。
  6. 在步骤2中创建的iOS设备(3gs)上安装的自签名证书。
  7. 在设备(iOS 3gs)上成功安装.mobileconfig配置文件,在服务器上我看到设备已成功注册,我从设备获得了以下信息 PushMagic,Token和UnlockToken我将这些信息保存在一个文件中。
  8. 现在设备已注册服务器我尝试通过推送通知向设备发送“DeviceLock”命令。但没有任何反应。设备已连接到IPCU我也看不到有关推送通知的日志,这让我假设设备没有收到任何推送通知。

    以下是用于发送推送通知的代码

    • wrapper = APNSNotificationWrapper('pushcert.pem',False)
      message = APNSNotification()
      message.token(my_DeviceToken)
      message.appendProperty(APNSProperty('mdm',my_PushMagic))
      wrapper.append(消息)
      如果(wrapper.notify()):
              打印“消息已成功发送”
       其他:
          打印“无法向设备发送推送通知”
  9. 参考 http://media.blackhat.com/bh-us-11/Schuetz/BH_US_11_Schuetz_InsideAppleMDM_WP.pdf

0 个答案:

没有答案