diff options
-rw-r--r-- | Android.mk | 4 | ||||
-rw-r--r-- | install.cpp | 134 | ||||
-rw-r--r-- | recovery.cpp | 26 | ||||
-rw-r--r-- | res-hdpi/images/erasing_text.png | bin | 50373 -> 50680 bytes | |||
-rw-r--r-- | res-hdpi/images/error_text.png | bin | 35720 -> 36036 bytes | |||
-rw-r--r-- | res-hdpi/images/installing_security_text.png | bin | 111582 -> 113819 bytes | |||
-rw-r--r-- | res-hdpi/images/installing_text.png | bin | 102734 -> 104768 bytes | |||
-rw-r--r-- | res-hdpi/images/no_command_text.png | bin | 61665 -> 62037 bytes | |||
-rw-r--r-- | res-mdpi/images/erasing_text.png | bin | 29558 -> 29898 bytes | |||
-rw-r--r-- | res-mdpi/images/error_text.png | bin | 20926 -> 21147 bytes | |||
-rw-r--r-- | res-mdpi/images/installing_security_text.png | bin | 69709 -> 70010 bytes | |||
-rw-r--r-- | res-mdpi/images/installing_text.png | bin | 61548 -> 61701 bytes | |||
-rw-r--r-- | res-mdpi/images/no_command_text.png | bin | 34232 -> 34683 bytes | |||
-rw-r--r-- | res-xhdpi/images/erasing_text.png | bin | 72595 -> 73361 bytes | |||
-rw-r--r-- | res-xhdpi/images/error_text.png | bin | 51739 -> 52019 bytes | |||
-rw-r--r-- | res-xhdpi/images/installing_security_text.png | bin | 195507 -> 196871 bytes | |||
-rw-r--r-- | res-xhdpi/images/installing_text.png | bin | 174877 -> 175570 bytes | |||
-rw-r--r-- | res-xhdpi/images/no_command_text.png | bin | 85999 -> 86622 bytes | |||
-rw-r--r-- | res-xxhdpi/images/erasing_text.png | bin | 119060 -> 121386 bytes | |||
-rw-r--r-- | res-xxhdpi/images/error_text.png | bin | 84432 -> 85555 bytes | |||
-rw-r--r-- | res-xxhdpi/images/installing_security_text.png | bin | 447442 -> 387979 bytes | |||
-rw-r--r-- | res-xxhdpi/images/installing_text.png | bin | 416541 -> 355503 bytes | |||
-rw-r--r-- | res-xxhdpi/images/no_command_text.png | bin | 243828 -> 148704 bytes | |||
-rw-r--r-- | res-xxxhdpi/images/erasing_text.png | bin | 264753 -> 257605 bytes | |||
-rw-r--r-- | res-xxxhdpi/images/error_text.png | bin | 178491 -> 173381 bytes | |||
-rw-r--r-- | res-xxxhdpi/images/installing_security_text.png | bin | 611664 -> 620933 bytes | |||
-rw-r--r-- | res-xxxhdpi/images/installing_text.png | bin | 569291 -> 581822 bytes | |||
-rw-r--r-- | res-xxxhdpi/images/no_command_text.png | bin | 333053 -> 322613 bytes | |||
-rw-r--r-- | tests/Android.mk | 4 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-az/strings.xml (renamed from tools/recovery_l10n/res/values-az-rAZ/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-be/strings.xml (renamed from tools/recovery_l10n/res/values-be-rBY/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-bn/strings.xml (renamed from tools/recovery_l10n/res/values-bn-rBD/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-bs/strings.xml (renamed from tools/recovery_l10n/res/values-bs-rBA/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-et/strings.xml (renamed from tools/recovery_l10n/res/values-et-rEE/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-eu/strings.xml (renamed from tools/recovery_l10n/res/values-eu-rES/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-gl/strings.xml (renamed from tools/recovery_l10n/res/values-gl-rES/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-gu/strings.xml (renamed from tools/recovery_l10n/res/values-gu-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-hy/strings.xml (renamed from tools/recovery_l10n/res/values-hy-rAM/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-is/strings.xml (renamed from tools/recovery_l10n/res/values-is-rIS/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ka/strings.xml (renamed from tools/recovery_l10n/res/values-ka-rGE/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-kk/strings.xml (renamed from tools/recovery_l10n/res/values-kk-rKZ/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-km/strings.xml (renamed from tools/recovery_l10n/res/values-km-rKH/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-kn/strings.xml (renamed from tools/recovery_l10n/res/values-kn-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ky/strings.xml (renamed from tools/recovery_l10n/res/values-ky-rKG/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-lo/strings.xml (renamed from tools/recovery_l10n/res/values-lo-rLA/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-mk/strings.xml (renamed from tools/recovery_l10n/res/values-mk-rMK/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ml/strings.xml (renamed from tools/recovery_l10n/res/values-ml-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-mn/strings.xml (renamed from tools/recovery_l10n/res/values-mn-rMN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-mr/strings.xml (renamed from tools/recovery_l10n/res/values-mr-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ms/strings.xml (renamed from tools/recovery_l10n/res/values-ms-rMY/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-my/strings.xml (renamed from tools/recovery_l10n/res/values-my-rMM/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ne/strings.xml (renamed from tools/recovery_l10n/res/values-ne-rNP/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-pa/strings.xml (renamed from tools/recovery_l10n/res/values-pa-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-si/strings.xml (renamed from tools/recovery_l10n/res/values-si-rLK/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-sq/strings.xml (renamed from tools/recovery_l10n/res/values-sq-rAL/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ta/strings.xml (renamed from tools/recovery_l10n/res/values-ta-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-te/strings.xml (renamed from tools/recovery_l10n/res/values-te-rIN/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-ur/strings.xml (renamed from tools/recovery_l10n/res/values-ur-rPK/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/res/values-uz/strings.xml (renamed from tools/recovery_l10n/res/values-uz-rUZ/strings.xml) | 0 | ||||
-rw-r--r-- | tools/recovery_l10n/src/com/android/recovery_l10n/Main.java | 22 | ||||
-rw-r--r-- | updater/Android.mk | 4 |
61 files changed, 104 insertions, 90 deletions
diff --git a/Android.mk b/Android.mk index 2943f016b..633f18d77 100644 --- a/Android.mk +++ b/Android.mk @@ -76,8 +76,8 @@ LOCAL_C_INCLUDES += \ LOCAL_STATIC_LIBRARIES := \ libbatterymonitor \ libbootloader_message \ - libext4_utils_static \ - libsparse_static \ + libext4_utils \ + libsparse \ libziparchive \ libotautil \ libmounts \ diff --git a/install.cpp b/install.cpp index a35102610..9bb1216cf 100644 --- a/install.cpp +++ b/install.cpp @@ -36,9 +36,9 @@ #include <android-base/logging.h> #include <android-base/parsedouble.h> #include <android-base/parseint.h> +#include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/strings.h> -#include <cutils/properties.h> #include <ziparchive/zip_archive.h> #include "common.h" @@ -139,81 +139,79 @@ update_binary_command(const char* path, ZipArchiveHandle zip, int retry_count, // Parses the metadata of the OTA package in |zip| and checks whether we are // allowed to accept this A/B package. Downgrading is not allowed unless // explicitly enabled in the package and only for incremental packages. -static int check_newer_ab_build(ZipArchiveHandle zip) -{ - std::string metadata_str; - if (!read_metadata_from_package(zip, &metadata_str)) { - return INSTALL_CORRUPT; - } - std::map<std::string, std::string> metadata; - for (const std::string& line : android::base::Split(metadata_str, "\n")) { - size_t eq = line.find('='); - if (eq != std::string::npos) { - metadata[line.substr(0, eq)] = line.substr(eq + 1); - } +static int check_newer_ab_build(ZipArchiveHandle zip) { + std::string metadata_str; + if (!read_metadata_from_package(zip, &metadata_str)) { + return INSTALL_CORRUPT; + } + std::map<std::string, std::string> metadata; + for (const std::string& line : android::base::Split(metadata_str, "\n")) { + size_t eq = line.find('='); + if (eq != std::string::npos) { + metadata[line.substr(0, eq)] = line.substr(eq + 1); } - char value[PROPERTY_VALUE_MAX]; + } - property_get("ro.product.device", value, ""); - const std::string& pkg_device = metadata["pre-device"]; - if (pkg_device != value || pkg_device.empty()) { - LOG(ERROR) << "Package is for product " << pkg_device << " but expected " << value; - return INSTALL_ERROR; - } + std::string value = android::base::GetProperty("ro.product.device", ""); + const std::string& pkg_device = metadata["pre-device"]; + if (pkg_device != value || pkg_device.empty()) { + LOG(ERROR) << "Package is for product " << pkg_device << " but expected " << value; + return INSTALL_ERROR; + } - // We allow the package to not have any serialno, but if it has a non-empty - // value it should match. - property_get("ro.serialno", value, ""); - const std::string& pkg_serial_no = metadata["serialno"]; - if (!pkg_serial_no.empty() && pkg_serial_no != value) { - LOG(ERROR) << "Package is for serial " << pkg_serial_no; - return INSTALL_ERROR; - } + // We allow the package to not have any serialno, but if it has a non-empty + // value it should match. + value = android::base::GetProperty("ro.serialno", ""); + const std::string& pkg_serial_no = metadata["serialno"]; + if (!pkg_serial_no.empty() && pkg_serial_no != value) { + LOG(ERROR) << "Package is for serial " << pkg_serial_no; + return INSTALL_ERROR; + } - if (metadata["ota-type"] != "AB") { - LOG(ERROR) << "Package is not A/B"; - return INSTALL_ERROR; - } + if (metadata["ota-type"] != "AB") { + LOG(ERROR) << "Package is not A/B"; + return INSTALL_ERROR; + } - // Incremental updates should match the current build. - property_get("ro.build.version.incremental", value, ""); - const std::string& pkg_pre_build = metadata["pre-build-incremental"]; - if (!pkg_pre_build.empty() && pkg_pre_build != value) { - LOG(ERROR) << "Package is for source build " << pkg_pre_build << " but expected " << value; - return INSTALL_ERROR; - } - property_get("ro.build.fingerprint", value, ""); - const std::string& pkg_pre_build_fingerprint = metadata["pre-build"]; - if (!pkg_pre_build_fingerprint.empty() && - pkg_pre_build_fingerprint != value) { - LOG(ERROR) << "Package is for source build " << pkg_pre_build_fingerprint - << " but expected " << value; - return INSTALL_ERROR; - } + // Incremental updates should match the current build. + value = android::base::GetProperty("ro.build.version.incremental", ""); + const std::string& pkg_pre_build = metadata["pre-build-incremental"]; + if (!pkg_pre_build.empty() && pkg_pre_build != value) { + LOG(ERROR) << "Package is for source build " << pkg_pre_build << " but expected " << value; + return INSTALL_ERROR; + } - // Check for downgrade version. - int64_t build_timestamp = property_get_int64( - "ro.build.date.utc", std::numeric_limits<int64_t>::max()); - int64_t pkg_post_timestamp = 0; - // We allow to full update to the same version we are running, in case there - // is a problem with the current copy of that version. - if (metadata["post-timestamp"].empty() || - !android::base::ParseInt(metadata["post-timestamp"].c_str(), - &pkg_post_timestamp) || - pkg_post_timestamp < build_timestamp) { - if (metadata["ota-downgrade"] != "yes") { - LOG(ERROR) << "Update package is older than the current build, expected a build " - "newer than timestamp " << build_timestamp << " but package has " - "timestamp " << pkg_post_timestamp << " and downgrade not allowed."; - return INSTALL_ERROR; - } - if (pkg_pre_build_fingerprint.empty()) { - LOG(ERROR) << "Downgrade package must have a pre-build version set, not allowed."; - return INSTALL_ERROR; - } + value = android::base::GetProperty("ro.build.fingerprint", ""); + const std::string& pkg_pre_build_fingerprint = metadata["pre-build"]; + if (!pkg_pre_build_fingerprint.empty() && pkg_pre_build_fingerprint != value) { + LOG(ERROR) << "Package is for source build " << pkg_pre_build_fingerprint << " but expected " + << value; + return INSTALL_ERROR; + } + + // Check for downgrade version. + int64_t build_timestamp = + android::base::GetIntProperty("ro.build.date.utc", std::numeric_limits<int64_t>::max()); + int64_t pkg_post_timestamp = 0; + // We allow to full update to the same version we are running, in case there + // is a problem with the current copy of that version. + if (metadata["post-timestamp"].empty() || + !android::base::ParseInt(metadata["post-timestamp"].c_str(), &pkg_post_timestamp) || + pkg_post_timestamp < build_timestamp) { + if (metadata["ota-downgrade"] != "yes") { + LOG(ERROR) << "Update package is older than the current build, expected a build " + "newer than timestamp " + << build_timestamp << " but package has timestamp " << pkg_post_timestamp + << " and downgrade not allowed."; + return INSTALL_ERROR; + } + if (pkg_pre_build_fingerprint.empty()) { + LOG(ERROR) << "Downgrade package must have a pre-build version set, not allowed."; + return INSTALL_ERROR; } + } - return 0; + return 0; } static int diff --git a/recovery.cpp b/recovery.cpp index fac241d63..25d3546e3 100644 --- a/recovery.cpp +++ b/recovery.cpp @@ -892,8 +892,8 @@ static bool check_wipe_package(size_t wipe_package_size) { // Extract metadata ZipArchiveHandle zip; - int err = OpenArchiveFromMemory(reinterpret_cast<void*>(&wipe_package[0]), - wipe_package.size(), "wipe_package", &zip); + int err = OpenArchiveFromMemory(static_cast<void*>(&wipe_package[0]), wipe_package.size(), + "wipe_package", &zip); if (err != 0) { LOG(ERROR) << "Can't open wipe package : " << ErrorCodeString(err); return false; @@ -916,13 +916,11 @@ static bool check_wipe_package(size_t wipe_package_size) { ota_type_matched = true; } else if (android::base::StartsWith(line, "pre-device=")) { std::string device_type = line.substr(strlen("pre-device=")); - char real_device_type[PROPERTY_VALUE_MAX]; - property_get("ro.build.product", real_device_type, ""); + std::string real_device_type = android::base::GetProperty("ro.build.product", ""); device_type_matched = (device_type == real_device_type); } else if (android::base::StartsWith(line, "serialno=")) { std::string serial_no = line.substr(strlen("serialno=")); - char real_serial_no[PROPERTY_VALUE_MAX]; - property_get("ro.serialno", real_serial_no, ""); + std::string real_serial_no = android::base::GetProperty("ro.serialno", ""); has_serial_number = true; serial_number_matched = (serial_no == real_serial_no); } @@ -1361,15 +1359,15 @@ static void set_retry_bootloader_message(int retry_count, int argc, char** argv) } static bool bootreason_in_blacklist() { - char bootreason[PROPERTY_VALUE_MAX]; - if (property_get("ro.boot.bootreason", bootreason, nullptr) > 0) { - for (const auto& str : bootreason_blacklist) { - if (strcasecmp(str.c_str(), bootreason) == 0) { - return true; - } - } + std::string bootreason = android::base::GetProperty("ro.boot.bootreason", ""); + if (!bootreason.empty()) { + for (const auto& str : bootreason_blacklist) { + if (strcasecmp(str.c_str(), bootreason.c_str()) == 0) { + return true; + } } - return false; + } + return false; } static void log_failure_code(ErrorCode code, const char *update_package) { diff --git a/res-hdpi/images/erasing_text.png b/res-hdpi/images/erasing_text.png Binary files differindex 2186c1950..684fc7c6c 100644 --- a/res-hdpi/images/erasing_text.png +++ b/res-hdpi/images/erasing_text.png diff --git a/res-hdpi/images/error_text.png b/res-hdpi/images/error_text.png Binary files differindex 9700f459f..00c485d70 100644 --- a/res-hdpi/images/error_text.png +++ b/res-hdpi/images/error_text.png diff --git a/res-hdpi/images/installing_security_text.png b/res-hdpi/images/installing_security_text.png Binary files differindex 0f605952c..dadcfc32b 100644 --- a/res-hdpi/images/installing_security_text.png +++ b/res-hdpi/images/installing_security_text.png diff --git a/res-hdpi/images/installing_text.png b/res-hdpi/images/installing_text.png Binary files differindex ec8b875a5..abe73b4b9 100644 --- a/res-hdpi/images/installing_text.png +++ b/res-hdpi/images/installing_text.png diff --git a/res-hdpi/images/no_command_text.png b/res-hdpi/images/no_command_text.png Binary files differindex 3eddcbbed..958e10613 100644 --- a/res-hdpi/images/no_command_text.png +++ b/res-hdpi/images/no_command_text.png diff --git a/res-mdpi/images/erasing_text.png b/res-mdpi/images/erasing_text.png Binary files differindex b0dd3c6d3..10e317829 100644 --- a/res-mdpi/images/erasing_text.png +++ b/res-mdpi/images/erasing_text.png diff --git a/res-mdpi/images/error_text.png b/res-mdpi/images/error_text.png Binary files differindex 6a47a5956..0022d10c1 100644 --- a/res-mdpi/images/error_text.png +++ b/res-mdpi/images/error_text.png diff --git a/res-mdpi/images/installing_security_text.png b/res-mdpi/images/installing_security_text.png Binary files differindex 149939862..7a4cd414b 100644 --- a/res-mdpi/images/installing_security_text.png +++ b/res-mdpi/images/installing_security_text.png diff --git a/res-mdpi/images/installing_text.png b/res-mdpi/images/installing_text.png Binary files differindex 01e9bfefb..ee95e569c 100644 --- a/res-mdpi/images/installing_text.png +++ b/res-mdpi/images/installing_text.png diff --git a/res-mdpi/images/no_command_text.png b/res-mdpi/images/no_command_text.png Binary files differindex d340df518..af7660908 100644 --- a/res-mdpi/images/no_command_text.png +++ b/res-mdpi/images/no_command_text.png diff --git a/res-xhdpi/images/erasing_text.png b/res-xhdpi/images/erasing_text.png Binary files differindex 2f8b46918..91cc35871 100644 --- a/res-xhdpi/images/erasing_text.png +++ b/res-xhdpi/images/erasing_text.png diff --git a/res-xhdpi/images/error_text.png b/res-xhdpi/images/error_text.png Binary files differindex ad18851c5..772b139e6 100644 --- a/res-xhdpi/images/error_text.png +++ b/res-xhdpi/images/error_text.png diff --git a/res-xhdpi/images/installing_security_text.png b/res-xhdpi/images/installing_security_text.png Binary files differindex acc6a7c2b..a7113a04a 100644 --- a/res-xhdpi/images/installing_security_text.png +++ b/res-xhdpi/images/installing_security_text.png diff --git a/res-xhdpi/images/installing_text.png b/res-xhdpi/images/installing_text.png Binary files differindex 32897d0f0..566eb0658 100644 --- a/res-xhdpi/images/installing_text.png +++ b/res-xhdpi/images/installing_text.png diff --git a/res-xhdpi/images/no_command_text.png b/res-xhdpi/images/no_command_text.png Binary files differindex eb43c59c5..b8da125cb 100644 --- a/res-xhdpi/images/no_command_text.png +++ b/res-xhdpi/images/no_command_text.png diff --git a/res-xxhdpi/images/erasing_text.png b/res-xxhdpi/images/erasing_text.png Binary files differindex 8ff2b2fcf..8e8dfc450 100644 --- a/res-xxhdpi/images/erasing_text.png +++ b/res-xxhdpi/images/erasing_text.png diff --git a/res-xxhdpi/images/error_text.png b/res-xxhdpi/images/error_text.png Binary files differindex 658d4ea56..7fd1983d5 100644 --- a/res-xxhdpi/images/error_text.png +++ b/res-xxhdpi/images/error_text.png diff --git a/res-xxhdpi/images/installing_security_text.png b/res-xxhdpi/images/installing_security_text.png Binary files differindex 23fcaa441..9779927ef 100644 --- a/res-xxhdpi/images/installing_security_text.png +++ b/res-xxhdpi/images/installing_security_text.png diff --git a/res-xxhdpi/images/installing_text.png b/res-xxhdpi/images/installing_text.png Binary files differindex fd8e58464..fa488960e 100644 --- a/res-xxhdpi/images/installing_text.png +++ b/res-xxhdpi/images/installing_text.png diff --git a/res-xxhdpi/images/no_command_text.png b/res-xxhdpi/images/no_command_text.png Binary files differindex 23932d6b7..d72a840e9 100644 --- a/res-xxhdpi/images/no_command_text.png +++ b/res-xxhdpi/images/no_command_text.png diff --git a/res-xxxhdpi/images/erasing_text.png b/res-xxxhdpi/images/erasing_text.png Binary files differindex 031529371..7c198176d 100644 --- a/res-xxxhdpi/images/erasing_text.png +++ b/res-xxxhdpi/images/erasing_text.png diff --git a/res-xxxhdpi/images/error_text.png b/res-xxxhdpi/images/error_text.png Binary files differindex dba127f02..4cd2a8cc4 100644 --- a/res-xxxhdpi/images/error_text.png +++ b/res-xxxhdpi/images/error_text.png diff --git a/res-xxxhdpi/images/installing_security_text.png b/res-xxxhdpi/images/installing_security_text.png Binary files differindex 6cdbef48e..d84c5d9a9 100644 --- a/res-xxxhdpi/images/installing_security_text.png +++ b/res-xxxhdpi/images/installing_security_text.png diff --git a/res-xxxhdpi/images/installing_text.png b/res-xxxhdpi/images/installing_text.png Binary files differindex 32511a9c5..ffe1474f9 100644 --- a/res-xxxhdpi/images/installing_text.png +++ b/res-xxxhdpi/images/installing_text.png diff --git a/res-xxxhdpi/images/no_command_text.png b/res-xxxhdpi/images/no_command_text.png Binary files differindex b6cdd7718..f4f13003b 100644 --- a/res-xxxhdpi/images/no_command_text.png +++ b/res-xxxhdpi/images/no_command_text.png diff --git a/tests/Android.mk b/tests/Android.mk index 0aca8c6c7..1203817a2 100644 --- a/tests/Android.mk +++ b/tests/Android.mk @@ -99,8 +99,8 @@ LOCAL_STATIC_LIBRARIES := \ libfs_mgr \ liblog \ libselinux \ - libext4_utils_static \ - libsparse_static \ + libext4_utils \ + libsparse \ libcrypto_utils \ libcrypto \ libcutils \ diff --git a/tools/recovery_l10n/res/values-az-rAZ/strings.xml b/tools/recovery_l10n/res/values-az/strings.xml index c6765a9ea..c6765a9ea 100644 --- a/tools/recovery_l10n/res/values-az-rAZ/strings.xml +++ b/tools/recovery_l10n/res/values-az/strings.xml diff --git a/tools/recovery_l10n/res/values-be-rBY/strings.xml b/tools/recovery_l10n/res/values-be/strings.xml index 7c0954d31..7c0954d31 100644 --- a/tools/recovery_l10n/res/values-be-rBY/strings.xml +++ b/tools/recovery_l10n/res/values-be/strings.xml diff --git a/tools/recovery_l10n/res/values-bn-rBD/strings.xml b/tools/recovery_l10n/res/values-bn/strings.xml index 0a481faf1..0a481faf1 100644 --- a/tools/recovery_l10n/res/values-bn-rBD/strings.xml +++ b/tools/recovery_l10n/res/values-bn/strings.xml diff --git a/tools/recovery_l10n/res/values-bs-rBA/strings.xml b/tools/recovery_l10n/res/values-bs/strings.xml index 412cf0276..412cf0276 100644 --- a/tools/recovery_l10n/res/values-bs-rBA/strings.xml +++ b/tools/recovery_l10n/res/values-bs/strings.xml diff --git a/tools/recovery_l10n/res/values-et-rEE/strings.xml b/tools/recovery_l10n/res/values-et/strings.xml index 072a9ef80..072a9ef80 100644 --- a/tools/recovery_l10n/res/values-et-rEE/strings.xml +++ b/tools/recovery_l10n/res/values-et/strings.xml diff --git a/tools/recovery_l10n/res/values-eu-rES/strings.xml b/tools/recovery_l10n/res/values-eu/strings.xml index 5540469d0..5540469d0 100644 --- a/tools/recovery_l10n/res/values-eu-rES/strings.xml +++ b/tools/recovery_l10n/res/values-eu/strings.xml diff --git a/tools/recovery_l10n/res/values-gl-rES/strings.xml b/tools/recovery_l10n/res/values-gl/strings.xml index 42b2016c2..42b2016c2 100644 --- a/tools/recovery_l10n/res/values-gl-rES/strings.xml +++ b/tools/recovery_l10n/res/values-gl/strings.xml diff --git a/tools/recovery_l10n/res/values-gu-rIN/strings.xml b/tools/recovery_l10n/res/values-gu/strings.xml index 2355a0f4f..2355a0f4f 100644 --- a/tools/recovery_l10n/res/values-gu-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-gu/strings.xml diff --git a/tools/recovery_l10n/res/values-hy-rAM/strings.xml b/tools/recovery_l10n/res/values-hy/strings.xml index 9d62bb763..9d62bb763 100644 --- a/tools/recovery_l10n/res/values-hy-rAM/strings.xml +++ b/tools/recovery_l10n/res/values-hy/strings.xml diff --git a/tools/recovery_l10n/res/values-is-rIS/strings.xml b/tools/recovery_l10n/res/values-is/strings.xml index 5065b6522..5065b6522 100644 --- a/tools/recovery_l10n/res/values-is-rIS/strings.xml +++ b/tools/recovery_l10n/res/values-is/strings.xml diff --git a/tools/recovery_l10n/res/values-ka-rGE/strings.xml b/tools/recovery_l10n/res/values-ka/strings.xml index 6a46b3677..6a46b3677 100644 --- a/tools/recovery_l10n/res/values-ka-rGE/strings.xml +++ b/tools/recovery_l10n/res/values-ka/strings.xml diff --git a/tools/recovery_l10n/res/values-kk-rKZ/strings.xml b/tools/recovery_l10n/res/values-kk/strings.xml index a4bd86e66..a4bd86e66 100644 --- a/tools/recovery_l10n/res/values-kk-rKZ/strings.xml +++ b/tools/recovery_l10n/res/values-kk/strings.xml diff --git a/tools/recovery_l10n/res/values-km-rKH/strings.xml b/tools/recovery_l10n/res/values-km/strings.xml index 313c0f457..313c0f457 100644 --- a/tools/recovery_l10n/res/values-km-rKH/strings.xml +++ b/tools/recovery_l10n/res/values-km/strings.xml diff --git a/tools/recovery_l10n/res/values-kn-rIN/strings.xml b/tools/recovery_l10n/res/values-kn/strings.xml index 5bf6260ee..5bf6260ee 100644 --- a/tools/recovery_l10n/res/values-kn-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-kn/strings.xml diff --git a/tools/recovery_l10n/res/values-ky-rKG/strings.xml b/tools/recovery_l10n/res/values-ky/strings.xml index 0a6bd783a..0a6bd783a 100644 --- a/tools/recovery_l10n/res/values-ky-rKG/strings.xml +++ b/tools/recovery_l10n/res/values-ky/strings.xml diff --git a/tools/recovery_l10n/res/values-lo-rLA/strings.xml b/tools/recovery_l10n/res/values-lo/strings.xml index d3dbb3970..d3dbb3970 100644 --- a/tools/recovery_l10n/res/values-lo-rLA/strings.xml +++ b/tools/recovery_l10n/res/values-lo/strings.xml diff --git a/tools/recovery_l10n/res/values-mk-rMK/strings.xml b/tools/recovery_l10n/res/values-mk/strings.xml index 351459730..351459730 100644 --- a/tools/recovery_l10n/res/values-mk-rMK/strings.xml +++ b/tools/recovery_l10n/res/values-mk/strings.xml diff --git a/tools/recovery_l10n/res/values-ml-rIN/strings.xml b/tools/recovery_l10n/res/values-ml/strings.xml index b506e2530..b506e2530 100644 --- a/tools/recovery_l10n/res/values-ml-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-ml/strings.xml diff --git a/tools/recovery_l10n/res/values-mn-rMN/strings.xml b/tools/recovery_l10n/res/values-mn/strings.xml index e3dd2e90e..e3dd2e90e 100644 --- a/tools/recovery_l10n/res/values-mn-rMN/strings.xml +++ b/tools/recovery_l10n/res/values-mn/strings.xml diff --git a/tools/recovery_l10n/res/values-mr-rIN/strings.xml b/tools/recovery_l10n/res/values-mr/strings.xml index 8cf86f773..8cf86f773 100644 --- a/tools/recovery_l10n/res/values-mr-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-mr/strings.xml diff --git a/tools/recovery_l10n/res/values-ms-rMY/strings.xml b/tools/recovery_l10n/res/values-ms/strings.xml index 0e24ac4e1..0e24ac4e1 100644 --- a/tools/recovery_l10n/res/values-ms-rMY/strings.xml +++ b/tools/recovery_l10n/res/values-ms/strings.xml diff --git a/tools/recovery_l10n/res/values-my-rMM/strings.xml b/tools/recovery_l10n/res/values-my/strings.xml index f13752461..f13752461 100644 --- a/tools/recovery_l10n/res/values-my-rMM/strings.xml +++ b/tools/recovery_l10n/res/values-my/strings.xml diff --git a/tools/recovery_l10n/res/values-ne-rNP/strings.xml b/tools/recovery_l10n/res/values-ne/strings.xml index 1880e807b..1880e807b 100644 --- a/tools/recovery_l10n/res/values-ne-rNP/strings.xml +++ b/tools/recovery_l10n/res/values-ne/strings.xml diff --git a/tools/recovery_l10n/res/values-pa-rIN/strings.xml b/tools/recovery_l10n/res/values-pa/strings.xml index 8564c9c36..8564c9c36 100644 --- a/tools/recovery_l10n/res/values-pa-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-pa/strings.xml diff --git a/tools/recovery_l10n/res/values-si-rLK/strings.xml b/tools/recovery_l10n/res/values-si/strings.xml index 456cdc567..456cdc567 100644 --- a/tools/recovery_l10n/res/values-si-rLK/strings.xml +++ b/tools/recovery_l10n/res/values-si/strings.xml diff --git a/tools/recovery_l10n/res/values-sq-rAL/strings.xml b/tools/recovery_l10n/res/values-sq/strings.xml index 1156931fb..1156931fb 100644 --- a/tools/recovery_l10n/res/values-sq-rAL/strings.xml +++ b/tools/recovery_l10n/res/values-sq/strings.xml diff --git a/tools/recovery_l10n/res/values-ta-rIN/strings.xml b/tools/recovery_l10n/res/values-ta/strings.xml index d49186d8d..d49186d8d 100644 --- a/tools/recovery_l10n/res/values-ta-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-ta/strings.xml diff --git a/tools/recovery_l10n/res/values-te-rIN/strings.xml b/tools/recovery_l10n/res/values-te/strings.xml index cfb02c915..cfb02c915 100644 --- a/tools/recovery_l10n/res/values-te-rIN/strings.xml +++ b/tools/recovery_l10n/res/values-te/strings.xml diff --git a/tools/recovery_l10n/res/values-ur-rPK/strings.xml b/tools/recovery_l10n/res/values-ur/strings.xml index 12e32fbc1..12e32fbc1 100644 --- a/tools/recovery_l10n/res/values-ur-rPK/strings.xml +++ b/tools/recovery_l10n/res/values-ur/strings.xml diff --git a/tools/recovery_l10n/res/values-uz-rUZ/strings.xml b/tools/recovery_l10n/res/values-uz/strings.xml index 2c309d646..2c309d646 100644 --- a/tools/recovery_l10n/res/values-uz-rUZ/strings.xml +++ b/tools/recovery_l10n/res/values-uz/strings.xml diff --git a/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java b/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java index ac94bde1c..30d45f6ae 100644 --- a/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java +++ b/tools/recovery_l10n/src/com/android/recovery_l10n/Main.java @@ -38,6 +38,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import java.util.Locale; @@ -148,11 +149,28 @@ public class Main extends Activity { mText = (TextView) findViewById(R.id.text); String[] localeNames = getAssets().getLocales(); - Arrays.sort(localeNames); + Arrays.sort(localeNames, new Comparator<String>() { + // Override the string comparator so that en is sorted behind en_US. + // As a result, en_US will be matched first in recovery. + @Override + public int compare(String s1, String s2) { + if (s1.equals(s2)) { + return 0; + } else if (s1.startsWith(s2)) { + return -1; + } else if (s2.startsWith(s1)) { + return 1; + } + return s1.compareTo(s2); + } + }); + ArrayList<Locale> locales = new ArrayList<Locale>(); for (String localeName : localeNames) { Log.i(TAG, "locale = " + localeName); - locales.add(Locale.forLanguageTag(localeName)); + if (!localeName.isEmpty()) { + locales.add(Locale.forLanguageTag(localeName)); + } } final Runnable seq = buildSequence(locales.toArray(new Locale[0])); diff --git a/updater/Android.mk b/updater/Android.mk index 5d328a3fa..d8a84c248 100644 --- a/updater/Android.mk +++ b/updater/Android.mk @@ -31,13 +31,13 @@ updater_common_static_libraries := \ libutils \ libmounts \ libotafault \ - libext4_utils_static \ + libext4_utils \ libfec \ libfec_rs \ libfs_mgr \ liblog \ libselinux \ - libsparse_static \ + libsparse \ libsquashfs_utils \ libbz \ libz \ |