Skip to content

Commit

Permalink
Merge pull request #61 from ABBAPOH/buttons
Browse files Browse the repository at this point in the history
licensing: do not hardcode button length
  • Loading branch information
freakboy3742 committed Sep 11, 2023
2 parents cdf7ba0 + 45621d4 commit b7de655
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/dmgbuild/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,23 +249,12 @@ def build_license(license_info):
assert len(buttons) == 6, "License buttons must have 6 entries."

buttons = [maybe_encode(b) for b in buttons]
buttons = [len(b).to_bytes(1, "big") + b for b in buttons]
xml["STR#"].append(
{
"Attributes": "0x0000",
"Data": (
b"\x00\x06\x07"
+ buttons[0]
+ b"\x05"
+ buttons[1]
+ b"\x08"
+ buttons[2]
+ b"\x05"
+ buttons[3]
+ b"\x07"
+ buttons[4]
+ b"{"
+ buttons[5]
),
# \x06 is apparently the number of buttons which is always 6
"Data": b"\x00\x06" + b"".join(buttons),
"ID": "5002",
"Name": language_name,
}
Expand Down

0 comments on commit b7de655

Please sign in to comment.