summaryrefslogtreecommitdiffstats
path: root/applypatch/applypatch.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-20 11:35:40 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-20 11:35:40 +0200
commita47f214ff441ac00567a42274d3fe0d9ae386855 (patch)
tree72a5befe299382ffc4aec15f7127aa8e4f003f17 /applypatch/applypatch.cpp
parentSnap for 4726042 from d57f3c7736536cdeb854252b846ea4cf21810a6a to qt-release (diff)
parentMerge "applypatch: Dump patch info on mismatching patching result." am: d2c32b281b am: ea70fd7d1d (diff)
downloadandroid_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.tar
android_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.tar.gz
android_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.tar.bz2
android_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.tar.lz
android_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.tar.xz
android_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.tar.zst
android_bootable_recovery-a47f214ff441ac00567a42274d3fe0d9ae386855.zip
Diffstat (limited to '')
-rw-r--r--applypatch/applypatch.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 6f6c187be..120add6d6 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -652,7 +652,22 @@ static int GenerateTarget(const FileContents& source_file, const std::unique_ptr
uint8_t current_target_sha1[SHA_DIGEST_LENGTH];
SHA1_Final(current_target_sha1, &ctx);
if (memcmp(current_target_sha1, target_sha1, SHA_DIGEST_LENGTH) != 0) {
- printf("patch did not produce expected sha1\n");
+ printf("patch did not produce expected sha1 of %s\n", short_sha1(target_sha1).c_str());
+
+ printf("target size %zu sha1 %s\n", memory_sink_str.size(),
+ short_sha1(current_target_sha1).c_str());
+ printf("source size %zu sha1 %s\n", source_file.data.size(),
+ short_sha1(source_file.sha1).c_str());
+
+ uint8_t patch_digest[SHA_DIGEST_LENGTH];
+ SHA1(reinterpret_cast<const uint8_t*>(patch->data.data()), patch->data.size(), patch_digest);
+ printf("patch size %zu sha1 %s\n", patch->data.size(), short_sha1(patch_digest).c_str());
+
+ uint8_t bonus_digest[SHA_DIGEST_LENGTH];
+ SHA1(reinterpret_cast<const uint8_t*>(bonus_data->data.data()), bonus_data->data.size(),
+ bonus_digest);
+ printf("bonus size %zu sha1 %s\n", bonus_data->data.size(), short_sha1(bonus_digest).c_str());
+
return 1;
} else {
printf("now %s\n", short_sha1(target_sha1).c_str());