summaryrefslogtreecommitdiffstats
path: root/applypatch
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2015-08-10 19:44:33 +0200
committerAndroid Git Automerger <android-git-automerger@android.com>2015-08-10 19:44:33 +0200
commit6e14f4f1d16476e06ad46e270b94de959742717c (patch)
treef6703d2798d344fa8ed5b99eb3388f94babf30fd /applypatch
parentam f2a23a94: am 236b3eb6: am e67104a6: Merge "Use CPPFLAGS instead of CFLAGS." (diff)
parentam 7f89389a: am 7c511184: Merge "updater: Clean up char* with std::string." (diff)
downloadandroid_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.tar
android_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.tar.gz
android_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.tar.bz2
android_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.tar.lz
android_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.tar.xz
android_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.tar.zst
android_bootable_recovery-6e14f4f1d16476e06ad46e270b94de959742717c.zip
Diffstat (limited to 'applypatch')
-rw-r--r--applypatch/applypatch.cpp12
1 files changed, 1 insertions, 11 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 751d3e392..1767761a8 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -31,6 +31,7 @@
#include "applypatch.h"
#include "mtdutils/mtdutils.h"
#include "edify/expr.h"
+#include "print_sha1.h"
static int LoadPartitionContents(const char* filename, FileContents* file);
static ssize_t FileSink(const unsigned char* data, ssize_t len, void* token);
@@ -43,7 +44,6 @@ static int GenerateTarget(FileContents* source_file,
const uint8_t target_sha1[SHA_DIGEST_SIZE],
size_t target_size,
const Value* bonus_data);
-static std::string short_sha1(const uint8_t sha1[SHA_DIGEST_SIZE]);
static bool mtd_partitions_scanned = false;
@@ -630,16 +630,6 @@ int CacheSizeCheck(size_t bytes) {
}
}
-static std::string short_sha1(const uint8_t sha1[SHA_DIGEST_SIZE]) {
- const char* hex = "0123456789abcdef";
- std::string result = "";
- for (size_t i = 0; i < 4; ++i) {
- result.push_back(hex[(sha1[i]>>4) & 0xf]);
- result.push_back(hex[sha1[i] & 0xf]);
- }
- return result;
-}
-
// This function applies binary patches to files in a way that is safe
// (the original file is not touched until we have the desired
// replacement for it) and idempotent (it's okay to run this program