Function imessage_database::util::plist::parse_plist

source ·
pub fn parse_plist(plist: &Value) -> Result<Value, PlistParseError>
Expand description

Serialize a message’s payload_data BLOB from the NSKeyedArchiver format to a Dictionary that follows the references in the XML document’s UID pointers. First, we find the root of the document, then walk the structure, promoting values to the places where their pointers are stored.

For example, a document with a root pointing to some XML like

<array>
    <dict>
        <key>link</key>
        <dict>
             <key>CF$UID</key>
             <integer>2</integer>
        </dict>
    </dict>
    <string>https://chrissardegna.com</string>
</array>

Will serialize to a dictionary that looks like:

{
    link: https://chrissardegna.com
}

Some detail on this format is described here:

Internally, NSKeyedArchiver somewhat recapitulates the binary plist format by storing an object table array called $objects in the dictionary. Everything else, including class information, is referenced by a UID pointer. A $top entry under the dict points to the top-level object the programmer was meaning to encode.