diff options
author | Tianjie Xu <xunchang@google.com> | 2019-03-11 22:10:45 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-11 22:10:45 +0100 |
commit | 5f0c7e0356290a585a5a4b03d0a74beeeb5913f3 (patch) | |
tree | 786208bfa07ce110fcaffd9ad576c4815ca54380 /recovery.cpp | |
parent | [automerger skipped] Merge "DO NOT MERGE - Merge PPRL.190305.001 into master" am: 6c54127462 -s ours (diff) | |
parent | Merge "Create a wrapper class for update package" (diff) | |
download | android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.tar android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.tar.gz android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.tar.bz2 android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.tar.lz android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.tar.xz android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.tar.zst android_bootable_recovery-5f0c7e0356290a585a5a4b03d0a74beeeb5913f3.zip |
Diffstat (limited to '')
-rw-r--r-- | recovery.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/recovery.cpp b/recovery.cpp index 90c84878b..2c9f9de68 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -64,6 +64,7 @@ #include "otautil/error_code.h" #include "otautil/paths.h" #include "otautil/sysutil.h" +#include "package.h" #include "roots.h" #include "screen_ui.h" #include "ui.h" @@ -517,13 +518,15 @@ static std::string ReadWipePackage(size_t wipe_package_size) { // 1. verify the package. // 2. check metadata (ota-type, pre-device and serial number if having one). static bool CheckWipePackage(const std::string& wipe_package) { - if (!verify_package(reinterpret_cast<const unsigned char*>(wipe_package.data()), - wipe_package.size())) { + auto package = Package::CreateMemoryPackage( + std::vector<uint8_t>(wipe_package.begin(), wipe_package.end()), nullptr); + + if (!package || !verify_package(package.get())) { LOG(ERROR) << "Failed to verify package"; return false; } - // Extract metadata + // TODO(xunchang) get zip archive from package. ZipArchiveHandle zip; if (auto err = OpenArchiveFromMemory(const_cast<void*>(static_cast<const void*>(&wipe_package[0])), |