summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-07-21 02:37:09 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-07-21 02:37:09 +0200
commit4ad9995b5bef8fcf3d8d6c70c742e3648d244aac (patch)
tree6cbd663fd2d46a879605ecb97191816f0df09dd6 /applypatch/applypatch.cpp
parentMerge "Updates Wear UI to Display Localized Recovery Text." am: 6bc9d605f3 (diff)
parentMerge "applypatch: Change applypatch command-line arguments." (diff)
downloadandroid_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.tar
android_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.tar.gz
android_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.tar.bz2
android_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.tar.lz
android_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.tar.xz
android_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.tar.zst
android_bootable_recovery-4ad9995b5bef8fcf3d8d6c70c742e3648d244aac.zip
Diffstat (limited to '')
-rw-r--r--applypatch/applypatch.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 12e139930..b1aefa49b 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -495,19 +495,15 @@ int applypatch_flash(const char* source_filename, const char* target_filename,
return 1;
}
- std::string target_str(target_filename);
- std::vector<std::string> pieces = android::base::Split(target_str, ":");
- if (pieces.size() != 2 || pieces[0] != "EMMC") {
+ std::vector<std::string> pieces = android::base::Split(target_filename, ":");
+ if (pieces.size() != 4 || pieces[0] != "EMMC") {
LOG(ERROR) << "Invalid target name \"" << target_filename << "\"";
return 1;
}
// Load the target into the source_file object to see if already applied.
- pieces.push_back(std::to_string(target_size));
- pieces.push_back(target_sha1_str);
- std::string fullname = android::base::Join(pieces, ':');
FileContents source_file;
- if (LoadPartitionContents(fullname, &source_file) == 0 &&
+ if (LoadPartitionContents(target_filename, &source_file) == 0 &&
memcmp(source_file.sha1, target_sha1, SHA_DIGEST_LENGTH) == 0) {
// The early-exit case: the image was already applied, this partition has the desired hash,
// nothing for us to do.