TLDR Dev · ARTICLES & TUTORIALS
REVERSE ENGINEERING IWORK
Summary from the TLDR Dev newsletter
This dev created a Swift package called WorkKit to directly parse iWork files (.key, .numbers, and .pages) without requiring export to other formats or server-side processing. This involved reverse engineering the iWork binary format, which uses Google's Protocol Buffers, and extracting the schemas from the application executables. WorkKit maps type IDs to Swift classes, decompresses the Snappy-compressed data, and uses a two-pass system to load and merge document content, which is then exposed to provide decoded data.