From e7b66e100f80474470f79a9b4670523c2d156a96 Mon Sep 17 00:00:00 2001 From: Dan Pasanen Date: Wed, 20 Dec 2017 20:32:25 -0600 Subject: install: ignore build dates for A/B installs * Assume a user knows what they are flashing and skip the check of whether or not the build they are flashing is older than the TWRP image they are using (which really isn't at all relevant to the ROM's build date anyway). Change-Id: I74ca5a6dc604268bf38f85ec1861f3eaafd9bf06 --- installcommand.cpp | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'installcommand.cpp') 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::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; } -- cgit v1.2.3