Skip to content

Commit 62dd540

Browse files
authored
Merge pull request #40 from psobot/psobot/keynote-12-1
Add support for Keynote 12.1.
2 parents b622990 + 8c6b8d0 commit 62dd540

15 files changed

+415
-25
lines changed

.github/workflows/python-package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ jobs:
2525
python-version: ${{ matrix.python-version }}
2626
- name: Install dependencies
2727
run: |
28-
# protobuf 3.6.1 or later is necessary
29-
wget https://github.com/google/protobuf/releases/download/v3.6.1/protoc-3.6.1-linux-x86_64.zip
30-
unzip protoc-3.6.1-linux-x86_64.zip -d protoc3
28+
# protobuf 3.19.1 or later is necessary
29+
wget https://github.com/google/protobuf/releases/download/v3.19.1/protoc-3.19.1-linux-x86_64.zip
30+
unzip protoc-3.19.1-linux-x86_64.zip -d protoc3
3131
echo "::set-env name=PATH::$PATH:$PWD/protoc3/bin/"
3232
sudo apt-get install -qq libsnappy-dev
3333
python -m pip install --upgrade pip

dumper/extract_mapping.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,24 @@
2222
# To get around the fact that we don't have iCloud entitlements when running re-signed code,
2323
# let's break in the CloudKit code and early exit the function before it can raise an exception:
2424
target.BreakpointCreateByName("[CKContainer containerWithIdentifier:]")
25+
# In later Keynote versions, 'containerWithIdentifier' isn't called directly, but we can break on similar methods:
26+
# Note: this __lldb_unnamed_symbol index was determined by painstaking experimentation. It will break again for sure.
27+
target.BreakpointCreateByName("___lldb_unnamed_symbol2482", "CloudKit")
2528

2629
process = target.LaunchSimple(None, None, os.getcwd())
2730

2831
if not process:
2932
raise ValueError("Failed to launch process: " + exe)
3033
try:
31-
if process.GetState() == lldb.eStateStopped:
34+
while process.GetState() == lldb.eStateStopped:
3235
thread = process.GetThreadAtIndex(0)
3336
if thread.GetStopReason() == lldb.eStopReasonBreakpoint:
34-
if thread.GetSelectedFrame().name == '+[CKContainer containerWithIdentifier:]':
37+
if any([x in str(thread.GetSelectedFrame()) for x in ["CKContainer", "CloudKit"]]):
3538
# Skip the code in CKContainer, avoiding a crash due to missing entitlements:
3639
thread.ReturnFromFrame(thread.GetSelectedFrame(), lldb.SBValue().CreateValueFromExpression("0", ""))
3740
process.Continue()
41+
else:
42+
break
3843
if process.GetState() == lldb.eStateStopped:
3944
if thread:
4045
frame = thread.GetFrameAtIndex(0)

keynote_parser/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 Peter Sobot
1+
# Copyright 2020-2022 Peter Sobot
22
"""Unpack and repack Apple Keyote files."""
33
__author__ = "Peter Sobot"
44

@@ -7,7 +7,7 @@
77
__major_version__ = 1
88
__patch_version__ = 0
99
__supported_keynote_version__ = keynote_parser.macos_app_version.MacOSAppVersion(
10-
"12.0", "7033.0.134", "1A143"
10+
"12.1", "7034.0.86", "1A95"
1111
)
1212
__version_tuple__ = (
1313
__major_version__,

keynote_parser/bundle_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
import warnings
44
import plistlib
5-
import urllib
5+
import urllib.parse
66
from colorama import init as colorama_init
77
from colorama import Fore
88
from keynote_parser import (

keynote_parser/mapping.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
"23": "KN.DesktopUILayoutArchive",
9595
"24": "KN.CanvasSelectionArchive",
9696
"25": "KN.SlideCollectionSelectionArchive",
97+
"26": "KN.MotionBackgroundStyleArchive",
9798
"100": "KN.CommandBuildSetValueArchive",
9899
"101": "KN.CommandShowInsertSlideArchive",
99100
"102": "KN.CommandShowMoveSlideArchive",
@@ -166,6 +167,8 @@
166167
"190": "KN.CommandLiveVideoStyleSetValue",
167168
"191": "KN.CommandThemeAddLiveVideoSource",
168169
"192": "KN.CommandThemeRemoveLiveVideoSource",
170+
"194": "KN.CommandMotionBackgroundStyleSetValueArchive",
171+
"195": "KN.CommandMotionBackgroundStyleUpdatePosterFrameDataArchive",
169172
"200": "TSK.DocumentArchive",
170173
"201": "TSK.LocalCommandHistory",
171174
"202": "TSK.CommandGroupArchive",
@@ -306,7 +309,6 @@
306309
"2119": "TSWP.UpdateDateTimeFieldCommandArchive",
307310
"2120": "TSWP.ModifyTOCSettingsBaseCommandArchive",
308311
"2121": "TSWP.ModifyTOCSettingsForTOCInfoCommandArchive",
309-
"2122": "TSWP.ModifyTOCSettingsPresetForThemeCommandArchive",
310312
"2123": "TSWP.SetObjectPropertiesCommandArchive",
311313
"2124": "TSWP.UpdateFlowInfoCommandArchive",
312314
"2125": "TSWP.AddFlowInfoCommandArchive",

protos/KNArchives.proto

Lines changed: 127 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ message SlideNodeArchive {
299299
optional uint32 has_explicit_builds_cache_version = 27;
300300
optional bool has_explicit_builds_is_up_to_date = 23 [deprecated = true];
301301
repeated .KN.SlideNodeArchive.SlideSpecificHyperlinkMapEntry slideSpecificHyperlinkMap = 24;
302-
optional bool has_background_alpha = 28;
302+
optional bool background_is_no_fill_or_color_fill_with_alpha = 28;
303303
optional .TSP.UUID template_slide_id = 29;
304304
repeated .TSP.UUID live_video_source_ids = 30;
305305
optional .TSP.Reference database_thumbnail = 3 [deprecated = true];
@@ -422,6 +422,7 @@ message ThemeArchive {
422422
optional bool default_template_slide_node_is_our_best_guess = 7;
423423
repeated .KN.ThemeCustomTimingCurveArchive custom_effect_timing_curves = 8;
424424
optional .TSP.Reference live_video_source_collection = 9;
425+
repeated .TSP.Reference motion_background_style_presets = 10;
425426
}
426427

427428
message SlideTreeArchive {
@@ -691,3 +692,128 @@ message LiveVideoSourceCollection {
691692
optional .TSP.Reference default_source = 2;
692693
}
693694

695+
message MotionBackgroundStylePropertiesArchive {
696+
optional string background_name = 1;
697+
optional string variant = 2;
698+
optional .TSD.FillArchive color_gradient = 3;
699+
optional int32 random_number_seed = 10;
700+
optional double color_blur_sigma = 11;
701+
optional double noise_amplitude = 12;
702+
optional double noise_octaves = 13;
703+
optional double noise_scale = 14;
704+
optional double noise_speed = 15;
705+
optional double color_palette_offset = 16;
706+
optional double zoom = 17;
707+
optional bool invert = 18;
708+
optional string blend_mode = 19;
709+
optional string source_blend_factor = 20;
710+
optional string dest_blend_factor = 21;
711+
optional string motion = 22;
712+
optional .TSP.Color background_color = 23;
713+
optional .TSP.Color foreground_color = 24;
714+
optional .TSP.Color line_color = 25;
715+
optional .TSP.Color point_color = 26;
716+
optional double alpha = 27;
717+
optional double border = 28;
718+
optional double blend = 29;
719+
optional double brightness = 30;
720+
optional double border_lightness = 31;
721+
optional double contrast = 32;
722+
optional double damping = 33;
723+
optional double density = 34;
724+
optional double diffuse_power = 35;
725+
optional double distortion = 36;
726+
optional double entropy = 37;
727+
optional double exposure = 38;
728+
optional double filter = 39;
729+
optional double fog_distance = 40;
730+
optional double fog_power = 41;
731+
optional double gamma = 42;
732+
optional double grain_amount = 43;
733+
optional double grain_intensity = 44;
734+
optional double hue = 45;
735+
optional double lightness = 46;
736+
optional double line_alpha = 47;
737+
optional double line_center = 48;
738+
optional double line_fade = 49;
739+
optional double line_fade_power = 50;
740+
optional double line_length = 51;
741+
optional double line_width = 52;
742+
optional double noise_size_scale = 53;
743+
optional double noise_size_weight = 54;
744+
optional double noise_variance = 55;
745+
optional double offset = 56;
746+
optional double motion_background_opacity = 57;
747+
optional double point_depth_alpha = 58;
748+
optional double point_size = 59;
749+
optional double radius = 60;
750+
optional double refraction = 61;
751+
optional double resolution = 62;
752+
optional double saturation = 63;
753+
optional double scale = 64;
754+
optional double shadow_alpha = 65;
755+
optional double shadow_angle = 66;
756+
optional double shadow_offset = 67;
757+
optional double shadow_scale = 68;
758+
optional double shadow_value = 69;
759+
optional double speed = 70;
760+
optional double texture_power = 71;
761+
optional double time = 72;
762+
optional bool draw_points = 73;
763+
optional bool draw_lines = 74;
764+
optional bool draw_shadows = 75;
765+
optional uint32 pixels_per_division = 76;
766+
optional bool symmetry = 77;
767+
optional bool lock_focus = 78;
768+
optional double amplitude = 79;
769+
optional double envelope = 80;
770+
optional double y_offset = 81;
771+
optional double focus = 82;
772+
optional double blur = 83;
773+
optional double grain_speed = 84;
774+
optional .TSP.Color mesh_color = 85;
775+
optional double angle = 86;
776+
optional double mesh_line_width = 87;
777+
optional double delta_time = 88;
778+
optional double time_start = 89;
779+
optional double color_contrast = 90;
780+
optional double color_gamma = 91;
781+
optional double color_saturation = 92;
782+
optional double color_brightness = 93;
783+
optional double color_hue = 94;
784+
optional double color_vibrance = 95;
785+
optional double noise_movement = 96;
786+
optional double power = 97;
787+
optional double threshold = 98;
788+
optional double noise_scale_horizontal = 99;
789+
optional double noise_scale_vertical = 100;
790+
optional double noise_gain = 101;
791+
optional double noise_lacunarity = 102;
792+
optional int32 instance_count = 103;
793+
optional double extrusion = 104;
794+
optional double noise_offset = 105;
795+
optional double color_hue_offset = 106;
796+
optional double shadow_hue = 107;
797+
optional double shadow_hue_offset = 108;
798+
optional double shadow_saturation = 109;
799+
optional double shadow_brightness = 110;
800+
optional double shadow_intensity = 111;
801+
optional double shadow_power = 112;
802+
optional int32 noise_octaves_iterations = 113;
803+
}
804+
805+
message MotionBackgroundStyleArchive {
806+
required .TSS.StyleArchive super = 1;
807+
optional uint32 override_count = 10 [default = 0];
808+
optional .KN.MotionBackgroundStylePropertiesArchive slide_properties = 11;
809+
optional .TSP.DataReference poster_frame_data = 12;
810+
}
811+
812+
message MotionBackgroundFillArchive {
813+
required .TSP.Reference motion_background_style = 1;
814+
}
815+
816+
extend .TSD.FillArchive {
817+
optional .KN.MotionBackgroundFillArchive motionBackgroundFill = 200;
818+
}
819+

0 commit comments

Comments
 (0)