diff options
author | Tianjie Xu <xunchang@google.com> | 2019-03-29 22:54:00 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-03-29 22:54:00 +0100 |
commit | 719c7edd2a36eb8782865df4c4af0d8bd6bcc76b (patch) | |
tree | 7bad452d0d5b0ae6eca9adf18c7bf8b8966a318f /install/include | |
parent | Merge "Use flags = 0 to avoid fd closing for child updater process" am: 50bda24f1e (diff) | |
parent | Merge "Move install to separate module" (diff) | |
download | android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.tar android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.tar.gz android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.tar.bz2 android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.tar.lz android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.tar.xz android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.tar.zst android_bootable_recovery-719c7edd2a36eb8782865df4c4af0d8bd6bcc76b.zip |
Diffstat (limited to '')
-rw-r--r-- | install/include/install/adb_install.h (renamed from adb_install.h) | 7 | ||||
-rw-r--r-- | install/include/install/fuse_sdcard_install.h (renamed from fuse_sdcard_install.h) | 0 | ||||
-rw-r--r-- | install/include/install/install.h (renamed from install.h) | 12 | ||||
-rw-r--r-- | install/include/install/package.h (renamed from package.h) | 0 | ||||
-rw-r--r-- | install/include/install/verifier.h (renamed from verifier.h) | 42 | ||||
-rw-r--r-- | install/include/private/asn1_decoder.h (renamed from asn1_decoder.h) | 1 | ||||
-rw-r--r-- | install/include/private/setup_commands.h (renamed from private/install.h) | 0 |
7 files changed, 26 insertions, 36 deletions
diff --git a/adb_install.h b/install/include/install/adb_install.h index cc3ca267b..dbc824501 100644 --- a/adb_install.h +++ b/install/include/install/adb_install.h @@ -14,9 +14,8 @@ * limitations under the License. */ -#ifndef _ADB_INSTALL_H -#define _ADB_INSTALL_H +#pragma once -int apply_from_adb(bool* wipe_cache); +#include <recovery_ui/ui.h> -#endif +int apply_from_adb(bool* wipe_cache, RecoveryUI* ui); diff --git a/fuse_sdcard_install.h b/install/include/install/fuse_sdcard_install.h index 345aea45b..345aea45b 100644 --- a/fuse_sdcard_install.h +++ b/install/include/install/fuse_sdcard_install.h diff --git a/install.h b/install/include/install/install.h index da8aa5e39..74fb3d170 100644 --- a/install.h +++ b/install/include/install/install.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef RECOVERY_INSTALL_H_ -#define RECOVERY_INSTALL_H_ +#pragma once #include <stddef.h> @@ -26,6 +25,7 @@ #include <ziparchive/zip_archive.h> #include "package.h" +#include "recovery_ui/ui.h" enum InstallResult { INSTALL_SUCCESS, @@ -45,12 +45,12 @@ enum class OtaType { // Installs the given update package. If INSTALL_SUCCESS is returned and *wipe_cache is true on // exit, caller should wipe the cache partition. -int install_package(const std::string& package, bool* wipe_cache, bool needs_mount, - int retry_count); +int install_package(const std::string& package, bool* wipe_cache, bool needs_mount, int retry_count, + RecoveryUI* ui); // Verifies the package by ota keys. Returns true if the package is verified successfully, // otherwise returns false. -bool verify_package(Package* package); +bool verify_package(Package* package, RecoveryUI* ui); // 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. @@ -67,5 +67,3 @@ bool verify_package_compatibility(ZipArchiveHandle package_zip); // Mandatory checks: ota-type, pre-device and serial number(if presents) // AB OTA specific checks: pre-build version, fingerprint, timestamp. int CheckPackageMetadata(const std::map<std::string, std::string>& metadata, OtaType ota_type); - -#endif // RECOVERY_INSTALL_H_ diff --git a/package.h b/install/include/install/package.h index cd44d10be..cd44d10be 100644 --- a/package.h +++ b/install/include/install/package.h diff --git a/verifier.h b/install/include/install/verifier.h index ef9feaff0..f9e947580 100644 --- a/verifier.h +++ b/install/include/install/verifier.h @@ -14,8 +14,7 @@ * limitations under the License. */ -#ifndef _RECOVERY_VERIFIER_H -#define _RECOVERY_VERIFIER_H +#pragma once #include <stdint.h> @@ -44,25 +43,20 @@ struct ECKEYDeleter { }; struct Certificate { - typedef enum { - KEY_TYPE_RSA, - KEY_TYPE_EC, - } KeyType; - - Certificate(int hash_len_, - KeyType key_type_, - std::unique_ptr<RSA, RSADeleter>&& rsa_, - std::unique_ptr<EC_KEY, ECKEYDeleter>&& ec_) - : hash_len(hash_len_), - key_type(key_type_), - rsa(std::move(rsa_)), - ec(std::move(ec_)) {} - - // SHA_DIGEST_LENGTH (SHA-1) or SHA256_DIGEST_LENGTH (SHA-256) - int hash_len; - KeyType key_type; - std::unique_ptr<RSA, RSADeleter> rsa; - std::unique_ptr<EC_KEY, ECKEYDeleter> ec; + typedef enum { + KEY_TYPE_RSA, + KEY_TYPE_EC, + } KeyType; + + Certificate(int hash_len_, KeyType key_type_, std::unique_ptr<RSA, RSADeleter>&& rsa_, + std::unique_ptr<EC_KEY, ECKEYDeleter>&& ec_) + : hash_len(hash_len_), key_type(key_type_), rsa(std::move(rsa_)), ec(std::move(ec_)) {} + + // SHA_DIGEST_LENGTH (SHA-1) or SHA256_DIGEST_LENGTH (SHA-256) + int hash_len; + KeyType key_type; + std::unique_ptr<RSA, RSADeleter> rsa; + std::unique_ptr<EC_KEY, ECKEYDeleter> ec; }; class VerifierInterface { @@ -103,7 +97,5 @@ bool LoadCertificateFromBuffer(const std::vector<uint8_t>& pem_content, Certific // certificates. Returns an empty list if we fail to parse any of the entries. std::vector<Certificate> LoadKeysFromZipfile(const std::string& zip_name); -#define VERIFY_SUCCESS 0 -#define VERIFY_FAILURE 1 - -#endif /* _RECOVERY_VERIFIER_H */ +#define VERIFY_SUCCESS 0 +#define VERIFY_FAILURE 1 diff --git a/asn1_decoder.h b/install/include/private/asn1_decoder.h index 3e992115a..e5337d9c4 100644 --- a/asn1_decoder.h +++ b/install/include/private/asn1_decoder.h @@ -17,6 +17,7 @@ #ifndef ASN1_DECODER_H_ #define ASN1_DECODER_H_ +#include <stddef.h> #include <stdint.h> class asn1_context { diff --git a/private/install.h b/install/include/private/setup_commands.h index 7fdc741d6..7fdc741d6 100644 --- a/private/install.h +++ b/install/include/private/setup_commands.h |