summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Pasanen <dan.pasanen@gmail.com>2017-12-21 03:32:25 +0100
committerDees Troy <dees_troy@teamw.in>2018-03-09 04:31:21 +0100
commite7b66e100f80474470f79a9b4670523c2d156a96 (patch)
tree70e09dc70ecc941a9129a78dbfd0e4ec99c50d72
parentFBE: Decrypt spblob v2 (February security patch) (diff)
downloadandroid_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.tar
android_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.tar.gz
android_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.tar.bz2
android_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.tar.lz
android_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.tar.xz
android_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.tar.zst
android_bootable_recovery-e7b66e100f80474470f79a9b4670523c2d156a96.zip
-rw-r--r--install.cpp22
-rw-r--r--installcommand.cpp24
2 files changed, 0 insertions, 46 deletions
diff --git a/install.cpp b/install.cpp
index 7fbf5c01f..4848755ab 100644
--- a/install.cpp
+++ b/install.cpp
@@ -178,28 +178,6 @@ static int check_newer_ab_build(ZipArchiveHandle zip) {
return INSTALL_ERROR;
}
- // Check for downgrade version.
- int64_t build_timestamp =
- android::base::GetIntProperty("ro.build.date.utc", std::numeric_limits<int64_t>::max());
- int64_t pkg_post_timestamp = 0;
- // We allow to full update to the same version we are running, in case there
- // is a problem with the current copy of that version.
- if (metadata["post-timestamp"].empty() ||
- !android::base::ParseInt(metadata["post-timestamp"].c_str(), &pkg_post_timestamp) ||
- pkg_post_timestamp < build_timestamp) {
- if (metadata["ota-downgrade"] != "yes") {
- LOG(ERROR) << "Update package is older than the current build, expected a build "
- "newer than timestamp "
- << build_timestamp << " but package has timestamp " << pkg_post_timestamp
- << " and downgrade not allowed.";
- return INSTALL_ERROR;
- }
- if (pkg_pre_build_fingerprint.empty()) {
- LOG(ERROR) << "Downgrade package must have a pre-build version set, not allowed.";
- return INSTALL_ERROR;
- }
- }
-
return 0;
}
diff --git a/installcommand.cpp b/installcommand.cpp
index f9978f27b..b306e872f 100644
--- a/installcommand.cpp
+++ b/installcommand.cpp
@@ -159,30 +159,6 @@ static int check_newer_ab_build(ZipWrap* zip)
return INSTALL_ERROR;
}
- // Check for downgrade version.
- int64_t build_timestampt = property_get_int64(
- "ro.build.date.utc", std::numeric_limits<int64_t>::max());
- int64_t pkg_post_timespampt = 0;
- // We allow to full update to the same version we are running, in case there
- // is a problem with the current copy of that version.
- if (metadata["post-timestamp"].empty() ||
- !android::base::ParseInt(metadata["post-timestamp"].c_str(),
- &pkg_post_timespampt) ||
- pkg_post_timespampt < build_timestampt) {
- if (metadata["ota-downgrade"] != "yes") {
- printf("Update package is older than the current build, expected a "
- "build newer than timestamp %" PRIu64 " but package has "
- "timestamp %" PRIu64 " and downgrade not allowed.\n",
- build_timestampt, pkg_post_timespampt);
- return INSTALL_ERROR;
- }
- if (pkg_pre_build_fingerprint.empty()) {
- printf("Downgrade package must have a pre-build version set, not "
- "allowed.\n");
- return INSTALL_ERROR;
- }
- }
-
return 0;
}