Merge "DO NOT MERGE: Update Platform Security String to 2018-07-05 for oc-mr1-dev Bug:79883349" into oc-mr1-dev
diff --git a/tools/releasetools/validate_target_files.py b/tools/releasetools/validate_target_files.py
index 4b34820..b065a21 100755
--- a/tools/releasetools/validate_target_files.py
+++ b/tools/releasetools/validate_target_files.py
@@ -87,6 +87,13 @@
# Read the blocks that the file resides. Note that it will contain the
# bytes past the file length, which is expected to be padded with '\0's.
ranges = image.file_map[entry]
+
+ # TODO(b/79951650): Handle files with non-monotonic ranges.
+ if not ranges.monotonic:
+ logging.warning(
+ 'Skipping %s that has non-monotonic ranges: %s', entry, ranges)
+ continue
+
blocks_sha1 = image.RangeSha1(ranges)
# The filename under unpacked directory, such as SYSTEM/bin/sh.