APK localization/modification tool-Android-apktool

Source: Internet
Author: User

Speaking of the definition of APK, most of the current tutorials are made using hex workshop or android resedit. However, after the actual operation, you will find that:
1. The hex workshop operation is cumbersome, and the characters to be modified are often not found;
2. Android resedit is easy to use. If it is slightly complicated to modify, the entire string will be lost; and the new content cannot be longer than the original content. Who can ensure that my localization language is shorter than the original one?

Now, the android-apktool software written by foreigners can help us decompile APK and generate program source code and images, xml configuration, language resources, and other files. After modifying images, language resources, and other files, we can compile and package them into an APK. After signing, we can install the local/modified APK on the mobile phone.

The Android-apktool software can access its homepage. After downloading and unzipping, copy the four files to the C:/Windows folder as recommended by the author.

This tool is written by Java. Your computer is installed with jre1_jdk and added to the path of java.exe in the system environment variation path.

After the above preparations are completed, you can use it to decompile the APK. Here I will use the APK of the live wallpaper for demonstration.

If you have used a live wallpaper, you may find that when you set the wallpaper, the page displays a problem: "Live Wallpaper", Chinese Text displayed as "Current Wallpaper" on your mobile phone ". This is caused by the translation error of the dynamic wallpaper selector "livewallpaperspicker.apk.

(Fake livewallpaperspicker.apk in the C root directory)

Start> Run. Enter cmd and press Enter.

  1. Apktool D "C:/livewallpaperspicker.apk" "C:/livewallpaperspicker"

Copy code

(Command line explanation: the output folder of the file to be decompiled by apktool D)

In this example, livewallpaperspicker.apk is decompiled and the output content is in the C:/livewallpaperspicker folder.

Open the C:/livewallpaperspicker folder and we will find some XML files and folders. In most cases, the language and image resources are stored in the res folder. This example is no exception.

Open the res folder, which can contain many folders. In most cases, language resources are stored in the values * folder. For example, values is used in the default language (mostly in English), values-de is used in German, and values-fr is used in French. Generally, we are concerned with values-ZH-RCN (Simplified Chinese) and values-ZH-RTW (Traditional Chinese ).

Open the values-ZH-RCN folder, which contains strings. xml. Open and check:

<? XML version = "1.0" encoding = "UTF-8"?>
<Resources>
<String name = "application_name"> live wallpaper selector </string>
<String name = "live_wallpaper_picker_title"> current wallpaper </string>
<String name = "live_wallpaper_preview_title"> current wallpaper preview </string>
<String name = "configure_wallpaper"> set... </string>
<String name = "wallpaper_instructions"> set wallpaper </string>
<String name = "live_wallpaper_empty"> the current wallpaper does not exist. </String>
<String name = "set_live_wallpaper"> set wallpaper </string>
<String name = "wallpaper_title_and_author"> % 1 $ s provider: % 2 $ S </string>
<String name = "live_wallpaper_loading"> loading current wallpaper... </String>
</Resources>

Well, that's it. Change "Current Wallpaper" to "dynamic wallpaper", and then check and modify the punctuation marks-use Chinese Punctuation Marks in Chinese content (we strongly urge you to pay attention to the Punctuation Problem. At present, there are too many Trojans.

This example is enough. For other complex APK files, we recommend that you check the content in the res folder, at least the content in the language folder you are concerned about.

After modification, you can re-package it. In the CMD command line, enter:

  1. Apktool B "C:/livewallpaperspicker"

Copy code

(Command line explanation: the folder in which apktool B wants to package content)
You can. The generated APK is named out.apk in the C:/livewallpaperspicker/distfile folder.

This out.apk does not have a signature, so it cannot be directly installed into the mobile phone. For the signature tools and methods, see http://www.hiapk.com/bbs/thread-21261-1.html.

The APK obtained after the signature can be installed in the mobile phone.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.