Teach you how to make Android phone foreign language APP finished

  
First, you need to understand the structure of the APK file of the Android application. Careful classmates may find during daily use that right-clicking on the apk file will result in options such as “Open with WinRAR”. In fact, this is because apk is actually a compressed package of the main file in the zip format. Open the zip file and you will see the well-ordered file and folder structure in the apk file (Figure 1). Lib: Contains the libraries needed for the program to run (the Linux library file is so). META-INF: If the software wants to be installed, it must be signed. This folder will save the signed certificate. Res: Saves the app's control layout, images, and required resource files. AndroidManifest.xml: It determines what version the app can run on, which functions and app permissions are called. Classes.dex: The core file of the app, which holds most of the app's code. Resources.arsc: Saves some string resources of the app. In addition to the first two, the next four files are required for each apk. In addition, localization is risky, please be sure to make a backup before operation. [Solution method] Understand the structure, let's take the actual operation. But before you start, prepare for the JAVA environment. Most Android programs are based on JAVA, so deploying the JRE environment is the basis for any operation under Android. In fact, it is very simple, just need to go to http://www.java.com and follow the prompts to download and install the JRE environment. Also prepare an APK file to be finished. Method 1: Use the tool to easily finish the first method with the help of AndroidResEdit. Start AndroidResEdit 1.5, drag the APK file directly into the program interface, expand the res (resources) folder, select Resource.arsc, and a bunch of strings on the right will appear. Don't panic at this time, click “file →export dictionary → capitalized initials ” (Figure 2), so we get a dictionary file. Then open the dictionary file, you will find the format is "ldquo; string | In the form of ” (Figure 3), we only need to fill in the finished string in “| Follow the ” and save it. Once again, enter AndroidResEdit, press Ctrl+R to import the dictionary, and the Chinese character will appear. If you find a string that you have forgotten to finish, you can enter the translation directly in the box below and click on it (Figure 4). After the translation is completed, click “Save File”, the program will automatically package the apk file and sign it. For the same directory, “xxxx-Chinese signature version.apk”, directly copy to Android phone to install and use. Method 2: After the decompiler, the above method is simple, but if you are careful, you will find that some strings are not translated. This is because strings are not all in Resources.arsc, and some are in Classes.dex. Classes.dex is the compiled file of the code, but some developers who are not used to it will write the string directly in the code. At this time of Chinese, we need Apkdb and UltraEdit (or Notepad++) to assist. After installing Apkdb, right click on the apk file (cannot be Chinese name), select “Use APKDB to decompile” item, press 1 after the pop-up window and press Enter (Figure 5), it will be generated in the APK file directory with APK The directory with the same name as the file, this is the source code of the APK file. The resource file is finished and the decompiled directory is opened. Go to the \ es\\values ​​folder and you will find a bunch of xml files (Figure 6). Open the Strings.xml, which are all characters such as <;<string name="xxxxx">string</string>”, be sure to keep <string name="xxxxx"> ; and </string> are unchanged, only the middle string is translated (Figure 7). After the translation is completed, create a new values-zh-rCN folder in the res directory. This tells the system to use the language file when the system language is Chinese. Smali file returns to the root directory, view AndroidManifest.xml, find the form "<manifest android:versionCode="13" android:versionName="1.1.2" package="uk.co.opticiancms.wifiprobe" <; (Figure 8) a line, write down the string behind the Package. Then go back to the Smali folder in the decompiled folder, and then go to the folder in the Package separated by “.”, for example, enter the uk, co, opticiancms, wifiprobe folder. Because only the code in this class is written by the author himself, other modifications may lead to program errors. Open a Smali file and you will find that you basically don't understand anything. Don't be afraid, search for “const-string” to find a string of the form “const-string vX” followed by a string to be finished (Figure 9). To maintain this format during translation, you can't lose double quotes, just translate the contents of double quotes. When finished, right click on the folder, select “ use APKDB to compile ”, press 1 again and press Enter, the program will automatically compile and generate the "xxxxx" folder in the source directory. Just install the apk file to your phone and enjoy the software you translated. Tip: Not all strings must be finished. In general, only strings that begin with uppercase letters need to be finished. If the file with symbols such as $1 and $2 is not required, it usually does not need to be finished. In addition, some are not plain text, but text in the form of pictures. This requires editing the image through the image software, which is relatively more complicated, and is omitted here. This article comes from [System Home] www.xp85.com
Copyright © Windows knowledge All Rights Reserved