Call libvintf to verify package compatibility.
am: da320ac6ab
Change-Id: I5749ac56a8eed8c3ce8420360643a4cfe8d52bc7
This commit is contained in:
@@ -55,6 +55,7 @@ endif
|
|||||||
LOCAL_MODULE := librecovery
|
LOCAL_MODULE := librecovery
|
||||||
LOCAL_STATIC_LIBRARIES := \
|
LOCAL_STATIC_LIBRARIES := \
|
||||||
libminui \
|
libminui \
|
||||||
|
libvintf_recovery \
|
||||||
libcrypto_utils \
|
libcrypto_utils \
|
||||||
libcrypto \
|
libcrypto \
|
||||||
libbase
|
libbase
|
||||||
@@ -114,6 +115,9 @@ LOCAL_STATIC_LIBRARIES := \
|
|||||||
libfs_mgr \
|
libfs_mgr \
|
||||||
libcrypto_utils \
|
libcrypto_utils \
|
||||||
libcrypto \
|
libcrypto \
|
||||||
|
libvintf_recovery \
|
||||||
|
libvintf \
|
||||||
|
libtinyxml2 \
|
||||||
libbase \
|
libbase \
|
||||||
libcutils \
|
libcutils \
|
||||||
libutils \
|
libutils \
|
||||||
|
|||||||
15
install.cpp
15
install.cpp
@@ -44,6 +44,7 @@
|
|||||||
#include <android-base/properties.h>
|
#include <android-base/properties.h>
|
||||||
#include <android-base/stringprintf.h>
|
#include <android-base/stringprintf.h>
|
||||||
#include <android-base/strings.h>
|
#include <android-base/strings.h>
|
||||||
|
#include <vintf/VintfObjectRecovery.h>
|
||||||
#include <ziparchive/zip_archive.h>
|
#include <ziparchive/zip_archive.h>
|
||||||
|
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
@@ -535,10 +536,15 @@ bool verify_package_compatibility(ZipArchiveHandle package_zip) {
|
|||||||
}
|
}
|
||||||
CloseArchive(zip_handle);
|
CloseArchive(zip_handle);
|
||||||
|
|
||||||
// TODO(b/36814503): Enable the actual verification when VintfObject::CheckCompatibility() lands.
|
// VintfObjectRecovery::CheckCompatibility returns zero on success.
|
||||||
// VintfObject::CheckCompatibility returns zero on success.
|
std::string err;
|
||||||
// return (android::vintf::VintfObject::CheckCompatibility(compatibility_info, true) == 0);
|
int result = android::vintf::VintfObjectRecovery::CheckCompatibility(compatibility_info, &err);
|
||||||
return true;
|
if (result == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG(ERROR) << "Failed to verify package compatibility (result " << result << "): " << err;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -590,7 +596,6 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount,
|
|||||||
|
|
||||||
// Additionally verify the compatibility of the package.
|
// Additionally verify the compatibility of the package.
|
||||||
if (!verify_package_compatibility(zip)) {
|
if (!verify_package_compatibility(zip)) {
|
||||||
LOG(ERROR) << "Failed to verify package compatibility";
|
|
||||||
log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure));
|
log_buffer.push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure));
|
||||||
sysReleaseMap(&map);
|
sysReleaseMap(&map);
|
||||||
CloseArchive(zip);
|
CloseArchive(zip);
|
||||||
|
|||||||
@@ -132,6 +132,9 @@ LOCAL_STATIC_LIBRARIES := \
|
|||||||
libdivsufsort64 \
|
libdivsufsort64 \
|
||||||
libfs_mgr \
|
libfs_mgr \
|
||||||
liblog \
|
liblog \
|
||||||
|
libvintf_recovery \
|
||||||
|
libvintf \
|
||||||
|
libtinyxml2 \
|
||||||
libselinux \
|
libselinux \
|
||||||
libext4_utils \
|
libext4_utils \
|
||||||
libsparse \
|
libsparse \
|
||||||
|
|||||||
Reference in New Issue
Block a user