From 9a259772ccf1e9708baecc559323ac5b6229e954 Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Thu, 28 Jul 2016 14:15:00 -0700 Subject: Add docs on regeneration background text image Also add a missing string in the recovery_l10n APP. Bug: 30415666 Change-Id: Ice2a9f7cad4ebe332b427bc0c7a9adccb6cf3af3 --- minui/minui.h | 4 +-- tools/recovery_l10n/README.md | 31 ++++++++++++++++++++++ tools/recovery_l10n/res/values/strings.xml | 1 + .../src/com/android/recovery_l10n/Main.java | 1 + 4 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 tools/recovery_l10n/README.md diff --git a/minui/minui.h b/minui/minui.h index b2648fb33..d572205f3 100644 --- a/minui/minui.h +++ b/minui/minui.h @@ -111,8 +111,8 @@ int res_create_alpha_surface(const char* name, GRSurface** pSurface); // given locale. The image is expected to be a composite of multiple // translations of the same text, with special added rows that encode // the subimages' size and intended locale in the pixel data. See -// development/tools/recovery_l10n for an app that will generate these -// specialized images from Android resources. +// bootable/recovery/tools/recovery_l10n for an app that will generate +// these specialized images from Android resources. int res_create_localized_alpha_surface(const char* name, const char* locale, GRSurface** pSurface); diff --git a/tools/recovery_l10n/README.md b/tools/recovery_l10n/README.md new file mode 100644 index 000000000..bf41ff241 --- /dev/null +++ b/tools/recovery_l10n/README.md @@ -0,0 +1,31 @@ +# Steps to regenerate background text images under res-*dpi/images/ + +1. Build the recovery_l10n app: + + cd bootable/recovery && mma -j32 + +2. Install the app on the device (or emulator) with the intended dpi. + + * For example, we can use Nexus 5 to generate the text images under + res-xxhdpi. + * When using the emulator, make sure the NDK version matches the current + repository. Otherwise, the app may not work properly. + + adb install $PATH_TO_APP + +3. Run the app, select the string to translate and press the 'go' button. + +4. After the app goes through the strings for all locales, pull the output png + file from the device. + + adb root && adb pull /data/data/com.android.recovery_l10n/files/text-out.png + +5. Compress the output file put it under the corresponding directory. + + * "pngcrush -c 0 ..." converts "text-out.png" into a 1-channel image, + which is accepted by Recovery. This also compresses the image file by + ~60%. + * If you're using other png compression tools, make sure the final text + image works by running graphic tests under the recovery mode. + + pngcrush -c 0 text-out.png $OUTPUT_PNG diff --git a/tools/recovery_l10n/res/values/strings.xml b/tools/recovery_l10n/res/values/strings.xml index f6193ab17..48d18daca 100644 --- a/tools/recovery_l10n/res/values/strings.xml +++ b/tools/recovery_l10n/res/values/strings.xml @@ -9,6 +9,7 @@ erasing no_command error + installing_security