Skip to content

Instantly share code, notes, and snippets.

@0xdevalias
Last active September 9, 2024 12:22
Show Gist options
  • Save 0xdevalias/27d9aea9529be7b6ce59055332a94477 to your computer and use it in GitHub Desktop.
Save 0xdevalias/27d9aea9529be7b6ce59055332a94477 to your computer and use it in GitHub Desktop.
A few notes on decompiling Apple Shortcuts workflows into their raw XML 'source code'.

Decompile Apple Shortcuts into raw XML 'source code'

A few notes on decompiling Apple Shortcuts workflows into their raw XML 'source code'.

You may also find some benefit in something like this:

Originally posted by @0xdevalias in joshfarrant/shortcuts-js#683 (comment)

Crossposted: https://www.reddit.com/r/shortcuts/comments/13h61hv/comment/jl4be0p/

Looking a little closer at that shortcut, the main bit of functionality seems to basically be modifying the iCloud Share URL slightly:

Given a URL like this:

https://www.icloud.com/shortcuts/ABC12

It becomes:

https://www.icloud.com/shortcuts/api/records/ABC123

Then extracts the following from the JSON on that page:

  • the URL for the unsigned shortcut file (which is an 'Apple binary property list' file): fields -> shortcut -> value -> downloadURL
  • the name of the shortcut workflow: fields -> name -> value

We can then convert that binary plist file to XML or JSON using plutil (though when I tried the JSON format I got an error (invalid object in plist for destination format), so might have to stick to XML):

plutil -convert xml1 -e plist.xml -- the-downloaded-shortcut.plist

or

plutil -convert json -e plist.json -- the-downloaded-shortcut.plist

Originally posted by @0xdevalias in joshfarrant/shortcuts-js#683 (comment)

Crossposted: https://www.reddit.com/r/shortcuts/comments/13h61hv/comment/jl4dw28/

See Also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment