/bootable/recovery/updater/ |
D | install.cpp | 101 if (argv.size() < 1 || argv.size() > 2) { in PackageExtractFileFn() 103 argv.size()); in PackageExtractFileFn() 106 if (argv.size() == 2) { in PackageExtractFileFn() 112 argv.size()); in PackageExtractFileFn() 163 argv.size()); in PackageExtractFileFn() 178 ExtractToMemory(za, &entry, reinterpret_cast<uint8_t*>(&buffer[0]), buffer.size()); in PackageExtractFileFn() 182 zip_path.c_str(), buffer.size(), ErrorCodeString(ret)); in PackageExtractFileFn() 199 if (argv.size() != 2) { in PatchPartitionCheckFn() 201 "%s(): Invalid number of args (expected 2, got %zu)", name, argv.size()); in PatchPartitionCheckFn() 240 if (argv.size() != 3) { in PatchPartitionFn() [all …]
|
D | commands.cpp | 93 if (tokens.size() < 3) { in ParseTargetInfoAndSourceInfo() 127 if (pos >= tokens.size()) { in ParseTargetInfoAndSourceInfo() 151 while (pos < tokens.size()) { in ParseTargetInfoAndSourceInfo() 155 if (pairs.size() != 2) { in ParseTargetInfoAndSourceInfo() 195 if (pos + 1 != tokens.size()) { in Parse() 197 tokens.size() - pos); in Parse() 208 if (pos + 2 != tokens.size()) { in Parse() 210 tokens.size() - pos); in Parse() 222 if (pos + 1 != tokens.size()) { in Parse() 224 tokens.size() - pos); in Parse() [all …]
|
D | dynamic_partitions.cpp | 39 if (argv.size() != arg_names.size()) { in ReadStringArgs() 41 arg_names.size(), argv.size()); in ReadStringArgs() 50 CHECK_EQ(args.size(), arg_names.size()); in ReadStringArgs() 52 for (size_t i = 0; i < arg_names.size(); ++i) { in ReadStringArgs() 91 if (argv.size() != 1) { in UpdateDynamicPartitionsFn() 92 ErrorAbort(state, kArgsParsingFailure, "%s expects 1 arguments, got %zu", name, argv.size()); in UpdateDynamicPartitionsFn()
|
D | blockimg.cpp | 114 if (lines.size() != 2) { in ParseLastCommandFile() 195 static bool discard_blocks(int fd, off64_t offset, uint64_t size, bool force = false) { in discard_blocks() argument 201 uint64_t args[2] = { static_cast<uint64_t>(offset), size }; in discard_blocks() 223 static void allocate(size_t size, std::vector<uint8_t>* buffer) { in allocate() argument 225 if (size <= buffer->size()) return; in allocate() 226 buffer->resize(size); in allocate() 241 CHECK_NE(tgt.size(), static_cast<size_t>(0)); in RangeSinkWriter() 245 return next_range_ == tgt_.size() && current_range_left_ == 0; in Finished() 253 size_t Write(const uint8_t* data, size_t size) { in Write() argument 255 LOG(ERROR) << "range sink write overrun; can't write " << size << " bytes"; in Write() [all …]
|
D | updater_runtime_dynamic_partitions.cpp | 106 bool ExpectArgSize(size_t size) const { in ExpectArgSize() 108 auto actual = tokens.size() - 1; in ExpectArgSize() 109 if (actual != size) { in ExpectArgSize() 110 LOG(ERROR) << "Op " << op() << " expects " << size << " args, got " << actual; in ExpectArgSize() 120 CHECK_LE(pos + 1, tokens.size()); in arg() 140 auto size = params.uint_arg(1, "size"); in PerformOpResize() local 141 if (!size.has_value()) return false; in PerformOpResize() 153 if (!params.builder->ResizePartition(partition, size.value())) { in PerformOpResize() 154 LOG(ERROR) << "Failed to resize partition " << partition_name_suffix << " to size " << *size in PerformOpResize()
|
/bootable/recovery/bootloader_message/ |
D | bootloader_message.cpp | 90 static bool read_misc_partition(void* p, size_t size, const std::string& misc_blk_device, in read_misc_partition() argument 106 if (!android::base::ReadFully(fd, p, size)) { in read_misc_partition() 114 bool write_misc_partition(const void* p, size_t size, const std::string& misc_blk_device, in write_misc_partition() argument 127 if (!android::base::WriteFully(fd, p, size)) { in write_misc_partition() 238 bool read_wipe_package(std::string* package_data, size_t size, std::string* err) { in read_wipe_package() argument 243 package_data->resize(size); in read_wipe_package() 244 return read_misc_partition(&(*package_data)[0], size, misc_blk_device, in read_wipe_package() 255 if (package_data.size() > kMaximumWipePackageSize) { in write_wipe_package() 256 *err = "Wipe package size " + std::to_string(package_data.size()) + " exceeds " + in write_wipe_package() 260 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package() [all …]
|
/bootable/recovery/applypatch/ |
D | applypatch.cpp | 65 SHA1(file->data.data(), file->data.size(), file->sha1); in LoadFileContents() 82 std::vector<unsigned char> buffer(partition.size); in ReadPartitionToBuffer() 83 if (!android::base::ReadFully(dev, buffer.data(), buffer.size())) { in ReadPartitionToBuffer() 84 PLOG(ERROR) << "Failed to read " << buffer.size() << " bytes of data for partition " in ReadPartitionToBuffer() 87 SHA1(buffer.data(), buffer.size(), out->sha1); in ReadPartitionToBuffer() 117 if (!android::base::WriteFully(fd, file->data.data(), file->data.size())) { in SaveFileContents() 118 PLOG(ERROR) << "Failed to write " << file->data.size() << " bytes of data to " << filename; in SaveFileContents() 138 size_t len = file_contents.data.size(); in WriteBufferToPartition() 342 size_t header_bytes_read = patch.data.size(); in GenerateTarget() 354 if (backup_source && !CheckAndFreeSpaceOnCache(source_file.data.size())) { in GenerateTarget() [all …]
|
D | imgdiff.cpp | 270 CHECK_LE(start_ + raw_data_len_, input_file_ptr_->size()); in GetRawData() 283 return uncompressed_data_.size(); in DataLengthForPatch() 408 strm.avail_in = uncompressed_data_.size(); in TryReconstruction() 419 strm.avail_out = buffer.size(); in TryReconstruction() 427 size_t compressed_size = buffer.size() - strm.avail_out; in TryReconstruction() 491 return 4 + 4 + data_.size(); in GetHeaderSize() 504 target_start_, target_len_, data_.size()); in WriteHeaderToFd() 508 return offset + data_.size(); in WriteHeaderToFd() 511 target_start_, target_len_, data_.size()); in WriteHeaderToFd() 522 return offset + data_.size(); in WriteHeaderToFd() [all …]
|
D | bspatch.cpp | 70 CHECK_LE(patch_offset, patch.data.size()); in ApplyBSDiffPatch() 74 patch.data.size() - patch_offset, sink); in ApplyBSDiffPatch() 81 patch.data.size() - patch_offset, digest); in ApplyBSDiffPatch()
|
D | imgpatch.cpp | 144 if (patch.data.size() < 12) { in ApplyImagePatch() 161 if (pos + 4 > patch.data.size()) { in ApplyImagePatch() 171 if (pos > patch.data.size()) { in ApplyImagePatch() 193 if (pos > patch.data.size()) { in ApplyImagePatch() 200 if (pos + data_len > patch.data.size()) { in ApplyImagePatch() 215 if (pos > patch.data.size()) { in ApplyImagePatch() 236 size_t bonus_size = (i == 1 && bonus_data != nullptr) ? bonus_data->data.size() : 0; in ApplyImagePatch()
|
/bootable/recovery/tests/unit/ |
D | package_test.cpp | 48 ASSERT_EQ(0, writer.WriteBytes(entry.c_str(), entry.size())); in SetUp() 66 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F() 67 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 0)); in TEST_F() 70 ASSERT_TRUE(package->ReadFullyAtOffset(buffer.data(), file_content_.size() - 10, 10)); in TEST_F() 77 std::vector<uint8_t> buffer(file_content_.size()); in TEST_F() 79 ASSERT_FALSE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 10)); in TEST_F() 85 uint64_t hash_size = file_content_.size() / 2; in TEST_F() 112 std::vector<uint8_t> extracted(entry_name.size()); in TEST_F() 113 ASSERT_EQ(0, ExtractToMemory(zip, &entry, extracted.data(), extracted.size())); in TEST_F()
|
D | applypatch_modes_test.cpp | 48 SHA1(reinterpret_cast<const uint8_t*>(data.c_str()), data.size(), digest); in GetEmmcTargetString() 51 std::to_string(data.size()) + ":" + print_sha1(digest); in GetEmmcTargetString() 82 return applypatch_modes(args_to_call.size() - 1, args_to_call.data()); in InvokeApplyPatchModes() 87 ASSERT_EQ(4, pieces.size()); in VerifyPatchedTarget() 143 bsdiff::bsdiff(reinterpret_cast<const uint8_t*>(src_content.data()), src_content.size(), in TEST_F() 144 reinterpret_cast<const uint8_t*>(tgt_content.data()), tgt_content.size(), in TEST_F()
|
D | updater_test.cpp | 100 ASSERT_EQ(0, zip_writer.WriteBytes(entry.second.data(), entry.second.size())); in BuildUpdatePackage() 111 SHA1(reinterpret_cast<const uint8_t*>(content.data()), content.size(), digest); in GetSha1() 117 if (argv.size() != 1) { in BlobToString() 118 return ErrorAbort(state, kArgsParsingFailure, "%s() expects 1 arg, got %zu", name, argv.size()); in BlobToString() 258 size_t source_size = source_content.size(); in TEST_F() 265 size_t target_size = target_content.size(); in TEST_F() 421 ASSERT_EQ(129 * 4096, data.size()); in TEST_F() 446 ASSERT_EQ(129 * 4096, updated.size()); in TEST_F() 457 SHA256(hash_tree.data(), hash_tree.size(), digest.data()); in TEST_F() 468 ASSERT_EQ(129 * 4096, data.size()); in TEST_F() [all …]
|
D | uncrypt_test.cpp | 109 int length = static_cast<int>(message.size()); in SetupOrClearBcb() 140 ASSERT_LE(message_in_bcb.size(), sizeof(boot.recovery)); in SetupOrClearBcb() 141 size_t left = sizeof(boot.recovery) - message_in_bcb.size(); in SetupOrClearBcb() 142 ASSERT_EQ(std::string(left, '\0'), std::string(&boot.recovery[message_in_bcb.size()], left)); in SetupOrClearBcb() 176 memcpy(&boot, random_data.c_str(), random_data.size()); in TEST_F()
|
/bootable/recovery/tests/unit/host/ |
D | imgdiff_test.cpp | 40 const size_t size = patch.size(); in verify_patch_header() local 43 ASSERT_GE(size, 12U); in verify_patch_header() 55 ASSERT_LE(pos + 4, size); in verify_patch_header() 60 ASSERT_LE(pos, size); in verify_patch_header() 63 ASSERT_LE(pos + 4, size); in verify_patch_header() 67 ASSERT_LE(pos, size); in verify_patch_header() 71 ASSERT_LE(pos, size); in verify_patch_header() 85 ASSERT_EQ(0, ApplyImagePatch(reinterpret_cast<const unsigned char*>(src.data()), src.size(), in GenerateTarget() 86 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in GenerateTarget() 130 ASSERT_EQ(0, imgdiff(args.size(), args.data())); in TEST() [all …]
|
D | update_simulator_test.cpp | 58 ASSERT_EQ(0, writer.WriteBytes(pair.second.data(), pair.second.size())); in AddZipEntries() 67 SHA1(reinterpret_cast<const uint8_t*>(data.c_str()), data.size(), digest); in CalculateSha1() 73 ASSERT_EQ(0, bsdiff::bsdiff(reinterpret_cast<const uint8_t*>(src.data()), src.size(), in CreateBsdiffPatch() 74 reinterpret_cast<const uint8_t*>(tgt.data()), tgt.size(), in CreateBsdiffPatch() 267 "EMMC:/dev/block/by-name/boot:%zu:%s", boot_img_string.size(), boot_sha1.c_str()); 269 "EMMC:/dev/block/by-name/recovery:%zu:%s", recovery_img_string.size(), recovery_sha1.c_str()); 295 android::base::StringPrintf("bsdiff 0 %zu %s %s 2,0,1 1 2,0,1", system_patch.size(),
|
/bootable/recovery/edify/ |
D | expr.cpp | 83 for (size_t i = 0; i < argv.size(); ++i) { in ConcatFn() 95 if (argv.size() != 2 && argv.size() != 3) { in IfElseFn() 107 } else if (argv.size() == 3) { in IfElseFn() 125 for (size_t i = 0; i < argv.size(); ++i) { in AssertFn() 155 for (size_t i = 0; i < argv.size(); ++i) { in StdoutFn() 256 if (argv.size() != 2) { in LessThanIntFn() 284 if (argv.size() != 2) { in GreaterThanIntFn() 354 return ReadArgs(state, argv, args, 0, argv.size()); in ReadArgs() 362 if (start + len > argv.size()) { in ReadArgs() 380 return ReadValueArgs(state, argv, args, 0, argv.size()); in ReadValueArgs() [all …]
|
/bootable/recovery/tests/manual/ |
D | recovery_test.cpp | 44 EXPECT_EQ(kInjectTxtContent.size(), len); in __pmsg_fn() 59 kInjectTxtContent.c_str(), kInjectTxtContent.size())); in TEST() 64 EXPECT_EQ(static_cast<ssize_t>(kInjectTxtContent.size()), ret); in TEST() 77 kInjectTxtContent.c_str(), kInjectTxtContent.size())); in TEST()
|
/bootable/recovery/fuse_sideload/ |
D | fuse_sideload.cpp | 152 static void fill_attr(fuse_attr* attr, const fuse_data* fd, uint64_t nodeid, uint64_t size, in fill_attr() argument 161 attr->size = size; in fill_attr() 162 attr->blocks = (size == 0) ? 0 : (((size - 1) / attr->blksize) + 1); in fill_attr() 284 uint32_t size = req->size; in handle_read() local 295 outhdr.len = sizeof(outhdr) + size; in handle_read() 318 if (size + block_offset <= fd->block_size) { in handle_read() 322 vec[1].iov_len = size; in handle_read() 334 vec[2].iov_len = size - vec[1].iov_len; in handle_read()
|
/bootable/recovery/applypatch/include/applypatch/ |
D | applypatch.h | 51 Partition(const std::string& name, size_t size, const std::string& hash) in Partition() 52 : name(name), size(size), hash(hash) {} in Partition() 66 size_t size; member
|
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/util/ |
D | PayloadSpecs.java | 97 .size(payloadSize) in forNonStreaming() 107 long size, in forStreaming() argument 112 .size(size) in forStreaming()
|
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/ |
D | PayloadSpec.java | 105 public Builder size(long size) { in size() argument 106 this.mSize = size; in size()
|
/bootable/recovery/otautil/ |
D | sysutil.cpp | 46 if (lines.size() < 4) { in ParseBlockMapFile() 47 LOG(ERROR) << "Block map file is too short: " << lines.size(); in ParseBlockMapFile() 73 lines.size() != 3 + range_count) { in ParseBlockMapFile() 75 << ", range_count " << range_count << ", lines " << lines.size(); in ParseBlockMapFile() 180 LOG(INFO) << "mmapped " << block_map_data.block_ranges().size() << " ranges"; in MapBlockFile() 242 std::vector<char*> result(args.size()); in StringVectorToNullTerminatedArray()
|
/bootable/recovery/updater_sample/tests/src/com/example/android/systemupdatersample/util/ |
D | PayloadSpecsTest.java | 88 assertEquals(4, spec.getProperties().size()); in forNonStreaming_works() 104 long size = 200; in forStreaming_works() local 107 PayloadSpec spec = mPayloadSpecs.forStreaming(url, offset, size, propertiesFile); in forStreaming_works() 110 assertEquals("same size", size, spec.getSize()); in forStreaming_works()
|
/bootable/recovery/recovery_ui/ |
D | screen_ui.cpp | 78 size_t items_count = scrollable_ ? items.size() : std::min(items.size(), max_display_items_); in TextMenu() 91 CHECK_LT(index, text_items_.size()); in TextItem() 105 return text_items_.size(); in ItemsCount() 206 graphic_items_.reserve(graphic_items.size()); in GraphicMenu() 213 CHECK_LE(graphic_items_.size(), static_cast<size_t>(std::numeric_limits<int>::max())); in Select() 214 int count = graphic_items_.size(); in Select() 240 for (size_t i = 0; i < graphic_items_.size(); i++) { in DrawItems() 552 "Current locale: %s, %zu/%zu", locales_entries[sel].c_str(), sel + 1, locales_entries.size()); in SelectAndShowBackgroundText() 592 selected = (selected == 0) ? locales_entries.size() - 1 : selected - 1; in CheckBackgroundTextImages() 595 selected = (selected == locales_entries.size() - 1) ? 0 : selected + 1; in CheckBackgroundTextImages() [all …]
|