Essence Android Chinese Classroom Lesson 6

The original poster: Hakurei Reimu Views: 3131 Replies: 2 Posted in: 2012-03-04 23:19:32
This Chinese translation is based on the SD card cleaning tool (English version) [Attachment 1 is the English version]
This is my Chinese version of the Chinese version (you can download it and compare it)
-------------------------------- ------
Take over the fifth lesson and continue on. In fact, this fifth lesson is just a foundation. I believe everyone has used apktool to decompile and compile software. If you don't know how to do it and don't understand it, please watch the fifth lesson carefully before reading on.
-------------------------------\ Mainly by modifying the English in the string and array files in the values folder to achieve the purpose of Chineseization (ignore the assets in the picture below, they are not included in the general ones, only the special ones)

After we have decompiled, there is an [APK] folder in your decompiled directory, find the string and array of res\values
- In the res folder, we can see that there are many values-*** folders, which are language packs.
- values ​​is the English language pack, values-zh is the Chinese language pack (including Hong Kong, Macao, Taiwan and the Mainland), values-zh-rCN is the Chinese Simplified language pack (only includes the Mainland), values-zh-rTW is the Chinese Traditional language pack (Hong Kong, Macao and Taiwan). In addition, the language packs in other regions are streamlined objects, so you don't need to know too much about them.
-In the values ​​folder, there are usually arrays. xml, strings. xml and other language files. To Chineseize these files, you can open them with Notepad++ Portable (this software is in the first lesson). Let us take a look at the decompilation in the SD card cleaning tool res\values\ string For the English

in it, we only need to change the ****** content between >*****</string> into Chinese. (Look at the picture below)

Everyone feels, what should I do if my English is not good? ? ?
Let me tell you a little secret, now there is something called Google Translate, hehe! ! ! !
After the translation is completed, just save it directly
When saving, be sure to change the encoding to UTF-8 for saving.
After the string and array have been Chineseized, compile and package them. Test them to see if they are available in Chinese. If so, the next step is the Chineseization of XML
---------------------------------------
Chinese analysis
- After understanding the problem of language packs, everyone will understand that the operation steps of APKTool are actually very simple, just decompile - modify or add language packs - repackage, but the most time-consuming part is modifying and adding language packs, which is more time-consuming than the traditional Chinese method, but the benefits are incomparable to the traditional Chinese method.

- In addition, in addition to the language packs in the res folder that need to be Chineseized, there are also files in the layout and xml folders in the res folder that need to be Chineseized.

It is also opened with Notepad++ Portable. These files are full of code statements, and you need to use the search function to find the words that need to be Chineseized. Therefore, it is recommended that you install the original software first, then compare the words, search, and Chineseize them.
You can only use this method!

You can use notepad++ to search for un-Chinese character parts, or you can search through the following methods. The relevant settings are as shown in the figure:

Set according to the above picture, the directory is the apk folder obtained after decompilation, and the search target is default for search. The result is as follows:

Use the same setting method to change the search target to Search android: laber= and android: title= and android: text= to find the Chinese version (note: when using this method, not all characters need to be Chinese version), and then test again and find that the Chinese parts of the program have been successfully displayed in Chinese, but when clicking the widget on the desktop to enable or disable the widget, English will still be displayed. At this time, we have Chineseized xml and arsc, and then we need to go to dex to find the Chinese version.
(Note: notepad++ is used to search for un-Chinese character parts. The SD card clearing tool used in this tutorial does not need to be searched. The above picture is taken from where the notification bar was Chineseized. It can be used as a reference. Not everyone needs this step)
----------------------------------------------------------
3. Others
- Simplifying the language is very simple. You only need to delete other values-*** language pack folders in the res directory that are not values, values-zh-rCN, and values-zh-rTW. (The two circled in the picture below are, one is the German language pack and the other is the Danish language pack)

Embedded Chineseization leaves these two files unchanged, creates the values-zh-rCN (Simplified Chinese) and values-zh-rTW (Traditional Chinese) folders under the res path, and puts string and array in After the English characters are modified into Simplified Chinese and Traditional Chinese, they are saved in the values-zh-rCN (Simplified Chinese) and values-zh-rTW (Traditional Chinese) folders
--------------------------------------------
4. Notes
- In some cases, after streamlining the language, when recompiling and packaging, the command window will prompt a public******* error. This is due to the public. The xml file defines fields for language files in other values-*** language pack files other than values, values-zh-rCN, and values-zh-rTW. However, these language packs have been streamlined and cannot be defined, so errors will occur. There are two solutions:
* First, follow the prompts in the command window (there is a prompt that the value of a specific line in the public. xml language file.

* Second, follow the prompts in the command window (there is a prompt that the value of a specific line in the public.xml file is not defined), directly go to the public. Delete the undefined lines of code in the xml file.
(This requires an accumulation process, and you will know how to solve it after multiple operations)
× Preview
reply 🤍 0 📤 share collect
Profound. I will study it in a couple of years!
Only looking for ways to crack Android games
— All replies loaded —

Leave a Reply