From f07ed2efeb18121fd3f1c489053e84fd9f46c4c1 Mon Sep 17 00:00:00 2001 From: xunchang Date: Mon, 25 Feb 2019 14:14:01 -0800 Subject: Create a wrapper class for update package Creates a new class handle the package in memory and package read from fd. Define the new interface functions, and make approximate changes to the verify and install functions. Bug: 127071893 Test: unit tests pass, sideload a package Change-Id: I66ab00654df92471184536fd147b237a86e9c5b5 --- install.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'install.h') diff --git a/install.h b/install.h index 20a2b23e3..7b6267bf1 100644 --- a/install.h +++ b/install.h @@ -25,6 +25,8 @@ #include +#include "package.h" + enum InstallResult { INSTALL_SUCCESS, INSTALL_ERROR, @@ -46,9 +48,9 @@ enum class OtaType { int install_package(const std::string& package, bool* wipe_cache, bool needs_mount, int retry_count); -// Verify the package by ota keys. Return true if the package is verified successfully, -// otherwise return false. -bool verify_package(const unsigned char* package_data, size_t package_size); +// Verifies the package by ota keys. Returns true if the package is verified successfully, +// otherwise returns false. +bool verify_package(Package* package); // Reads meta data file of the package; parses each line in the format "key=value"; and writes the // result to |metadata|. Return true if succeed, otherwise return false. -- cgit v1.2.3