summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/recovery_l10n/res/values/strings.xml4
-rw-r--r--uncrypt/uncrypt.cpp36
2 files changed, 6 insertions, 34 deletions
diff --git a/tools/recovery_l10n/res/values/strings.xml b/tools/recovery_l10n/res/values/strings.xml
index 3a8aeec9c..f6193ab17 100644
--- a/tools/recovery_l10n/res/values/strings.xml
+++ b/tools/recovery_l10n/res/values/strings.xml
@@ -31,4 +31,8 @@
LIMIT=60] -->
<string name="recovery_error">Error!</string>
+ <!-- Displayed on the screen beneath the animation while the
+ system is installing a security update. [CHAR LIMIT=60] -->
+ <string name="recovery_installing_security">Installing security update\u2026</string>
+
</resources>
diff --git a/uncrypt/uncrypt.cpp b/uncrypt/uncrypt.cpp
index e783b9e7a..2ef093579 100644
--- a/uncrypt/uncrypt.cpp
+++ b/uncrypt/uncrypt.cpp
@@ -372,7 +372,7 @@ static int produce_block_map(const char* path, const char* map_file, const char*
ALOGE("failed to fsync \"%s\": %s", tmp_map_file.c_str(), strerror(errno));
return -1;
}
- if (close(mapfd.get() == -1)) {
+ if (close(mapfd.get()) == -1) {
ALOGE("failed to close %s: %s", tmp_map_file.c_str(), strerror(errno));
return -1;
}
@@ -406,7 +406,7 @@ static int produce_block_map(const char* path, const char* map_file, const char*
ALOGE("failed to fsync %s: %s", dir_name.c_str(), strerror(errno));
return -1;
}
- if (close(dfd.get() == -1)) {
+ if (close(dfd.get()) == -1) {
ALOGE("failed to close %s: %s", dir_name.c_str(), strerror(errno));
return -1;
}
@@ -425,24 +425,6 @@ static std::string get_misc_blk_device() {
return "";
}
-static int read_bootloader_message(bootloader_message* out) {
- std::string misc_blk_device = get_misc_blk_device();
- if (misc_blk_device.empty()) {
- ALOGE("failed to find /misc partition.");
- return -1;
- }
- unique_fd fd(open(misc_blk_device.c_str(), O_RDONLY));
- if (!fd) {
- ALOGE("failed to open %s: %s", misc_blk_device.c_str(), strerror(errno));
- return -1;
- }
- if (!android::base::ReadFully(fd.get(), out, sizeof(*out))) {
- ALOGE("failed to read %s: %s", misc_blk_device.c_str(), strerror(errno));
- return -1;
- }
- return 0;
-}
-
static int write_bootloader_message(const bootloader_message* in) {
std::string misc_blk_device = get_misc_blk_device();
if (misc_blk_device.empty()) {
@@ -570,23 +552,11 @@ static bool setup_bcb(const int socket) {
return true;
}
-static int read_bcb() {
- bootloader_message boot;
- if (read_bootloader_message(&boot) != 0) {
- ALOGE("failed to get bootloader message");
- return 1;
- }
- printf("bcb command: %s\n", boot.command);
- printf("bcb recovery:\n%s\n", boot.recovery);
- return 0;
-}
-
static void usage(const char* exename) {
fprintf(stderr, "Usage of %s:\n", exename);
fprintf(stderr, "%s [<package_path> <map_file>] Uncrypt ota package.\n", exename);
fprintf(stderr, "%s --clear-bcb Clear BCB data in misc partition.\n", exename);
fprintf(stderr, "%s --setup-bcb Setup BCB data by command file.\n", exename);
- fprintf(stderr, "%s --read-bcb Read BCB data from misc partition.\n", exename);
}
int main(int argc, char** argv) {
@@ -598,8 +568,6 @@ int main(int argc, char** argv) {
action = CLEAR_BCB;
} else if (argc == 2 && strcmp(argv[1], "--setup-bcb") == 0) {
action = SETUP_BCB;
- } else if (argc ==2 && strcmp(argv[1], "--read-bcb") == 0) {
- return read_bcb();
} else if (argc == 1) {
action = UNCRYPT;
} else if (argc == 3) {