Skip to content

Instantly share code, notes, and snippets.

@andrewodri
Last active March 3, 2021 09:15
Show Gist options
  • Save andrewodri/90667703f28aaa6f266224b9e6f7e095 to your computer and use it in GitHub Desktop.
Save andrewodri/90667703f28aaa6f266224b9e6f7e095 to your computer and use it in GitHub Desktop.
Decode a base64 encoded binary data property from a plist file as XML
#!/bin/bash
if [[ "${1}" = "--help" || -z "${1}" ]]
then
echo -e 'Example usage:\n ./decode-plist-data-property.sh [PATH_TO_PLIST]'
exit 0
fi
perl -0777 -pe 's/\s//gm and s/.+<data>(.+)<\/data>.+/\1/g' "${1}" | base64 -D | plutil -convert xml1 - -o -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment