diff --git a/fastboot/fastboot.cpp b/fastboot/fastboot.cpp index 42f985e4f..fd7b5f1d7 100644 --- a/fastboot/fastboot.cpp +++ b/fastboot/fastboot.cpp @@ -37,12 +37,11 @@ static const std::vector> kFastboo }; void FillDefaultFastbootLines(std::vector& title_lines) { - title_lines.push_back("Android Fastboot"); + title_lines.push_back("GrapheneOS Fastboot"); title_lines.push_back("Product name - " + android::base::GetProperty("ro.product.device", "")); title_lines.push_back("Bootloader version - " + android::base::GetProperty("ro.bootloader", "")); title_lines.push_back("Baseband version - " + android::base::GetProperty("ro.build.expect.baseband", "")); - title_lines.push_back("Serial number - " + android::base::GetProperty("ro.serialno", "")); title_lines.push_back(std::string("Secure boot - ") + ((android::base::GetProperty("ro.secure", "") == "1") ? "yes" : "no")); title_lines.push_back("HW version - " + android::base::GetProperty("ro.revision", "")); diff --git a/install/install.cpp b/install/install.cpp index ea9535cc0..721b4ba44 100644 --- a/install/install.cpp +++ b/install/install.cpp @@ -71,7 +71,6 @@ static constexpr int VERIFICATION_PROGRESS_TIME = 60; static constexpr float VERIFICATION_PROGRESS_FRACTION = 0.25; // The charater used to separate dynamic fingerprints. e.x. sargo|aosp-sargo static const char* FINGERPRING_SEPARATOR = "|"; -static constexpr auto&& RELEASE_KEYS_TAG = "release-keys"; // If brick packages are smaller than |MEMORY_PACKAGE_LIMIT|, read the entire package into memory static constexpr size_t MEMORY_PACKAGE_LIMIT = 1024 * 1024; @@ -232,32 +231,11 @@ bool CheckPackageMetadata(const std::map& metadata, Ot auto pkg_serial_no = get_value(metadata, "serialno"); if (!pkg_serial_no.empty()) { - auto device_serial_no = android::base::GetProperty("ro.serialno", ""); - bool serial_number_match = false; - for (const auto& number : android::base::Split(pkg_serial_no, "|")) { - if (device_serial_no == android::base::Trim(number)) { - serial_number_match = true; - } - } - if (!serial_number_match) { - LOG(ERROR) << "Package is for serial " << pkg_serial_no; - return false; - } + LOG(ERROR) << "Serial number constraint not permitted: " << pkg_serial_no; + return INSTALL_ERROR; } else if (ota_type == OtaType::BRICK) { - const auto device_build_tag = android::base::GetProperty("ro.build.tags", ""); - if (device_build_tag.empty()) { - LOG(ERROR) << "Unable to determine device build tags, serial number is missing from package. " - "Rejecting the brick OTA package."; - return false; - } - if (device_build_tag == RELEASE_KEYS_TAG) { - LOG(ERROR) << "Device is release key build, serial number is missing from package. " - "Rejecting the brick OTA package."; - return false; - } - LOG(INFO) - << "Serial number is missing from brick OTA package, permitting anyway because device is " - << device_build_tag; + LOG(ERROR) << "OtaType::BRICK is not permitted"; + return INSTALL_ERROR; } if (ota_type == OtaType::AB) { diff --git a/recovery.cpp b/recovery.cpp index b7bf629cc..8a7c3c68b 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -339,9 +339,8 @@ static void WriteUpdateInProgress() { static bool AskToReboot(Device* device, Device::BuiltinAction chosen_action) { bool is_non_ab = android::base::GetProperty("ro.boot.slot_suffix", "").empty(); - bool is_virtual_ab = android::base::GetBoolProperty("ro.virtual_ab.enabled", false); - if (!is_non_ab && !is_virtual_ab) { - // Only prompt for non-A/B or Virtual A/B devices. + if (!is_non_ab) { + // Only prompt for non-A/B devices. return true; } @@ -405,7 +404,8 @@ static Device::BuiltinAction PromptAndWait(Device* device, InstallResult status) ui->SetProgressType(RecoveryUI::EMPTY); std::vector headers; - if (update_in_progress) { + bool is_non_ab = android::base::GetProperty("ro.boot.slot_suffix", "").empty(); + if (is_non_ab && update_in_progress) { headers = { "WARNING: Previous installation has failed.", " Your device may fail to boot if you reboot or power off now." }; } @@ -737,7 +737,7 @@ Device::BuiltinAction start_recovery(Device* device, const std::vector title_lines = android::base::Split(android::base::GetProperty("ro.build.fingerprint", ""), ":"); - title_lines.insert(std::begin(title_lines), "Android Recovery"); + title_lines.insert(std::begin(title_lines), "GrapheneOS Recovery"); ui->SetTitle(title_lines); ui->ResetKeyInterruptStatus(); diff --git a/recovery_main.cpp b/recovery_main.cpp index 903a31732..b65b4a824 100644 --- a/recovery_main.cpp +++ b/recovery_main.cpp @@ -76,11 +76,10 @@ static bool IsDeviceUnlocked() { static void UiLogger(android::base::LogId log_buffer_id, android::base::LogSeverity severity, const char* tag, const char* file, unsigned int line, const char* message) { android::base::KernelLogger(log_buffer_id, severity, tag, file, line, message); - static constexpr auto&& log_characters = "VDIWEF"; if (severity >= android::base::ERROR && ui != nullptr) { ui->Print("ERROR: %10s: %s\n", tag, message); } else { - fprintf(stdout, "%c:%s\n", log_characters[severity], message); + fprintf(stdout, "%c:%s\n", android::base::kSeverityChars[severity], message); } } diff --git a/recovery_ui/device.cpp b/recovery_ui/device.cpp index d46df92d3..312d8d8e9 100644 --- a/recovery_ui/device.cpp +++ b/recovery_ui/device.cpp @@ -31,7 +31,6 @@ static std::vector> g_menu_actions { "Reboot to bootloader", Device::REBOOT_BOOTLOADER }, { "Enter fastboot", Device::ENTER_FASTBOOT }, { "Apply update from ADB", Device::APPLY_ADB_SIDELOAD }, - { "Apply update from SD card", Device::APPLY_SDCARD }, { "Wipe data/factory reset", Device::WIPE_DATA }, { "Wipe cache partition", Device::WIPE_CACHE }, { "Mount /system", Device::MOUNT_SYSTEM }, diff --git a/tools/recovery_l10n/Android.bp b/tools/recovery_l10n/Android.bp index ac08e1a5b..0040539b0 100644 --- a/tools/recovery_l10n/Android.bp +++ b/tools/recovery_l10n/Android.bp @@ -30,3 +30,9 @@ android_app { "src/**/*.java", ], } + +filegroup { + name: "bootable_recovery_resources", + srcs: ["res/**/*.xml"], + path: "res", +} diff --git a/tools/recovery_l10n/res/values-mr/strings.xml b/tools/recovery_l10n/res/values-mr/strings.xml index 9b1370794..68c1525e2 100644 --- a/tools/recovery_l10n/res/values-mr/strings.xml +++ b/tools/recovery_l10n/res/values-mr/strings.xml @@ -1,12 +1,12 @@ - "सिस्टम अपडेट इंस्टॉल करत आहे" + "सिस्टीम अपडेट इंस्टॉल करत आहे" "मिटवत आहे" "कोणतीही कमांड नाही" "एरर!" "सुरक्षा अपडेट इंस्टॉल करत आहे" - "Android सिस्टम लोड करू शकत नाही. तुमचा डेटा धोक्यात असू शकतो.तुम्हाला हा मेसेज मिळत राहिल्यास, फॅक्टरी डेटा रीसेट करणे आणि या डिव्हाइसवर स्टोअर केलेला सर्व वापरकर्ता डेटा मिटवणे आवश्यक आहे." + "Android सिस्टीम लोड करता आली नाही. तुमचा डेटा धोक्यात असू शकतो. तुम्हाला हा मेसेज मिळत राहिल्यास, फॅक्टरी डेटा रीसेट करणे आणि या डिव्हाइसवर स्टोअर केलेला सर्व वापरकर्ता डेटा मिटवणे आवश्यक आहे." "पुन्हा प्रयत्न करा" "फॅक्‍टरी डेटा रीसेट" "सर्व वापरकर्ता डेटा पुसून टाकायचा का?\n\n हे पहिल्‍यासारखे करू शकत नाही!" diff --git a/update_verifier/include/update_verifier/update_verifier.h b/update_verifier/include/update_verifier/update_verifier.h index 0cccc9075..f125508da 100644 --- a/update_verifier/include/update_verifier/update_verifier.h +++ b/update_verifier/include/update_verifier/update_verifier.h @@ -19,7 +19,6 @@ #include #include #include -#include #include #include "otautil/rangeset.h" @@ -28,10 +27,6 @@ // During the verification, it reads all the blocks in the care_map. And if a failure happens, // it rejects the current boot and triggers a fallback. -// Note that update_verifier should be backward compatible to not reject care_map.txt from old -// releases, which could otherwise fail to boot into the new release. For example, we've changed -// the care_map format between N and O. An O update_verifier would fail to work with N care_map.txt. -// This could be a result of sideloading an O OTA while the device having a pending N update. int update_verifier(int argc, char** argv); // The UpdateVerifier parses the content in the care map, and continues to verify the @@ -41,9 +36,8 @@ class UpdateVerifier { public: UpdateVerifier(); - // This function tries to process the care_map.pb as protobuf message; and falls back to use - // care_map.txt if the pb format file doesn't exist. If the parsing succeeds, put the result - // of the pair into the |partition_map_|. + // This function tries to process the care_map.pb as protobuf message. If the parsing succeeds, + // put the result of the pair into the |partition_map_|. bool ParseCareMap(); // Verifies the new boot by reading all the cared blocks for partitions in |partition_map_|. diff --git a/update_verifier/update_verifier.cpp b/update_verifier/update_verifier.cpp index a0160e2fc..03b3741e1 100644 --- a/update_verifier/update_verifier.cpp +++ b/update_verifier/update_verifier.cpp @@ -369,7 +369,7 @@ int update_verifier(int argc, char** argv) { bool supports_checkpoint = false; auto sm = android::defaultServiceManager(); - android::sp binder = sm->getService(android::String16("vold")); + android::sp binder = sm->waitForService(android::String16("vold")); if (binder) { auto vold = android::interface_cast(binder); android::binder::Status status = vold->supportsCheckpoint(&supports_checkpoint);