This tutorial with simple small software prehome For example, the software is very small, for everyone to learn.
First we need to know the steps of the Chinese software, and then learn to use the Apktool tool. The tool can be downloaded in Lesson four.
Contains the Apktool all tools, we will unzip it, the best for the Chinese to establish a dedicated folder, so you can develop good habits, conducive to learning Chinese. and the folder too many things will be very messy.
Software localization steps:
1. Decompile the APK, decompile it into a text form that can be read by tools such as note++.
2. Translation, using tools such as note++ for text translation.
3. Back up the APK and compile it back into the full APK installation package.
4. The signature is aligned with the zipalign. Tools are found on top of the posts.
Apktool How to use:
Drag the prehome.apk to the working directory, and then drag to fully decompile. bat, which generates a folder with the same name. Enter the folder and you will find that the original APK structure is different. Yes, because we've done a full decompile, it's equivalent to unpacking ARSC and Dex files, and now we can use note++ and other tools. The previous course has already said where to find the Chinese language, here no longer repeat, we enter the Prehome.1.0.2\res folder, usually there will be multiple values, Values-xx folder, these are the directory of language storage, XX represents the country code, Because the Android system can read the language pack of the current country according to the country code, so if there is Values-zh (Chinese), VALUES-ZH-RCN (Simplified Chinese) or VALUES-ZH-RTW (Traditional Chinese), the mobile system will first read our Mandarin, If not, only the language of the values folder is read. Therefore, we can use Apktool to enforce Chinese or embedded Chinese.
Forced localization: Direct translation of language files under the values folder.
Embedded Chinese: Create a new Values-zh, VALUES-ZH-RCN, or VALUES-ZH-RTW, copy the language files under the values folder here, and translate the language files here.
We can also use Apktool for language refinement. Delete a language folder other than values, Values-zh, VALUES-ZH-RCN, or VALUES-ZH-RTW, but sometimes it will be an error to compile, so please refer to the follow-up course.
I usually like the streamlined software, compact ROM, so I almost all use mandatory Chinese. Then follow me to the beginning of the Chinese. Enter prehome.1.0.2\res\values, usually, we want Han's text is arrays.xml and strings.xml, here there is no arrays.xml, we do not have to tube. Open Strings.xml with note++, such as:
We want to Chinese to the black part of the English, after translation remember to save. Here to explain the points: can only be Han consecutive sentences or uppercase words, there are underscores connected to not be translated. There are special situations that you need to summarize yourself. Here are the strings.xml I translated:
The Chinese software needs to be tested, because you don't know if there is any missing Han. Now we're going to compile the APK, double-click to open Force compilation. BAT will pop up a new window, drag the folder Prehome to the new window, enter, wait for completion, that is, the compilation succeeds.
At the same time, a new prehome.1.0.2_out.apk is generated under the working directory, which is dragged to signapk.bat for signing and waiting for completion. The working directory also generates a new folder called Done, which is the new apk that has been successfully signed. Go to this directory to install, open the software on the phone to see the effect of it.
At this point you will find that there are still slip through the cracks. You don't know where the fish are, they're going to search with note++. Search also has the trick: Search Directory Select the anti-compilation folder, Match case, search without results when the search statement words and so on.
Word setting search results are not in the XML file, in the Xxx.smali, what to do? It's OK, although it's a little different but it's also very simple and requires the transcoding tool I've provided. Because Smali inside is not support direct translation into Chinese characters, you need to convert Chinese characters into U code to replace the original English words. Open the U Code transcoding tool to enter the word setting corresponding Chinese characters, click the conversion below to get U code \u8bbe\u7f6e,
Then replace the \u8bbe\u7f6e with the original settings and remember to save it.
Before you can go back to compiling the test to see if there is success. If you do it right, you must succeed. This is no longer a demonstration. Smali file in the Chinese also have a few points to note: The Chinese character must be transcoded, can only translate the results of search or in the software, not more Han, can only Han const-string the middle part of the double quotation marks, double quotation marks can not be lost!
Finally, there are zipalign, using the same method as the signature, the details can refer to the description of the tool compression package.
Android software Apktool General tutorial to this end, hope can help you.
Software Chinese ———— apktool General course of Chinese-xda