Skip to content

Fix proto2 extension field handling and improve dumper compatibility with recent Keynote versions (e.g. Keynote 15)#68

Open
flokru wants to merge 2 commits intopsobot:masterfrom
point8:fix/proto-extension-fields
Open

Fix proto2 extension field handling and improve dumper compatibility with recent Keynote versions (e.g. Keynote 15)#68
flokru wants to merge 2 commits intopsobot:masterfrom
point8:fix/proto-extension-fields

Conversation

@flokru
Copy link
Copy Markdown

@flokru flokru commented Mar 5, 2026

While updating to Keynote 15.1.1 (the latest Keynote as of now), I ran into two bugs that prevented both unpacking .key files and running dumper/run.py. This PR fixes both, along with a README update to bring the Updates section in line with the current tooling.

Changes

keynote_parser/codec.py — Fix KeyError on proto2 extension fields

ProtobufPatch.apply() assumed all field numbers in diff_field_path are present in fields_by_number. However, fields defined via proto2 extend blocks are not regular message fields and are absent from fields_by_number. This caused a KeyError when unpacking files containing such fields, which appear in Keynote 15.

The fix looks up extension fields via descriptor_pool.Default().FindExtensionByNumber() when the field number is not found in fields_by_number.

dumper/run.py — Two compatibility fixes

  1. Executable name derived from Info.plist instead of the bundle folder
    name. Recent Keynote is distributed as Keynote 2025.app but its binary is
    named Keynote, causing the codesign and re-sign steps to fail with
    "No such file or directory".

  2. Ad-hoc signing fallback when no local codesigning identity is available.
    The script previously raised an error requiring users to create a certificate
    in Keychain Access. codesign -s - (ad-hoc signing) is sufficient for LLDB
    to attach to the process and requires no certificate setup.

README.md — Updated Updates section

The make-based instructions were outdated. Replaced with the current dumper/run.py-based workflow including prerequisites, the correct Python interpreter requirement for LLDB compatibility, and other notes for first-time users.

Testing

Tested on macOS with Keynote 15.1.1 ("Keynote 2025"). Both unpack and pack work correctly on .key files generated by this version.

Transparency

This fix was developed with the help of Claude Code.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant