Last active
March 3, 2021 09:15
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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