/bootable/recovery/tests/unit/ |
D | asn1_decoder_test.cpp | 55 uint8_t data[] = { 0xA5, 0x02, 0x06, 0x01, 0x01 }; in TEST() local 56 asn1_context ctx(data, sizeof(data)); in TEST() 66 uint8_t data[] = { 0xA5, 0x03, 0x06, 0x01, 0x01 }; in TEST() local 67 asn1_context ctx(data, sizeof(data)); in TEST() 85 uint8_t data[] = { 0xA0, 0x03, 0x02, 0x01, 0x01, 0xA1, 0x03, 0x02, 0x01, 0x01, 0x06, 0x01, 0xA5 }; in TEST() local 86 asn1_context ctx(data, sizeof(data)); in TEST() 102 uint8_t data[] = { 0x30, 0x02, 0x06, 0x01, 0x01 }; in TEST() local 103 asn1_context ctx(data, sizeof(data)); in TEST() 112 uint8_t data[] = { 0x30, 0x03, 0x06, 0x01, 0x01 }; in TEST() local 113 asn1_context ctx(data, sizeof(data)); in TEST() [all …]
|
D | minui_test.cpp | 30 ASSERT_EQ(0, reinterpret_cast<uintptr_t>(surface->data()) % GRSurface::kSurfaceDataAlignment); in TEST() 48 image->data()[i] = rand() % 128; in TEST() 52 ASSERT_EQ(std::vector(image->data(), image->data() + image->data_size()), in TEST() 53 std::vector(image_copy->data(), image_copy->data() + image->data_size())); in TEST()
|
D | package_test.cpp | 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() 79 ASSERT_FALSE(package->ReadFullyAtOffset(buffer.data(), file_content_.size(), 10)); in TEST_F() 87 SHA1(reinterpret_cast<uint8_t*>(file_content_.data()), hash_size, expected_sha.data()); in TEST_F() 97 SHA1_Final(calculated_sha.data(), &ctx); in TEST_F() 114 ASSERT_EQ(0, ExtractToMemory(zip, &entry, extracted.data(), extracted.size())); in TEST_F()
|
D | applypatch_test.cpp | 52 source_size = boot_fc.data.size(); in SetUp() 58 target_size = recovery_fc.data.size(); in SetUp() 138 Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend())); in TEST_F() 142 Value bonus(Value::Type::BLOB, std::string(bonus_fc.data.cbegin(), bonus_fc.data.cend())); in TEST_F() 152 Value patch(Value::Type::BLOB, std::string(patch_fc.data.cbegin(), patch_fc.data.cend())); in TEST_F()
|
/bootable/recovery/applypatch/ |
D | applypatch.cpp | 58 std::string data; in LoadFileContents() local 59 if (!android::base::ReadFileToString(filename, &data)) { in LoadFileContents() 64 file->data = std::vector<unsigned char>(data.begin(), data.end()); in LoadFileContents() 65 SHA1(file->data.data(), file->data.size(), file->sha1); in LoadFileContents() 83 if (!android::base::ReadFully(dev, buffer.data(), buffer.size())) { in ReadPartitionToBuffer() 87 SHA1(buffer.data(), buffer.size(), out->sha1); in ReadPartitionToBuffer() 89 out->data = std::move(buffer); 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() 137 const unsigned char* data = file_contents.data.data(); in WriteBufferToPartition() local [all …]
|
D | bspatch.cpp | 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()
|
D | imgpatch.cpp | 82 &ret, &sink](const uint8_t* data, size_t len) -> size_t { in ApplyBSDiffPatchAndStreamOutput() argument 85 strm.next_in = data; in ApplyBSDiffPatchAndStreamOutput() 89 strm.next_out = buffer.data(); in ApplyBSDiffPatchAndStreamOutput() 103 if (sink(buffer.data(), have) != have) { in ApplyBSDiffPatchAndStreamOutput() 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() 193 if (pos > patch.data.size()) { in ApplyImagePatch() 200 if (pos + data_len > patch.data.size()) { in ApplyImagePatch() [all …]
|
D | imgdiff.cpp | 271 return input_file_ptr_->data() + start_; in GetRawData() 276 return uncompressed_data_.data(); in DataForPatch() 301 void ImageChunk::SetUncompressedData(std::vector<uint8_t> data) { in SetUncompressedData() argument 302 uncompressed_data_ = std::move(data); in SetUncompressedData() 369 if (!android::base::ReadFully(patch_fd, patch_data->data(), sz)) { in MakePatch() 409 strm.next_in = uncompressed_data_.data(); in TryReconstruction() 420 strm.next_out = buffer.data(); in TryReconstruction() 428 if (memcmp(buffer.data(), input_file_ptr_->data() + start_ + offset, compressed_size) != 0) { in TryReconstruction() 444 PatchChunk::PatchChunk(const ImageChunk& tgt, const ImageChunk& src, std::vector<uint8_t> data) in PatchChunk() argument 453 data_(std::move(data)) {} in PatchChunk() [all …]
|
/bootable/recovery/minadbd/ |
D | minadbd_services_test.cpp | 67 ASSERT_TRUE(android::base::ReadFully(fd, received.data(), kMinadbdMessageSize)); in ReadAndCheckCommandMessage() 70 memcpy(expected.data(), kMinadbdCommandPrefix, strlen(kMinadbdCommandPrefix)); in ReadAndCheckCommandMessage() 71 memcpy(expected.data() + strlen(kMinadbdCommandPrefix), &expected_command, in ReadAndCheckCommandMessage() 103 memcpy(status_message.data(), kMinadbdStatusPrefix, strlen(kMinadbdStatusPrefix)); in WriteMinadbdCommandStatus() 104 memcpy(status_message.data() + strlen(kMinadbdStatusPrefix), &status, sizeof(status)); in WriteMinadbdCommandStatus() 106 android::base::WriteFully(recovery_socket_, status_message.data(), kMinadbdMessageSize)); in WriteMinadbdCommandStatus() 178 if (!android::base::ReadFully(fd, content_from_fuse.data(), 4096)) { in TEST_F() 195 ASSERT_TRUE(android::base::ReadFully(fd, adb_message.data(), 8)); in TEST_F() 197 ASSERT_TRUE(android::base::WriteFully(fd, content.data(), 4096)); in TEST_F()
|
D | fuse_adb_provider_test.cpp | 35 FuseAdbDataProvider data(std::move(device_socket), 0, 0); in TEST() local 49 ASSERT_TRUE(data.ReadBlockAlignedData(reinterpret_cast<uint8_t*>(block_data), in TEST() 75 FuseAdbDataProvider data(std::move(device_socket), 0, 0); in TEST() local 84 ASSERT_FALSE(data.ReadBlockAlignedData(reinterpret_cast<uint8_t*>(buf), 1, 0)); in TEST()
|
/bootable/recovery/fuse_sideload/ |
D | fuse_sideload.cpp | 98 static void fuse_reply(const fuse_data* fd, uint64_t unique, const void* data, size_t len) { in fuse_reply() argument 107 vec[1].iov_base = const_cast<void*>(data); in fuse_reply() 116 static int handle_init(void* data, fuse_data* fd, const fuse_in_header* hdr) { in handle_init() argument 117 const fuse_init_in* req = static_cast<const fuse_init_in*>(data); in handle_init() 184 static int handle_lookup(void* data, const fuse_data* fd, const fuse_in_header* hdr) { in handle_lookup() argument 185 if (data == nullptr) return -ENOENT; in handle_lookup() 191 std::string filename(static_cast<const char*>(data)); in handle_lookup() 261 SHA256(fd->block_data, fd->block_size, hash.data()); in fetch_block() 279 static int handle_read(void* data, fuse_data* fd, const fuse_in_header* hdr) { in handle_read() argument 282 const fuse_read_in* req = static_cast<const fuse_read_in*>(data); in handle_read() [all …]
|
/bootable/recovery/misc_writer/ |
D | misc_writer.cpp | 96 auto data = ParseHexString(hex_string); in main() local 97 if (data.empty()) { in main() 101 if (std::string err; !WriteMiscPartitionVendorSpace(data.data(), data.size(), offset, &err)) { in main()
|
/bootable/recovery/tests/component/ |
D | applypatch_modes_test.cpp | 41 std::string data; in GetEmmcTargetString() local 42 if (!android::base::ReadFileToString(filename, &data)) { in GetEmmcTargetString() 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() 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 | imgdiff_test.cpp | 42 const char* data = patch.data(); in verify_patch_header() local 45 ASSERT_EQ("IMGDIFF2", std::string(data, 8)); in verify_patch_header() 47 const int num_chunks = get_unaligned<int32_t>(data + 8); in verify_patch_header() 57 int type = get_unaligned<int32_t>(data + pos); in verify_patch_header() 65 ssize_t data_len = get_unaligned<int32_t>(data + pos); in verify_patch_header() 86 ASSERT_EQ(0, ApplyImagePatch(reinterpret_cast<const unsigned char*>(src.data()), src.size(), in GenerateTarget() 87 reinterpret_cast<const unsigned char*>(patch.data()), patch.size(), in GenerateTarget() 88 [&](const unsigned char* data, size_t len) { in GenerateTarget() argument 89 patched->append(reinterpret_cast<const char*>(data), len); in GenerateTarget() 131 ASSERT_EQ(0, imgdiff(args.size(), args.data())); in TEST() [all …]
|
D | bootloader_message_test.cpp | 129 ASSERT_TRUE(WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), 0, &err)); in TEST() 133 ASSERT_TRUE(ReadMiscPartitionVendorSpace(message.data(), message.size(), 0, &err)); in TEST() 138 ASSERT_TRUE(ReadMiscPartitionVendorSpace(message.data(), message.size(), 0, &err)); in TEST() 145 WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), start_offset, &err)); in TEST() 148 ASSERT_FALSE(WriteMiscPartitionVendorSpace(kTestMessage.data(), kTestMessage.size(), in TEST() 153 ASSERT_FALSE(WriteMiscPartitionVendorSpace(long_message.data(), long_message.size(), 0, &err)); in TEST()
|
D | updater_test.cpp | 96 ASSERT_EQ(0, zip_writer.WriteBytes(entry.second.data(), entry.second.size())); in BuildUpdatePackage() 139 SHA1(reinterpret_cast<const uint8_t*>(content.data()), content.size(), digest); in GetSha1() 329 std::string data; in TEST_F() local 330 ASSERT_TRUE(android::base::ReadFileToString(temp_file1.path, &data)); in TEST_F() 331 ASSERT_EQ(kATxtContents, data); in TEST_F() 337 ASSERT_TRUE(android::base::ReadFileToString(temp_file1.path, &data)); in TEST_F() 338 ASSERT_EQ(kBTxtContents, data); in TEST_F() 385 std::string data; in TEST_F() local 387 data += std::string(4096, i); in TEST_F() 390 data += std::string(4096, 0); in TEST_F() [all …]
|
/bootable/recovery/minui/ |
D | resources.cpp | 62 memcpy(result->data(), data(), data_size_); in Clone() 208 png_read_row(png_ptr, p_row.data(), nullptr); in res_create_display_surface() 209 TransformRgbToDraw(p_row.data(), surface->data() + y * surface->row_bytes, in res_create_display_surface() 280 png_read_row(png_ptr, p_row.data(), nullptr); in res_create_multi_display_surface() 282 uint8_t* out_row = surface[frame]->data() + (y / *frames) * surface[frame]->row_bytes; in res_create_multi_display_surface() 283 TransformRgbToDraw(p_row.data(), out_row, png_handler.channels(), width); in res_create_multi_display_surface() 325 uint8_t* p_row = surface->data() + y * surface->row_bytes; in res_create_alpha_surface() 376 png_read_row(png_handler.png_ptr(), row.data(), nullptr); in get_locales_in_png() 383 png_read_row(png_handler.png_ptr(), row.data(), nullptr); in get_locales_in_png() 411 png_read_row(png_ptr, row.data(), nullptr); in res_create_localized_alpha_surface() [all …]
|
D | graphics.cpp | 127 return reinterpret_cast<uint32_t*>(surface->data()) + y * row_pixels + x; in PixelAt() 129 return reinterpret_cast<uint32_t*>(surface->data()) + x * row_pixels + (surface->width - y); in PixelAt() 131 return reinterpret_cast<uint32_t*>(surface->data()) + (surface->height - 1 - y) * row_pixels + in PixelAt() 134 return reinterpret_cast<uint32_t*>(surface->data()) + (surface->height - 1 - x) * row_pixels + in PixelAt() 180 const uint8_t* src_p = font->texture->data() + ((ch - ' ') * font->char_width) + in gr_text() 205 const uint8_t* src_p = icon->data(); in gr_texticon() 224 memset(gr_draw->data(), gr_current & 0xff, gr_draw->height * gr_draw->row_bytes); in gr_clear() 226 uint32_t* px = reinterpret_cast<uint32_t*>(gr_draw->data()); in gr_clear() 278 reinterpret_cast<const uint32_t*>(source->data()) + sy * source->row_bytes / 4 + sx; in gr_blit() 292 const uint8_t* src_p = source->data() + sy * source->row_bytes + sx * source->pixel_bytes; in gr_blit() [all …]
|
/bootable/recovery/ |
D | recovery-persist.rc | 1 on post-fs-data 2 mkdir /data/misc/recovery 0770 system log
|
D | README.md | 21 adb sync data 24 adb shell /data/nativetest/recovery_unit_test/recovery_unit_test 25 adb shell /data/nativetest/recovery_component_test/recovery_component_test 28 adb shell /data/nativetest64/recovery_unit_test/recovery_unit_test 29 adb shell /data/nativetest64/recovery_component_test/recovery_component_test 41 contents of pmsg buffer into /data/misc/recovery/inject.txt. Test will pass if 109 (because such authorization data stays in /data, which recovery doesn't mount), nor does it support
|
/bootable/recovery/minui/include/minui/ |
D | minui.h | 51 virtual uint8_t* data() { in data() function 55 const uint8_t* data() const { in data() function 56 return const_cast<const uint8_t*>(const_cast<GRSurface*>(this)->data()); in data() 75 void operator()(uint8_t* data) { in operator() 76 free(data); in operator()
|
/bootable/recovery/updater_sample/src/com/example/android/systemupdatersample/util/ |
D | FileDownloader.java | 73 byte[] data = new byte[4096]; in download() 77 int count = input.read(data, 0, needToRead); in download() 81 output.write(data, 0, count); in download()
|
/bootable/recovery/updater/ |
D | blockimg.cpp | 248 size_t Write(const uint8_t* data, size_t size) { in Write() argument 266 if (!android::base::WriteFully(fd_, data, write_now)) { in Write() 272 data += write_now; in Write() 357 static bool receive_new_data(const uint8_t* data, size_t size, void* cookie) { in receive_new_data() argument 376 if (nti->writer->Write(data, write_now) != write_now) { in receive_new_data() 381 data += write_now; in receive_new_data() 397 static bool receive_brotli_new_data(const uint8_t* data, size_t size, void* cookie) { in receive_brotli_new_data() argument 428 nti->brotli_decoder_state, &available_in, &data, &available_out, &next_out, nullptr); in receive_brotli_new_data() 485 if (!android::base::ReadFully(fd, buffer->data() + p, size)) { in ReadBlocks() 510 if (!android::base::WriteFully(fd, buffer.data() + written, size)) { in WriteBlocks() [all …]
|
/bootable/recovery/otautil/ |
D | logging.cpp | 165 buf.data(), buf.size()); in __pmsg_write() 284 std::string data(read_size, '\0'); in ReadLogFilesToMemory() local 287 if (log_fd == -1 || !android::base::ReadFully(log_fd, data.data(), read_size)) { in ReadLogFilesToMemory() 292 log_files.emplace_back(saved_log_file{ path, sb, data }); in ReadLogFilesToMemory() 312 if (!android::base::WriteStringToFile(log.data, log.name, log.sb.st_mode, log.sb.st_uid, in RestoreLogFilesAfterFormat()
|
/bootable/recovery/bootloader_message/ |
D | bootloader_message.cpp | 238 return write_misc_partition(package_data.data(), package_data.size(), misc_blk_device, in write_wipe_package() 247 bool ReadMiscPartitionVendorSpace(void* data, size_t size, size_t offset, std::string* err) { in ReadMiscPartitionVendorSpace() argument 256 return read_misc_partition(data, size, misc_blk_device, VENDOR_SPACE_OFFSET_IN_MISC + offset, in ReadMiscPartitionVendorSpace() 260 bool WriteMiscPartitionVendorSpace(const void* data, size_t size, size_t offset, std::string* err) { in WriteMiscPartitionVendorSpace() argument 269 return write_misc_partition(data, size, misc_blk_device, VENDOR_SPACE_OFFSET_IN_MISC + offset, in WriteMiscPartitionVendorSpace()
|