What is the binary data around the plist in a provisioning profile file?

Chaitanya Gupta picture Chaitanya Gupta · Mar 15, 2012 · Viewed 7.4k times · Source

The structure of a .mobileprovision file looks something like this:

<!-- small binary data -->

<?xml version="1.0" encoding="UTF-8"?>
<!-- plist data -->
</plist>

<!-- large binary data -->

I have a few questions around this:

  1. What is this binary data?
  2. Is it useful?
  3. How can I extract the plist from a .mobileprovision file without searching for XML boundaries?

Specifically, I will consider this question as answered (and award the +100 bounty alongwith it) when both Q1 and Q3 above are answered.

Answer

Chaitanya Gupta picture Chaitanya Gupta · Jul 11, 2012

I finally got the answer from an answer to another question on SO.

Basically the .mobileprovision file is a CMS encrypted XML file. It can be decoded using security on OS X:

security cms -D -i /path/to/profile.mobileprovision