Android decompile apk (1), android decompile apk
Why decompilation:
As a personal developer, sometimes you can see exquisite UI effects and interesting functions. Do you have the urge to refer to learning. Decompiling the android apk is to extract the source code from the apk, including the resources (slice, music, layout files, and so on.
Recommended reading:
For decompilation apk, read the article <decompilation Android Application> and <decompilation of Android APK in this simple way (with the picture)>. It looks good. After reading and downloading several apk files, try it, the decompiled apk should have a bottom point in mind.
My Notes: (1). Related Software:
Dex2jar------convert APK into Java source code (qq.apk into qq_dex2jar.jar file)
Jd-gui -------- is an independent graphics tool used to display the Java source code of *. class files
Apktool ------ resource file retrieval, which extracts images, music files, and layout files for use and viewing. After decompilation, you can re-compile them back.
(2) software usage instructions:
Take qq.apk as an example. We want to view the apk source code:
Use dex2jarto convert qq.apk to qq_dex2jar.jar, and then use jd-gui to view the source code. Related cmd commands:
1. dex2jar ------- qq_dex2jar.jar File
Cd/d E: \ BaiduYunDownload \ 0002 _ decompile Android app \ related software \ dex2jar-0.0.9.15 \ dex2jar-0.0.9.15
Dex2jar qq.apk
2.jd-gui-0.3.6.windows.zip ----- view source code from jar
Drag the qq_dex2jar.jar file to jd-gui to view the source code.
Taking qq.apk as an example, we want to view the apk resource file:
Method 1: If you want to make music simple, you can simply rename qq.apkas qq.rar and decompress it to get the resource. However, the xml file of the resource obtained by this method is garbled and the image at will be distorted. Therefore, we generally use apktool to decompile the apk to obtain the complete resources.
Method 2: apktool directly extracts apk resources. The cmd command is as follows:
Cd/d E: \ BaiduYunDownload \ 0002 _ decompile Android apps \ related software
Apktool d AndroidDemo.apk
Apktool d-f AndroidDemo.apk
Apktool d-m AndroidDemo.apk
Apktool d-s AndroidDemo.apk
Apktool d-f-m-s AndroidDemo.apk
If you want to repackage the decompiled file into an apk, you can: EnterApktool B AndroidDemo.apk
3. Du Niang
The first two methods may need to be used to download the software. There are some commands, but we should not forget that we still have duniang, we can download the software compiled by others, which is more powerful and easy to use.
Practice:
Testing) to test the decompilation of this method (dex2jar, jd-gui, apktool). The final result is: Three apkss can generate jarfiles, and all can parse the Java source code, but only mms.apk can decompile the contributed source files.
This fact tells us that anti-editing apk may also be a matter of testing the character. So what we can do is to adopt several more methods, use several more software, and try more. Maybe, the miracle will be the next moment.
References:
1. decompile Android applications
Http://blog.csdn.net/android_cai_niao/article/details/43151831
2. Android APK Decompilation)
Http://blog.csdn.net/vipzjyno1/article/details/21039349