Backend API. Server-side code: this runs in a Codename One backend, not in the app on the device.

public final class PropertyLists

  1. Object
  2. PropertyLists

Reads Apple XML property lists: provisioning profiles, entitlements, Info.plist files.

Map<String, Object> profile = (Map<String, Object>) PropertyLists.parse(mobileprovisionBytes);
String team = (String) ((List<Object>) profile.get("TeamIdentifier")).get(0);
Date expires = (Date) profile.get("ExpirationDate");

Values map to Java types as follows:

plistJava
<dict>Map<String, Object>, in document order
<array>List<Object>
<string>String
<integer>Long
<real>Double
<true/> <false/>Boolean
<data>byte[], base64 decoded
<date>java.util.Date (UTC, as 2025-01-31T12:00:00Z is written)

Check a value’s type with instanceof before casting it.

A provisioning profile (.mobileprovision) is not a plist itself but a CMS/PKCS#7 signed envelope with the XML plist inside it. [#parse(byte[])] accepts it as it is, by locating the plist with [#extractXml(byte[])]; the signature is not verified. Binary property lists (bplist00) are not supported and are reported as such.

Parsing goes through the shared XMLParser refusing malformed input, so a document type declaration is never interpreted and nesting is bounded: a hostile plist cannot fetch a URL, expand entities or exhaust the stack.

Methods

public static Object parse(byte[] data)Parses a property list – an XML plist, or any binary blob that wraps one, such as a signed provisioning profile – and answers its top-level value, usually a Map<String, Object>.
public static Object parse(String xml)Parses an XML property list held in a string.
public static byte[] extractXml(byte[] data)Finds the XML property list embedded in binary data and answers its bytes, from <?xml (or <plist when there is no declaration) through the end of the first </plist> after it; null when there is none.

Inherited methods

Method details

parse

public static Object parse(byte[] data)
Parses a property list – an XML plist, or any binary blob that wraps one, such as a signed provisioning profile – and answers its top-level value, usually a Map<String, Object>.

Throws

XMLParseException
when no XML plist is found, the data is a binary plist, or the plist is malformed (an unknown element, a <dict> key with no value, an integer that does not parse).

parse

public static Object parse(String xml)
Parses an XML property list held in a string.

Throws

XMLParseException
when the plist is malformed.

extractXml

public static byte[] extractXml(byte[] data)

Finds the XML property list embedded in binary data and answers its bytes, from <?xml (or <plist when there is no declaration) through the end of the first </plist> after it; null when there is none.

This is how the plist is read out of a provisioning profile, which stores it unencrypted inside a signed CMS envelope. The bytes before and after the span are not examined.