Write in front:
Localized text display from Recovery mode we learned that recovery is supported to restore factory settings (is clearly ... ) and install the upgrade package (installing system updates ...) Localized text displays, in addition to these two recovery also support "no command." "and" went wrong! The two text implementations are localized to display as follows:
Figure 1:
Figure 2:
Figure 3:
Figure 4:
And through the description of the previous blog post we understand that these four kinds of text localization display is to synthesize the text of various languages in the same picture, in general, these four images are provided by the platform by default, we do not customize it, but Google provides us with the four text is not supported in all languages , even if all languages are supported, how do we do it if we need to make changes to these four types of text?
In the official documentation of the Android 5.x OTA update (recovery UI), we mentioned that Google has provided us with Recovery_ in the development/tools/directory of the source code. 110 tools to help us modify and customize these images that can be localized.
How do we use the tool when we get the source code?
The first step: Compile and build the app, and then install the generated app in a product that we need to support localization so that the synthesized picture is fully matched to all the languages supported by the main system in the device.
Step Two: Click the "Go" button.
Step three: When the composition operation is complete, use ADB pull/data/data/com.android.recovery_l10n/files/text-out.png to export the synthesized picture from the device.
Fourth step: Use "Pngcrush-c 0 text-out.png output.png" command to process the PNG image (in Linux environment, need to install the Pngcrush tool), PNG images processed by Pngcrush images are much faster than normal PNG images.
Fifth step: Then rename output.png to the file name we need and place it in the bootable/recovery/res/images/directory.
This will take effect if you recompile the recoveryimage.
So if we want to modify the strings in a locale, we can modify the resources of the corresponding directory directly under the Res directory in the recovery_l10n directory, for example.
For example, in the Simplified Chinese environment, we will be "cleaning ..." modified to "in the purge ..." How to do?
First we need to find the corresponding country code resources, here is Values-zh-rcn/strings.xml, as follows:
<?xml version= "1.0" encoding= "UTF-8"? ><resources xmlns:android= "http://schemas.android.com/apk/res/ Android " xmlns:xliff=" urn:oasis:names:tc:xliff:document:1.2 "> <string name=" Recovery_installing " Msgid= "7864047928003865598" > "Installing system Updates ..." </string> <string name= "recovery_erasing" msgid= " 4612809744968710197 ">" is clearing ... "</string> <string name=" Recovery_no_command "msgid=" 1915703879031023455 ">" no command. "</string> <string name=" Recovery_error "msgid=" 4550265746256727080 ">" Error! "</string></resources>
Modify the "Purging ..." button above directly to "purging ...". Of course if we want to add a new supported language, we just recreate a resource directory in the format res/values-country code.
I will have compiled a good tool and the source code to share with you, if you are relative tools to modify, you can try it yourself!
recovery_l10n
Implement recovery mode localization display text customization (use of recovery_l10n tools)