platform_build/tools/releasetools
Håkan Kvist b77972402e Detect downgrade by checking build time for all partitions
Checking ro.build.date.utc to detect a downgrade is not enough in the
case where several target files are merged, as timestamps can differ
for each partition.

The solution is to check the build timestamp for each partition and
ro.build.date.utc.

With this change ota generation will be aborted during creation
instead of rejected when installing on device.

This also fixes the --override_timestamp so it is possible to generate
a package where timestamps are reversed, as was added in:
3e6161a3b3.

Issue: 315913966
Test: Manual, confirm that ota generation is aborted when timestamp
  on post vendor partitions is newer than on pre.
  Ota created successfully with --override_timestamp parameter and
  installation successful
Test: atest --host releasetools_test
Change-Id: I275e67a3840f4ef2263381c253231068e72f47d2
2023-12-20 08:45:26 +01:00
..
merge Expose --avb_resolve_rollback_index_location_conflict 2023-11-29 06:03:44 +00:00
testdata Revert "Add sign_sepolicy_path for a binary to sign sepolicy.apex." 2023-10-18 11:41:25 +11:00
add_img_to_target_files.py Resolve conflict AVB rollback index location 2023-10-04 06:45:15 +00:00
Android.bp Revert "releasetools: Deprecate GKI build rules" 2023-12-01 07:02:17 +00:00
apex_utils.py Revert "Add sign_sepolicy_path for a binary to sign sepolicy.apex." 2023-10-18 11:41:25 +11:00
blockimgdiff.py Fix 'expected str instance, bytes found' error when compute patches 2022-11-11 00:26:19 +08:00
build_image.py releasetools: Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE 2023-12-01 09:03:08 +00:00
build_super_image.py Simplify codes for BuildSuperImage func 2021-04-23 19:58:40 +08:00
care_map_pb2.py Handle caremap for partial OTAs 2021-06-04 16:17:32 -04:00
check_ota_package_signature.py Revert "Remove all ZIP64LIMIT hack" 2023-04-14 21:32:54 +00:00
check_partition_sizes.py Remove catch + sys.exit idiom 2022-02-17 21:46:21 -08:00
check_target_files_signatures.py Handle zip64 extra fields better 2023-06-17 09:21:46 -07:00
check_target_files_vintf.py Remove APEX from merged target-files package 2023-11-29 08:54:44 +08:00
common.py Merge "Sign OTA packages inside target_files during signing" into main 2023-12-05 21:46:55 +00:00
create_brick_ota.py Update create_brick_ota doc 2023-12-06 13:01:54 -08:00
edify_generator.py Revert "Move more non-AB code to separate files" 2023-11-08 22:29:18 +00:00
find_shareduid_violation.py Finds APK shared UID violations when merging target files. 2020-10-29 09:33:26 -07:00
fsverity_metadata_generator.py Write signature size even when it's empty 2022-01-07 10:56:17 +09:00
images.py Remove HashTreeInfo from verity_utils.py 2022-08-25 03:30:06 +00:00
img_from_target_files.py Add missing AB partitions to img.zip 2023-10-12 10:31:44 -07:00
jarjar-rules.txt Add ota_metadata_proto_java 2021-05-05 09:08:12 -04:00
make_recovery_patch.py Revert "Move more non-AB code to separate files" 2023-11-08 22:29:18 +00:00
merge_ota.py Add a tool to generate OTA from images 2023-08-23 12:37:29 -07:00
non_ab_ota.py Revert "Move more non-AB code to separate files" 2023-11-08 22:29:18 +00:00
ota_from_raw_img.py Generate incremental OTAs for 16K/4K boot option 2023-11-06 12:37:49 -08:00
ota_from_target_files.py Detect downgrade by checking build time for all partitions 2023-12-20 08:45:26 +01:00
ota_metadata.proto Amend the apex info for ota package 2021-06-07 20:33:46 -07:00
ota_metadata_pb2.py Update ota_metadata_pb2.py 2022-09-23 10:07:04 -07:00
ota_package_parser.py Allow zip64 support when opening zip files 2020-09-22 16:53:39 -04:00
ota_signing_utils.py Add a tool to generate OTA from images 2023-08-23 12:37:29 -07:00
ota_utils.py Detect downgrade by checking build time for all partitions 2023-12-20 08:45:26 +01:00
OWNERS Moves merge scripts into a new merge folder. 2022-03-08 16:37:14 -08:00
payload_signer.py Sign OTA packages inside target_files during signing 2023-11-28 10:08:38 -08:00
pylintrc
rangelib.py
sign_apex.py Revert "Add sign_sepolicy_path for a binary to sign sepolicy.apex." 2023-10-18 11:41:25 +11:00
sign_target_files_apks.py Merge "Sign OTA packages inside target_files during signing" into main 2023-12-05 21:46:55 +00:00
sparse_img.py Use AVB footer to determine caremap 2022-10-10 13:12:50 -07:00
target_files_diff.py Fix python3 incompatiable code 2021-11-09 23:37:11 -08:00
test_add_img_to_target_files.py Use AVB footer to determine caremap 2022-10-10 13:12:50 -07:00
test_apex_utils.py Fix some python2/3 migration issues 2021-12-21 12:31:55 -08:00
test_blockimgdiff.py
test_build_image.py releasetools: Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE 2023-12-01 09:03:08 +00:00
test_check_partition_sizes.py Check super size for factory OTA at build time 2021-05-13 17:41:52 -07:00
test_check_target_files_vintf.py Add test cases for APEX VINTF. 2023-03-09 17:00:06 +00:00
test_common.py releasetools: Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE 2023-12-01 09:03:08 +00:00
test_merge_ota.py Add a tool to merge two partial OTAs 2022-09-07 20:35:46 +00:00
test_non_ab_ota.py Revert "Move more non-AB code to separate files" 2023-11-08 22:29:18 +00:00
test_ota_from_target_files.py Detect downgrade by checking build time for all partitions 2023-12-20 08:45:26 +01:00
test_ota_utils.py Fix a bug in computing streaming property of payload.bin 2021-07-28 11:40:18 -04:00
test_rangelib.py
test_sign_apex.py Revert "Add sign_sepolicy_path for a binary to sign sepolicy.apex." 2023-10-18 11:41:25 +11:00
test_sign_target_files_apks.py Revert "releasetools: Deprecate GKI build rules" 2023-12-01 07:02:17 +00:00
test_utils.py Use AVB footer to determine caremap 2022-10-10 13:12:50 -07:00
test_validate_target_files.py releasetools: Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE 2023-12-01 09:03:08 +00:00
test_verity_utils.py Remove HashTreeInfo from verity_utils.py 2022-08-25 03:30:06 +00:00
validate_target_files.py releasetools: Remove deprecated BOARD_BUILD_SYSTEM_ROOT_IMAGE 2023-12-01 09:03:08 +00:00
verity_utils.py Always set a avb salt for hermetic build 2023-06-05 09:59:54 -07:00