Home
last modified time | relevance | path

Searched refs:patch (Results 1 – 11 of 11) sorted by relevance

/bootable/recovery/tests/unit/host/
Dimgdiff_test.cpp38 static void verify_patch_header(const std::string& patch, size_t* num_normal, size_t* num_raw, in verify_patch_header() argument
40 const size_t size = patch.size(); in verify_patch_header()
41 const char* data = patch.data(); in verify_patch_header()
83 static void GenerateTarget(const std::string& src, const std::string& patch, std::string* patched) { in GenerateTarget() argument
86 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in GenerateTarget()
93 static void verify_patched_image(const std::string& src, const std::string& patch, in verify_patched_image() argument
96 GenerateTarget(src, patch, &patched); in verify_patched_image()
133 std::string patch; in TEST() local
134 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, &patch)); in TEST()
140 verify_patch_header(patch, &num_normal, &num_raw, &num_deflate); in TEST()
[all …]
Dupdate_simulator_test.cpp71 static void CreateBsdiffPatch(const string& src, const string& tgt, string* patch) { in CreateBsdiffPatch() argument
76 ASSERT_TRUE(android::base::ReadFileToString(patch_file.path, patch)); in CreateBsdiffPatch()
274 R"(patch_partition("%s", "%s", package_extract_file("patch.p")) || abort("patch failed");)",
317 { "system.patch.dat", system_patch },
320 { "patch.p", recovery_from_boot },
342 { "system.patch.dat", "" },
393 { "system.patch.dat", "" },
396 { "patch.p", "random string" },
/bootable/recovery/applypatch/
Dbspatch.cpp68 int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value& patch, in ApplyBSDiffPatch() argument
70 CHECK_LE(patch_offset, patch.data.size()); in ApplyBSDiffPatch()
73 reinterpret_cast<const uint8_t*>(&patch.data[patch_offset]), in ApplyBSDiffPatch()
74 patch.data.size() - patch_offset, sink); in ApplyBSDiffPatch()
80 SHA1(reinterpret_cast<const uint8_t*>(patch.data.data() + patch_offset), in ApplyBSDiffPatch()
81 patch.data.size() - patch_offset, digest); in ApplyBSDiffPatch()
Dimgpatch.cpp54 const Value& patch, size_t patch_offset, in ApplyBSDiffPatchAndStreamOutput() argument
113 int bspatch_result = ApplyBSDiffPatch(src_data, src_len, patch, patch_offset, compression_sink); in ApplyBSDiffPatchAndStreamOutput()
137 Value patch(Value::Type::BLOB, in ApplyImagePatch() local
139 return ApplyImagePatch(old_data, old_size, patch, sink, nullptr); in ApplyImagePatch()
142 int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value& patch, SinkFn sink, in ApplyImagePatch() argument
144 if (patch.data.size() < 12) { in ApplyImagePatch()
151 const char* const patch_header = patch.data.data(); in ApplyImagePatch()
161 if (pos + 4 > patch.data.size()) { in ApplyImagePatch()
171 if (pos > patch.data.size()) { in ApplyImagePatch()
184 if (ApplyBSDiffPatch(old_data + src_start, src_len, patch, patch_offset, sink) != 0) { in ApplyImagePatch()
[all …]
Dapplypatch.cpp50 const Value& patch, const Value* bonus_data, bool backup_source);
268 bool PatchPartition(const Partition& target, const Partition& source, const Value& patch, in PatchPartition() argument
283 return GenerateTarget(target, source_file, patch, bonus, backup_source); in PatchPartition()
329 const Value& patch, const Value* bonus_data, bool backup_source) { in GenerateTarget() argument
336 if (patch.type != Value::Type::BLOB) { in GenerateTarget()
341 const char* header = patch.data.data(); in GenerateTarget()
342 size_t header_bytes_read = patch.data.size(); in GenerateTarget()
375 result = ApplyBSDiffPatch(source_file.data.data(), source_file.data.size(), patch, 0, sink); in GenerateTarget()
378 ApplyImagePatch(source_file.data.data(), source_file.data.size(), patch, sink, bonus_data); in GenerateTarget()
395 SHA1(reinterpret_cast<const uint8_t*>(patch.data.data()), patch.data.size(), patch_digest); in GenerateTarget()
[all …]
Dapplypatch_modes.cpp79 Value patch(Value::Type::BLOB, std::move(patch_contents)); in PatchMode() local
90 return PatchPartition(target, source, patch, bonus.get(), false) ? 0 : 1; in PatchMode()
128 std::string patch; in applypatch_modes() local
154 patch = optarg; in applypatch_modes()
182 return PatchMode(target, source, patch, bonus); in applypatch_modes()
Dimgdiff.cpp549 for (const auto& patch : patch_chunks) { in WritePatchDataToFd() local
550 total_header_size += patch.GetHeaderSize(); in WritePatchDataToFd()
568 for (const auto& patch : patch_chunks) { in WritePatchDataToFd() local
569 if (patch.type_ == CHUNK_RAW) { in WritePatchDataToFd()
572 if (!android::base::WriteFully(patch_fd, patch.data_.data(), patch.data_.size())) { in WritePatchDataToFd()
573 PLOG(ERROR) << "Failed to write " << patch.data_.size() << " bytes patch to patch_fd"; in WritePatchDataToFd()
/bootable/recovery/applypatch/include/applypatch/
Dapplypatch.h79 bool PatchPartition(const Partition& target, const Partition& source, const Value& patch,
109 int ApplyBSDiffPatch(const unsigned char* old_data, size_t old_size, const Value& patch,
117 int ApplyImagePatch(const unsigned char* old_data, size_t old_size, const Value& patch, SinkFn sink,
/bootable/recovery/tests/unit/
Dcommands_test.cpp178 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
210 ASSERT_EQ(PatchInfo(0, 148), command.patch()); in TEST()
226 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
242 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
266 ASSERT_EQ(PatchInfo(29629269, 185), command.patch()); in TEST()
289 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
305 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
321 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
337 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
356 ASSERT_EQ(PatchInfo(), command.patch()); in TEST()
Dapplypatch_test.cpp138 Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend())); in TEST_F() local
144 ASSERT_TRUE(PatchPartition(target_partition, source_partition, patch, &bonus, false)); in TEST_F()
152 Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend())); in TEST_F() local
154 ASSERT_TRUE(PatchPartition(target_partition, source_partition, patch, nullptr, false)); in TEST_F()
/bootable/recovery/updater/include/private/
Dcommands.h305 Command(Type type, size_t index, std::string cmdline, PatchInfo patch, TargetInfo target, in Command() argument
310 patch_(patch), in Command()
337 const PatchInfo& patch() const { in patch() function