diff --git a/avbroot/main.py b/avbroot/main.py index 8e5b28b..ba221bb 100644 --- a/avbroot/main.py +++ b/avbroot/main.py @@ -4,6 +4,7 @@ import copy import io import os import shutil +import struct import tempfile import time import zipfile @@ -150,6 +151,25 @@ def patch_ota_payload(f_in, open_more_f_in, f_out, file_size, boot_partition, ) +def strip_alignment_extra_field(extra): + offset = 0 + new_extra = bytearray() + + while offset < len(extra): + record_sig, record_len = \ + struct.unpack('