Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# The .iwa and .key fixtures under tests/data/ are binary, but `identify` sees
# no NUL bytes near the start of some of them and classifies them as text. The
# whitespace hooks then "fix" them: trailing-whitespace strips any 0x09 that
# happens to precede a 0x0a, which inside a Snappy stream or an embedded JPEG is
# just data. That silently corrupts the archive, and the only symptom is
# zipfile.BadZipFile in an unrelated test run later.
#
# Excluding the whole directory rather than a *.key glob is deliberate: the .iwa
# files have the same problem, and the .yaml fixtures are byte-compared by
# tests/test_codec.py, so reflowing them would be just as damaging.
exclude: ^tests/data/

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-toml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements

# Kept in lockstep with the ruff pinned in .github/workflows/python-package.yml.
# If these drift, the hook and CI disagree about what passes, which is how the
# lint gate silently stopped meaning anything the last time round.
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.16.2
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
10 changes: 5 additions & 5 deletions docs/obriensp_docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ The uncompresed IWA contains the Component's objects, serialized consecutively i
Object 0 varint archiveInfoLength
ArchiveInfo archiveInfo
(payload)

Object 1 varint archiveInfoLength
ArchiveInfo archiveInfo
(payload)

...

Object n varint archiveInfoLength
ArchiveInfo archiveInfo
(payload)
Expand Down Expand Up @@ -100,7 +100,7 @@ A full dump of the Protobuf messages can be found [here](../iWorkFileInspector/i
### <a name="tspregistry" />TSPRegistry
The mapping between an object's `MessageInfo.type` and its respective Protobuf message type must by extracted from the iWork applications at runtime. Attaching to Keynote via a debugger and inspecting `[TSPRegistry sharedRegistry]` shows:

<TSPRegistry 0x102daf560
<TSPRegistry 0x102daf560
_messageTypeToPrototypeMap = {
148 -> 0x102f24680 KN.ChartInfoGeometryCommandArchive
147 -> 0x102f24650 KN.SlideCollectionCommandSelectionBehaviorArchive
Expand All @@ -111,4 +111,4 @@ The mapping between an object's `MessageInfo.type` and its respective Protobuf m
A full list of the type mappings can be found [here](../iWorkFileInspector/iWorkFileInspector/Persistence/MessageTypes/).

## <a name="encryption"/>Encryption
If the document is locked with a password, nearly all files in the bundle are encrypted using [AES128](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) encryption with [PKCS7](http://en.wikipedia.org/wiki/Padding_\(cryptography\)#PKCS7) padding. For a full description of the encryption format, see [iWork Encrypted Stream](iWork Encrypted Stream.md).
If the document is locked with a password, nearly all files in the bundle are encrypted using [AES128](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) encryption with [PKCS7](http://en.wikipedia.org/wiki/Padding_\(cryptography\)#PKCS7) padding. For a full description of the encryption format, see [iWork Encrypted Stream](iWork Encrypted Stream.md).
2 changes: 1 addition & 1 deletion protos/versions/14.4/KNArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -832,4 +832,4 @@ message MotionBackgroundFillArchive {

extend .TSD.FillArchive {
optional .KN.MotionBackgroundFillArchive motionBackgroundFill = 200;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSCH3DArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -178,4 +178,4 @@ message Chart3DVectorArchive {

extend .TSD.FillArchive {
optional .TSCH.Chart3DFillArchive fill3d = 100;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSCHArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -347,4 +347,4 @@ extend .TSCH.ChartStylePreset {
}
extend .TSCH.PropertyValueStorageContainerArchive {
optional .TSCH.PropertyValueStorageContainerReferenceLinesArchive property_value_storage_container_reference_lines = 10000;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSDArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -704,4 +704,4 @@ message MovieFingerprintTrack {
extend .TSS.CommandPropertyEntryArchive {
optional .TSD.FillArchive fill = 200;
optional .TSD.StrokeArchive stroke = 201;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSPMessages.proto
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,4 @@ message FieldOptions {

extend .google.protobuf.FieldOptions {
optional .TSP.FieldOptions field_options = 51234;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSSArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,4 @@ message CommandPropertyMapArchive {

extend .TSS.CommandPropertyEntryArchive {
optional .TSP.Color color = 8;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSTArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1466,4 +1466,4 @@ extend .TSS.CommandPropertyEntryArchive {
optional .TST.CellBorderArchive cell_border = 503;
optional .TST.CommentStorageWrapperArchive comment_storage = 504;
optional .TST.CellSpecArchive cell_spec = 505;
}
}
2 changes: 1 addition & 1 deletion protos/versions/14.4/TSWPArchives.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1008,4 +1008,4 @@ message CollaboratorTextCursorSubselectionArchive {

extend .TSS.CommandPropertyEntryArchive {
optional .TSWP.PaddingArchive padding = 100;
}
}
Loading