aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Android.mk4
-rw-r--r--install.cpp15
-rw-r--r--tests/Android.mk3
3 files changed, 17 insertions, 5 deletions
diff --git a/Android.mk b/Android.mk
index 9e374de8..adf478f0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -55,6 +55,7 @@ endif
55LOCAL_MODULE := librecovery 55LOCAL_MODULE := librecovery
56LOCAL_STATIC_LIBRARIES := \ 56LOCAL_STATIC_LIBRARIES := \
57 libminui \ 57 libminui \
58 libvintf_recovery \
58 libcrypto_utils \ 59 libcrypto_utils \
59 libcrypto \ 60 libcrypto \
60 libbase 61 libbase
@@ -114,6 +115,9 @@ LOCAL_STATIC_LIBRARIES := \
114 libfs_mgr \ 115 libfs_mgr \
115 libcrypto_utils \ 116 libcrypto_utils \
116 libcrypto \ 117 libcrypto \
118 libvintf_recovery \
119 libvintf \
120 libtinyxml2 \
117 libbase \ 121 libbase \
118 libcutils \ 122 libcutils \
119 libutils \ 123 libutils \
diff --git a/install.cpp b/install.cpp
index 95794ce0..2a647b1a 100644
--- a/install.cpp
+++ b/install.cpp
@@ -44,6 +44,7 @@
44#include <android-base/properties.h> 44#include <android-base/properties.h>
45#include <android-base/stringprintf.h> 45#include <android-base/stringprintf.h>
46#include <android-base/strings.h> 46#include <android-base/strings.h>
47#include <vintf/VintfObjectRecovery.h>
47#include <ziparchive/zip_archive.h> 48#include <ziparchive/zip_archive.h>
48 49
49#include "common.h" 50#include "common.h"
@@ -539,10 +540,15 @@ bool verify_package_compatibility(ZipArchiveHandle package_zip) {
539 } 540 }
540 CloseArchive(zip_handle); 541 CloseArchive(zip_handle);
541 542
542 // TODO(b/36814503): Enable the actual verification when VintfObject::CheckCompatibility() lands. 543 // VintfObjectRecovery::CheckCompatibility returns zero on success.
543 // VintfObject::CheckCompatibility returns zero on success. 544 std::string err;
544 // return (android::vintf::VintfObject::CheckCompatibility(compatibility_info, true) == 0); 545 int result = android::vintf::VintfObjectRecovery::CheckCompatibility(compatibility_info, &err);
545 return true; 546 if (result == 0) {
547 return true;
548 }
549
550 LOG(ERROR) << "Failed to verify package compatibility (result " << result << "): " << err;
551 return false;
546} 552}
547 553
548static int 554static int
@@ -594,7 +600,6 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount,
594 600
595 // Additionally verify the compatibility of the package. 601 // Additionally verify the compatibility of the package.
596 if (!verify_package_compatibility(zip)) { 602 if (!verify_package_compatibility(zip)) {
597 LOG(ERROR) << "Failed to verify package compatibility";
598 log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure)); 603 log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure));
599 sysReleaseMap(&map); 604 sysReleaseMap(&map);
600 CloseArchive(zip); 605 CloseArchive(zip);
diff --git a/tests/Android.mk b/tests/Android.mk
index 20cbcc14..e5266303 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -132,6 +132,9 @@ LOCAL_STATIC_LIBRARIES := \
132 libdivsufsort64 \ 132 libdivsufsort64 \
133 libfs_mgr \ 133 libfs_mgr \
134 liblog \ 134 liblog \
135 libvintf_recovery \
136 libvintf \
137 libtinyxml2 \
135 libselinux \ 138 libselinux \
136 libext4_utils \ 139 libext4_utils \
137 libsparse \ 140 libsparse \