0

我创建了一个包含常规、限制、凭据、移动设备管理有效负载的移动配置文件。我可以在我的“受监督”iPhone4S 中成功安装配置文件。从服务器,设备锁定命令工作正常。但是 AppLock 命令不起作用?以下是该设备的日志和服务器的代码。

Oct 31 11:33:16 iPhone4S-1 mdmd[156] <Notice>: (Note ) MDM: Received push notification.
Oct 31 11:33:16 iPhone4S-1 mdmd[156] <Notice>: (Warn ) MDM: Ignoring extra keys in push dictionary: {
        aps =     {
        };
    }
Oct 31 11:33:16 iPhone4S-1 mdmd[156] <Notice>: (Note ) MDM: Polling MDM server https://ec2-54-172-70-193.compute-1.amazonaws.com/MDMServer/mdm/server for next command.
Oct 31 11:33:19 iPhone4S-1 mdmd[156] <Notice>: (Note ) MDM: Transaction completed. Status: 200
Oct 31 11:33:19 iPhone4S-1 mdmd[156] <Notice>: (Note ) MDM: Polling MDM server https://ec2-54-172-70-193.compute-1.amazonaws.com/MDMServer/mdm/server for next command.
Oct 31 11:33:19 iPhone4S-1 mdmd[156] <Notice>: (Note ) MDM: Transaction completed. Status: 200
Oct 31 11:33:19 iPhone4S-1 mdmd[156] <Notice>: (Note ) MDM: Polling MDM server https://ec2-54-172-70-193.compute-1.amazonaws.com/MDMServer/mdm/server for next command.

服务器代码:

public static String getAppLockPList(){
        StringBuffer backString = new StringBuffer();
        backString.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        backString.append("<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"");
        backString.append("\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">");
        backString.append("<plist version=\"1.0\">");
        backString.append("<dict>");
        backString.append("<key>PayloadContent</key>");
        backString.append("<array>");
        backString.append("<dict>");
        backString.append("<key>App</key>");
        backString.append("<dict>");
        backString.append("<key>Identifier</key>");
        backString.append("<string>com.company.identifier</string>");
        backString.append("</dict>");
        backString.append("<key>PayloadType</key>");
        backString.append("<string>com.apple.app.lock</string>");
        backString.append("<key>PayloadIdentifier</key>");
        backString.append("<string>com.company.identifier</string>");
        backString.append("<key>PayloadUUID</key>");
        backString.append("<string>d7e27098ad530884664a98a6f93ab3796f97b</string>");
        backString.append("<key>PayloadVersion</key>");
        backString.append("<integer>1</integer>");
        backString.append("</dict>");
        backString.append("</array>");
        backString.append("<key>PayloadType</key>");
        backString.append("<string>Configuration</string>");
        /*backString.append("<key>PayloadDisplayName</key>");
        backString.append("<string>##########</string>");*/
        backString.append("<key>PayloadIdentifier</key>");
        backString.append("<string>com.company.identifier</string>");
        backString.append("<key>PayloadUUID</key>");
        backString.append("<string>d7e27098ad530884664a98a6f93ab3796f97b</string>");
        backString.append("<key>PayloadVersion</key>");
        backString.append("<integer>1</integer>");
        backString.append("</dict></plist>");
        return backString.toString();
    }

请在下面找到 xml 格式的配置文件

 <?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>PayloadContent</key>
    <array>
        <dict>
            <key>PayloadDescription</key>
            <string>Configures device restrictions.</string>
            <key>PayloadDisplayName</key>
            <string>Restrictions</string>
            <key>PayloadIdentifier</key>
            <string>com.CompanyName.profile.restrictions</string>
            <key>PayloadOrganization</key>
            <string>CompanyName</string>
            <key>PayloadType</key>
            <string>com.apple.applicationaccess</string>
            <key>PayloadUUID</key>
            <string>D15DC96C-BC33-4F81-8966-01CCCF0A82D0</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>allowAddingGameCenterFriends</key>
            <true/>
            <key>allowAppInstallation</key>
            <true/>
            <key>allowAssistant</key>
            <true/>
            <key>allowAssistantWhileLocked</key>
            <true/>
            <key>allowCamera</key>
            <true/>
            <key>allowCloudBackup</key>
            <true/>
            <key>allowCloudDocumentSync</key>
            <true/>
            <key>allowDiagnosticSubmission</key>
            <true/>
            <key>allowExplicitContent</key>
            <true/>
            <key>allowGlobalBackgroundFetchWhenRoaming</key>
            <true/>
            <key>allowInAppPurchases</key>
            <true/>
            <key>allowMultiplayerGaming</key>
            <true/>
            <key>allowPhotoStream</key>
            <true/>
            <key>allowSafari</key>
            <true/>
            <key>allowScreenShot</key>
            <true/>
            <key>allowUntrustedTLSPrompt</key>
            <true/>
            <key>allowVideoConferencing</key>
            <true/>
            <key>allowVoiceDialing</key>
            <true/>
            <key>allowYouTube</key>
            <true/>
            <key>allowiTunes</key>
            <true/>
            <key>forceEncryptedBackup</key>
            <false/>
            <key>forceITunesStorePasswordEntry</key>
            <false/>
            <key>ratingApps</key>
            <integer>1000</integer>
            <key>ratingMovies</key>
            <integer>1000</integer>
            <key>ratingRegion</key>
            <string>us</string>
            <key>ratingTVShows</key>
            <integer>1000</integer>
            <key>safariAcceptCookies</key>
            <integer>2</integer>
            <key>safariAllowAutoFill</key>
            <true/>
            <key>safariAllowJavaScript</key>
            <true/>
            <key>safariAllowPopups</key>
            <true/>
            <key>safariForceFraudWarning</key>
            <false/>
        </dict>
        <dict>
            <key>AccessRights</key>
            <integer>8191</integer>
            <key>CheckInURL</key>
            <string>https://ec2-54-172-70-193.compute-1.amazonaws.com/MDMServer/mdm/checkin</string>
            <key>CheckOutWhenRemoved</key>
            <false/>
            <key>IdentityCertificateUUID</key>
            <string>749B7EDD-C654-499D-9FDA-1DC18A8CC0A6</string>
            <key>PayloadDescription</key>
            <string>Configures Mobile Device Management</string>
            <key>PayloadDisplayName</key>
            <string>Mobile Device Management</string>
            <key>PayloadIdentifier</key>
            <string>com.CompanyName.profile.mdm</string>
            <key>PayloadOrganization</key>
            <string>CompanyName</string>
            <key>PayloadType</key>
            <string>com.apple.mdm</string>
            <key>PayloadUUID</key>
            <string>8B88AAD9-F316-47AF-BE74-B013D97700F6</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
            <key>ServerURL</key>
            <string>https://ec2-54-172-70-193.compute-1.amazonaws.com/MDMServer/mdm/server</string>
            <key>SignMessage</key>
            <false/>
            <key>Topic</key>
            <string>com.apple.mgmt.External.7a6c9d9a-4d0a-4235-97fd-0ac22f99acd0</string>
        </dict>
        <dict>
            <key>PayloadCertificateFileName</key>
            <string>server.crt</string>
            <key>PayloadContent</key>
            <data>
            LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUQyakNDQXNJ
            Q0NRRGV6bDZRRGtpaUZ6QU5CZ2txaGtpRzl3MEJBUVVGQURDQnJq
            RUxNQWtHQTFVRUJoTUMKVlZNeEN6QUpCZ05WQkFnTUFreEJNUkl3
            RUFZRFZRUUhEQWxEVDFaSlRrZFVUMDR4RERBS0JnTlZCQW9NQTBG
            QgpVekVNTUFvR0ExVUVDd3dEUkVWV01USXdNQVlEVlFRRERDbGxZ
            ekl0TlRRdE1UY3lMVGN3TFRFNU55NWpiMjF3CmRYUmxMVEV1WVcx
            aGVtOXVZWGR6TG1OdmJURXVNQ3dHQ1NxR1NJYjNEUUVKQVJZZmMz
            VmthR1ZsY2k1d1lXeGoKYUhWeWFVQjBaV05vZG1Wa2FXdGhMbU52
            YlRBZUZ3MHhOREV3TWpjeE1USTVORGhhRncweE5URXdNamN4TVRJ
            NQpORGhhTUlHdU1Rc3dDUVlEVlFRR0V3SlZVekVMTUFrR0ExVUVD
            QXdDVEVFeEVqQVFCZ05WQkFjTUNVTlBWa2xPClIxUlBUakVNTUFv
            R0ExVUVDZ3dEUVVGVE1Rd3dDZ1lEVlFRTERBTkVSVll4TWpBd0Jn
            TlZCQU1NS1dWak1pMDEKTkMweE56SXROekF0TVRrM0xtTnZiWEIx
            ZEdVdE1TNWhiV0Y2YjI1aGQzTXVZMjl0TVM0d0xBWUpLb1pJaHZj
            TgpBUWtCRmg5emRXUm9aV1Z5TG5CaGJHTm9kWEpwUUhSbFkyaDJa
            V1JwYTJFdVkyOXRNSUlCSWpBTkJna3Foa2lHCjl3MEJBUUVGQUFP
            Q0FROEFNSUlCQ2dLQ0FRRUF1QTFtamFOdkh2bWF2MFBMYkNkWENG
            bHd4SXNReWs1a24zSkcKT1pOUVo5VEN1QzZqTGV5ZHlmQjFTaUhO
            MEY4RktTeGN4ZzdyaEhkL2RZeUdWL1RQcEVXc2t3RXJOMytkVUsr
            YwpyNHZyK0R3RVEvWGhhNEVvRld3dTVHYUdJZ1MwU20wK1dSbGQ1
            VUhoZGFITXdhQnFWMWwxOCtZdzc5NkV3RE4rCktlYWVEcXliWGVz
            S2N2ZXd4YXV1dnB2bEcxMUpTYlJ0QTU2bmo3bEZ1Vk5scTdISGtu
            allnRUlLY29SbEIwalgKbHR0bjB0cUI1d2ZteTVjZFk5Q09GTkVE
            c2Y3ZnFKZ3hITXAwZHRrbDdEYU9iU1dWOGUwbEFyQ2I0VW9ndzFL
            RApObU1YZjErYW5ZdEVQSjQ4Y0w5bGtOYldRVkdxemV2ckNqWUxN
            RmV2SElyMEd6UVlOd0lEQVFBQk1BMEdDU3FHClNJYjNEUUVCQlFV
            QUE0SUJBUUJON1JFMzVsTnlJa1RxLzVQTkZ2SlV0MzRPNE1Fei9U
            UThjZ1M1a1JxcURwb08KeDB5ZldXbktCV05EcWtJN1hPR3YzZHFy
            QWtVUnlKTWFiTFc2cEcrSUxyeFZ4Um9mQzY0WlBWUUtCc3U4MThI
            dQpmZUUySjRDcnhlLzFadUkvWjE5L0lLV2YyYkM1aTlZblY3WjBx
            Vll5NTh5MVV2NXhNYUlhSEhuT3JoTFJOUG5zCkxncWdsMlNrYWxu
            LzR3U3BkZGZCcHNwbkJSZTI2R3A5QjRyaVN6WmZmQldIWU5jWllt
            aHduR2h3aDB0Q3pVQlIKQnN0NnlSU1VYODFnQ2NHSHk3NEhmY3hp
            c0M1RC94djlxbnNpd21IVFJNV1lOSUF1L01NTWJpNnlFcmJpbXBU
            Swptakx4UnV3RHk2T3d6ajlkcDNNK1VKbis4VUJ6cDlBRzBicWFn
            MndDCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
            </data>
            <key>PayloadDescription</key>
            <string>Provides device authentication (certificate or identity).</string>
            <key>PayloadDisplayName</key>
            <string>ec2-54-172-70-197.compute-1.amazonaws.com</string>
            <key>PayloadIdentifier</key>
            <string>com.CompanyName.profile.credential</string>
            <key>PayloadOrganization</key>
            <string>CompanyName</string>
            <key>PayloadType</key>
            <string>com.apple.security.root</string>
            <key>PayloadUUID</key>
            <string>19C79CA5-2578-4586-BAEC-650B7FCA12C1</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
        <dict>
            <key>Password</key>
            <string>123456</string>
            <key>PayloadCertificateFileName</key>
            <string>server.p12</string>
            <key>PayloadContent</key>
            <data>
            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
            HjaXCL8CAggA
            </data>
            <key>PayloadDescription</key>
            <string>Provides device authentication (certificate or identity).</string>
            <key>PayloadDisplayName</key>
            <string>server.p12</string>
            <key>PayloadIdentifier</key>
            <string>com.CompanyName.profile.credential1</string>
            <key>PayloadOrganization</key>
            <string>CompanyName</string>
            <key>PayloadType</key>
            <string>com.apple.security.pkcs12</string>
            <key>PayloadUUID</key>
            <string>749B7EDD-C654-499D-9FDA-1DC18A8CC0A6</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
        <dict>
            <key>Password</key>
            <string>123456</string>
            <key>PayloadCertificateFileName</key>
            <string>Certificates.p12</string>
            <key>PayloadContent</key>
            <data>
            MIIMYQIBAzCCDCgGCSqGSIb3DQEHAaCCDBkEggwVMIIMETCCBo8G
            CSqGSIb3DQEHBqCCBoAwggZ8AgEAMIIGdQYJKoZIhvcNAQcBMBwG
            CiqGSIb3DQEMAQYwDgQIj0I1v5MwSRgCAggAgIIGSN0I7VDTYrsj
            mJxLST8Eb0bXoQGLrTAUNzVSwy3w2kQkSMQ4y4xQgAhzQgZTLQ22
            MWo0Xy+QYGNOZ/XX1aEavRTubTPR9YSzW8Znri9f3O3rOhfVeYtN
            3V/5xdh086iKm50XAyE9Pp/kqdZFmroIm8tFUI5AcDHcqWyTXd1i
            MhYm+Sf0h3KU8r4GCD65ifGSgaxtQtVoDzv3lVH/jukAImCmaIu6
            GbrbKr3mae4q0YvK726a8AOEnqWL3jolVHV+6Ny2SC44gOqInwZz
            V7gYFGD4OZ5mXMZ7kiFiEGbBO+7LHlPmbh3RGrDY1SG9Xnb1Kvle
            LYomITngcGuzXXIwkqX8HxCxHeUXSrVysSKj33s6JEpx1BnNE6k2
            vGIb+0wj+tmdy1/F9wGHkMD9bINw8rPNy2tslgmlXJ3nzBPmeoGI
            OmGb2JLYhjC1Xo3lLQH8wvz5Rto574eVzm9Vrlx3JRakqHFBNVa2
            uLnEofVKVWtOinU3dOutackNnqjE/8xVxBjiD7Ndgi72hrn1IVoZ
            b0L2Bb2Ol0Ok6kUumnf1UUCgMn1+v1hjQgZt1mrmMVaNkDG5qLTq
            LQarqwWXzlTQAu3dlL5PmE5vzMz1fuSUyIF/tCKohNQ3Ac/i8Gec
            luebwhUCBrIZvLhqbxBojD4rifOpWpxZcOXpypg7DEh2CkyZdMJ6
            YRtP2oWblsyLnRq2qyzCvyrpp6hVYEYp+Lps8pRUu7Cpi+/yZzXx
            18KurWHVW7OeGZlrkm2YoaVydMjI280jVjfh81z+8MIrQvSqBfRU
            XG/Kkwzv6FvW7A7c/PzvZfGSk0r2ZjY/fC9/FvEcaGHW5kDFdEV8
            XHoMjIaU/42ntYay9ERlaoxYhKnFaCoUTkbRPX+znSvYumbr8DSq
            0GA2xrD8l0JUKDoAX4A/mt8XaeNJWCfTsFPI1t4VwaWQvlTSvOO6
            ZCv/UQ2F9ZrA7+dbYJ8hjWxpNEGY6gBIuBrlfx+g/16p1UazHlu+
            7oCis7EbooFEQDeD/rPj3UWiJ6mD8zln/IGl/ItT9wmrr8HM7vzG
            3jU8bFOQz1LQzttQEaTxUcMv4Ww0whrQI4OSiiQrPHhsPBKSsWOR
            9qZ3zIePVo1bHF/vZa4Y7pfNjjpg0KYk9xugzBQUhIsZuV/B3tm5
            YDEhLe8WoSY1SSAoI9nxYYzSCCGtsAxPDcUoScfFgGNER41R+e7f
            6Phy6fBQFEYpEx/F6D8TJxiZbFLOiULMt1MUgALWNbF+Zy8uuCkV
            sIKKJTUnyUUQ/MHHzkJSjmt5ODwir38ayc9z8YrSXKfcEbtXWwgn
            ADxLMMv5mzNNmefbVJdhdSLwTV4HNOz8BGXNxCiIROVuH/TUgwEY
            2umI6+LKdQVrBmTO0hMz8aRNNcHwdKMtQmelJ/4PUWWVCvCU86z6
            Ww8SDeOinoJaXUBnPUXbtakaXQwXpiGdXdJR7YcGilcKAS06AWhh
            56dDV/66BQUUExoRSjPlPIPHzD5wb005eCk1Mpc2nZkPbewCvL+b
            i3oa4+KSOrFsD3lJsuP5i6UUUb6S4lAU9aNaiwB9/sRW2vo+XyUG
            seuXy25avGteGTz4gIcyIVYGV4awPArrWO1ek89Q/KyOznGFwFic
            dya83kvD8jVrP4o12T1jpw7DZkEi7iVxYbgSh0RQnwMzezI4VZ6k
            zkzhL+DDl957Dpw37bkEnOKEUz/5wR9mTuKgJUE55E46HSY49AW8
            dZCGhL8gA14VFPbApesHGulaNGGcikBFRi/IG4nOQ99+x8D2gOm+
            uY9KWZXXnd+017m6tBZfUBTLCC6dSzMYtxM1eNRHFiZarCL62FtZ
            VTb3Fv7GtSf0aGeWqNvHOamDGZ+fxTf8Q1QA07MqIS2OVvDv2FK/
            DTCJQ/S7Ys8EVTBj8gjnwkY5/XHY2XRs/L3kcZsNzKHwjAWJZcgq
            gXkaqBy5dGpL5kSMo+zdoRmBSb0n9qNZafRa9OcIgO4uZQOdi/uf
            bvHZ5mJf7q6cNMmCE031UfykhrhqF2ZV6GRuvyOgz4R4VHEYDGSx
            MybdedsY9PqhfOF+AMzi2/SSwVJCgZ2iHH8a0ZvnKHTD7SOTZt5R
            xYN8dTyEOESm+pe1eE+efhLcMhjg/GGovSAfAl5tQTXS06oPiKgI
            cTCCBXoGCSqGSIb3DQEHAaCCBWsEggVnMIIFYzCCBV8GCyqGSIb3
            DQEMCgECoIIE7jCCBOowHAYKKoZIhvcNAQwBAzAOBAhJuHpGpLXE
            eAICCAAEggTIsDN/QCBzoUexxdP2gryobLSlWwfj+0mjENfiCUbX
            h6af+khWiIpvpBaUiZ7ydkU6fg85hLsxC1z6GoUV6QhegL84r2Rj
            X8uevzJykqHUb0lmu9yZ5Qo6mKLQz1q+dHABQeWHq/ykrxGNCnPs
            4eqmQc7Hx72KFDGwECUThI3dhujEyXouALDt9dww6csXSjPzJFsN
            6sjnikp52N/moZ1jrLU/MS06FvEee8JU+emsGJUenVuvmmLtOCXA
            n3Ha9xKIrqBg6Xb+bADEeBkYViUNetKd4iKe7zfKtamOphQA4nvq
            qTN2fBCCgTwE5Ydx7v9uTCuKSdyb7rtgwZDAOw4Of+tl5akHz1di
            XnRzqaRpPve2urc+28g4fN5D2z1VefmSWopueH3y0BXK22OmASWy
            aZWy9PJlL3jm0rZkitMn9uJHtyZsUsobuQQmAfNEuPD3Xy9hST9c
            KEtByfZ4S5bAgX778zotewWxVfLMiqT0c02YiC6Q85XENCMdfRRp
            4bKq9DWL0kp8KpBV9i5fQHHnZVT4D0f5KVKfc34vFKfnUUhs9VzH
            xjYO1ALCSqEYsJwifykTKhxJh5cGlbLjpGW+FHfjcgGhTtELeEzs
            qXoFHh/kOyrikBJJ5VXN4JS3Q0NN2IZK7i5bacXedmkwH6zAWj/8
            t4OxUCIyjFOqh7CppEJc+wqs6h7/GohJdXDEuO4Dhl5AbWC9XAe5
            2B5vGHvgJnuRyIBea3tBKEoXM0uXqrANMy9OYrhLXljHA4/dw8lx
            M82WJRPFHfaz3aE517V7699VGn5AFT7NoNBLPPG7PEI2MgiO+8XR
            9LP1Gawxxr0Q4qIicL7GYFYzu1WCSZnk+22uXkfu4l7VfGXNnBC2
            fhBMRSWmMh+UcQSeOwXhh6Fm8k2Hy/gj4mM3yOEOnYf8szUmTiPU
            XRqUGy2nx2qmgkisl4QqFyORV72RxsCTY2oP3WIAyMafpnzf9Mj3
            jqUWkCvK78grd6iVAZuLDT1TZFlPZWEjPG5kBjyXqIORwXF0s1Dr
            PuhcYVEhAzjY6nDWo45TBAOPVio3h4XeDCVGHl2v96FSzGUNoBJG
            ibTanK4v3i5MhOAEShELiYbSGiiUT8xf5xh8Qla5EvCRK5vH11af
            WdbO4WOqgElGkNKphvfTnRPpR5PREJmVCmZbAaUuddKu7an8n2Z/
            w5otrUiihnIir6EhzSc8NqOF5PpmI/vNzxhKVsPC5W0E0ZApU82N
            Zl2NiKYuaQUzEypKaO+jkb2M7wv5UngozpVFi3oRrDnfbJtwJrWa
            mcL0S25zqyFNn0J6DFMuaFm0vVbIvNNyaF2rL+R00xpnPQtKzpOI
            e+CkKkY8bO6wcE7+t3ugVs/zbKyAMZuGbVsP2bOOmGlWLJPeqU7O
            jeXvB6vz65wZ9OPGdzRoxRltJt8WHhoPm87vaxTeGW6sK6jxsH3E
            nutV5Q27ZCjuKcf1xmCCeeA2Qqs4Mf5K+Lm6I/ShJWfnzJZx8jDK
            AXx+A4bumVckHqFnhJuG6LXHxZ55dup/ZEhVNPzJkk6UWo+5+ICo
            aL7Nv2zoYN/vk1aFBs1BzfGuuDcOlf6OoOiklaWIQsmYCUhwWpbS
            EBXTIA3HV6q4HaNZf4HocHnjR+AT676BMV4wNwYJKoZIhvcNAQkU
            MSoeKABOAEMATABCAEEAUABOAHMAQwBlAHIAdABpAGYAaQBjAGEA
            dABlAAAwIwYJKoZIhvcNAQkVMRYEFB7uPXHKQh/clyHk1QskdYHT
            KsnwMDAwITAJBgUrDgMCGgUABBSYgydM2stH11wxZee0m+YnZMSi
            LAQI23tR0RLhb7gCAQE=
            </data>
            <key>PayloadDescription</key>
            <string>Provides device authentication (certificate or identity).</string>
            <key>PayloadDisplayName</key>
            <string>Certificates.p12</string>
            <key>PayloadIdentifier</key>
            <string>com.CompanyName.profile.credential2</string>
            <key>PayloadOrganization</key>
            <string>CompanyName</string>
            <key>PayloadType</key>
            <string>com.apple.security.pkcs12</string>
            <key>PayloadUUID</key>
            <string>1C5BCFF1-F276-4E35-B4A7-056749FCC3EA</string>
            <key>PayloadVersion</key>
            <integer>1</integer>
        </dict>
    </array>
    <key>PayloadDescription</key>
    <string>CompanyName MDM Profile v1.0
</string>
    <key>PayloadDisplayName</key>
    <string>CompanyName MDM Profile</string>
    <key>PayloadIdentifier</key>
    <string>com.CompanyName.profile</string>
    <key>PayloadOrganization</key>
    <string>CompanyName</string>
    <key>PayloadRemovalDisallowed</key>
    <false/>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadUUID</key>
    <string>5A17C3F3-BAFE-4E8C-93F2-B17225547444</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
</dict>
</plist>
4

2 回答 2

0

Are you sure that server actually returns this command? It doesn't say anything in the logs about wrong profile or anything like it.

Also, do you have application with id "com.company.identifier" installed? It's quite strange that both your PayloadIdentifier and Identifier are the same. First could be generally anything. The second should match application id which you want to be device locked in.

于 2014-10-31T17:31:03.657 回答
0

我通过将“有效负载”设为 base64 编码字符串来解决此问题。以下是我的 plist 和有效负载文件内容。

public static String getAppLockPList(){
        StringBuffer backString = new StringBuffer();
        backString.append("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
        backString.append("<!DOCTYPE pPist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\"");
        backString.append("\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">");
        backString.append("<plist version=\"1.0\">");
        backString.append("<dict>");
        backString.append("<key>Command</key>");
        backString.append("<dict>");
        backString.append("<key>RequestType</key>");
        backString.append("<string>");
        backString.append("InstallProfile");
        backString.append("</string>");
        backString.append("<key>Payload</key>");
        backString.append("<data>PD94bWwgdmVyc2lvbj0iMS4wIj8+DQo8cGxpc3QgdmVyc2lvbj0iMS4wIj4NCiAgPGRpY3Q+DQogICAgPGtleT5QYXlsb2FkQ29udGVudDwva2V5Pg0KICAgIDxhcnJheT4NCiAgICAgIDxkaWN0Pg0KICAgICAgICA8a2V5PkFwcDwva2V5Pg0KICAgICAgICA8ZGljdD4NCiAgICAgICAgICA8a2V5PklkZW50aWZpZXI8L2tleT4NCiAgICAgICAgICA8c3RyaW5nPmNvbS50cmlwc2NvcGVhcHAudHJpcHNjb3BlPC9zdHJpbmc+DQogICAgICAgIDwvZGljdD4NCiAgICAgICAgPGtleT5QYXlsb2FkVHlwZTwva2V5Pg0KICAgICAgICA8c3RyaW5nPmNvbS5hcHBsZS5hcHAubG9jazwvc3RyaW5nPg0KICAgICAgICA8a2V5PlBheWxvYWRJZGVudGlmaWVyPC9rZXk+DQogICAgICAgIDxzdHJpbmc+Y29tLmFwcGxlLm1nbXQuRXh0ZXJuYWwuN2E2YzlkOWEtNGQwYS00MjM1LTk3ZmQtMGFjMjJmOTlhY2QwPC9zdHJpbmc+DQogICAgICAgIDxrZXk+UGF5bG9hZFVVSUQ8L2tleT4NCiAgICAgICAgPHN0cmluZz5kN2UyNzA5OGFkNTMwODg0NjY0YTk4YTZmOTNhYjM3OTZmOTdiNDE0PC9zdHJpbmc+DQogICAgICAgIDxrZXk+UGF5bG9hZFZlcnNpb248L2tleT4NCiAgICAgICAgPGludGVnZXI+MTwvaW50ZWdlcj4NCiAgICAgIDwvZGljdD4NCiAgICA8L2FycmF5Pg0KICAgIDxrZXk+UGF5bG9hZFR5cGU8L2tleT4NCiAgICA8c3RyaW5nPkNvbmZpZ3VyYXRpb248L3N0cmluZz4NCiAgICA8a2V5PlBheWxvYWREaXNwbGF5TmFtZTwva2V5Pg0KICAgIDxzdHJpbmc+QXBwbG9ja1BheWxvYWQ8L3N0cmluZz4NCiAgICA8a2V5PlBheWxvYWRJZGVudGlmaWVyPC9rZXk+DQogICAgPHN0cmluZz5jb20uYXBwbGUubWdtdC5FeHRlcm5hbC43YTZjOWQ5YS00ZDBhLTQyMzUtOTdmZC0wYWMyMmY5OWFjZDA8L3N0cmluZz4NCiAgICA8a2V5PlBheWxvYWRVVUlEPC9rZXk+DQogICAgPHN0cmluZz5kN2UyNzA5OGFkNTMwODg0NjY0YTk4YTZmOTNhYjM3OTZmOTdiNDE0PC9zdHJpbmc+DQogICAgPGtleT5QYXlsb2FkVmVyc2lvbjwva2V5Pg0KICAgIDxpbnRlZ2VyPjE8L2ludGVnZXI+DQogIDwvZGljdD4NCjwvcGxpc3Q+</data>");
        backString.append("</dict>");
        backString.append("<key>CommandUUID</key>");
        backString.append("<string>");
        backString.append("InstallProfileCommand");
        backString.append("</string>");
        backString.append("</dict>");
        backString.append("</plist>");
        return backString.toString();
    }

有效载荷内容:

<?xml version="1.0"?>
<plist version="1.0">
  <dict>
    <key>PayloadContent</key>
    <array>
      <dict>
        <key>App</key>
        <dict>
          <key>Identifier</key>
          <string>com.companyname.appname</string>
        </dict>
        <key>PayloadType</key>
        <string>com.apple.app.lock</string>
        <key>PayloadIdentifier</key>
        <string>com.apple.mgmt.External.7a6c9d9a-4d0a-4235-97fd-0ac22f99acd0</string>
        <key>PayloadUUID</key>
        <string>d7e27098ad530884664a98a6f93ab3796f97b441</string>
        <key>PayloadVersion</key>
        <integer>1</integer>
      </dict>
    </array>
    <key>PayloadType</key>
    <string>Configuration</string>
    <key>PayloadDisplayName</key>
    <string>ApplockPayload</string>
    <key>PayloadIdentifier</key>
    <string>com.apple.mgmt.External.7a6c9d9a-4d0a-4235-97fd-0ac22f99acd0</string>
    <key>PayloadUUID</key>
    <string>d7e27098ad530884664a98a6f93ab3796f97b441</string>
    <key>PayloadVersion</key>
    <integer>1</integer>
  </dict>
</plist>
于 2014-11-03T09:23:30.680 回答