Apktool, a tool for APK decompilation (Chinese Version of Android)

Source: Internet
Author: User
Tags admob
Decompiled smali by http://jf.andblogs.net/google:

Smali/baksmali is an attacker/discycler for the dex format used by dalvik, Android's Java VM implementation. the syntax is loosely based on Jasmin's/dedexer's syntax, and supports the full functionality of the dex format (annotations, debug info, line info, etc .)

The names "smali" and "baksmali" are the Icelandic equivalents of "Cycler" and "discycler" respectively. Why Icelandic you ask? Because dalvik was named for an Icelandic fishing village.

 

For details, go on!

Set MobileQQ1_0 (Android) _ Beta2_Build0214 as needed.

Reproduced from: http://blog.sina.com.cn/s/blog_5752764e0100kv34.html APK localization [Http://www.andmoto.com/viewthread.php? Tid = 3873] 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 home page at http://code.google.com/p/android-apktool/download, apktool-1.0.0.tar.bz2and apktool-install-windows-2.20.r01-1.zip. 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 "Live 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 (many English languages), 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. See the http://www.hiapk.com/bbs/thread-21261-1-1.html for signing tools and methods.

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

Practice: remove the advertisement bar of the free version of software
[Http://bbs.ophone8.net/viewthread.php? Tid = 18082]
Open google code and find that Apktool is updated. win is supported ....
This article is a note about using Apktool in windows.
Install

1. Install the JAVA environment first. JDK/JRE will do all the work. Skip the steps after downloading and installing it on the official website.

2.download apktool.jarand the relevant files. Here, apktool-1.0.0.tar.bz2 and apktool-install-windows-2.20.r01-1.zip


3. Decompress apktool. jar to C:/Windows to decompress apktool-install-windows.zip to any folder (such as the root directory of the E disk)
4. Run CMD in win + R, run the CD command to go to The apktool-install-Windows folder, and enter apktool. And some help will be listed. Apktool command


Apktool d XXX.apk ABCDecompile XXX.apk to the folder ABC
Apktool B ABCCreate an APK from the ABC folder and output it to ABC/dist/out.apk.

Then we decompile a piece of software to play...
There is an advertisement at the bottom of the free version of automemorymanager. Remove it.
Put com.lim.android.automemman.apk in the same folder (My is the root directory of the E disk)
Win + R run cmd
E: <press enter>
E:/> apktool D com.lim.android.automemman.apk AMM <enter>
I: baksmaling...
I: Decoding resource table...
I: Decoding resources...
I: copying assets and libs...
Now the file is decode to E:/AMM. Open E:/AMM/RES/layout/Main. xml and you can see it all ~
Edit row 59th


<Com. admob. android. ads. adView android: id = "@ id/ad" android: layout_width = "fill_parent" android: layout_height = "wrap_content" admobsdk: backgroundColor = "# ff000000" admobsdk: textColor = "# ffffffff" admobsdk: keywords = "Android application"/>


Change


<Com. admob. android. ads. adView android: id = "@ id/ad" android: layout_width = "0.0dip" android: layout_height = "0.0dip" admobsdk: backgroundColor = "# ff000000" admobsdk: textColor = "# ffffffff" admobsdk: keywords = "Android application"/>


Then Enter cmd
E:/> apktool B AMM
I: Checking Whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...
Use Auto-sign to sign E:/AMM/dist/out.apk for Installation
In this way, the advertisement will disappear.

Look again, hey ~ Handsome...

Related Article

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.