China Naming Network - Baby naming - How to view the source code of Android APP?

How to view the source code of Android APP?

Copy apk file to sdcard.

The command sequence is as follows:

Enter the Android sdk folder/tools directory.

Enter adb shell

Input su

Input cd data

Enter the cd application

At this point, you can see all the apk files you installed. Enter cp space /sdcard/ corresponding apk space.

This will copy the apk file.

You can see the familiar directory structure by directly changing the suffix of apk file to rar format.

Among them, xml files are all binary after opening and cannot be viewed.

At this time, an AXMLPrinter2 tool of android4me was used. (Please search by Baidu yourself)

Enter the following command to parse the xml file.

Java-jar axml printer 2 . jar show times _ list . XML

This command is used to view this showtimes_list.xml on the command line.

Generate showtimes_list.xml into an xml file, and then enter the following command:

Java-jar axml printer 2 . jar show times _ list . XML & gt; Xml document

So far, only the contents of xml files can be seen, and the java source files in the project are still invisible. There is a classes.dex file under the directory structure, and we need to turn the dex file into a jar file.

Another tool, dex2jar, is used here. (Search and download by yourself)

The unzipped directory under Windows is shown in the following figure:

On the command line, enter the following directory:

Under Windows, enter the following command:

dex2jar.bat c:\classes.dex

After running, there will be an additional classes.dex.dex2jar.jar file on drive C, which is the jar file we need.

Using jd-gui, jar files are reverse-engineered into java code. (Please search and download by yourself)

It is divided into three versions: Windows, Linux and max. I downloaded the Windows version here.

After decompression, double-click to run the exe file, and select the classes.dex.dex2jar.jar file, and the Java file in the corresponding jar file will be displayed by reverse engineering!

Android is a free and open source operating system based on Linux, which is mainly used for mobile devices, such as smart phones and tablets. It was led and developed by Google and open handset alliance. At present, there is no unified Chinese name. Many people in Chinese mainland use "Android" or "An Zhi". Android operating system was originally developed by andy rubin, which mainly supports mobile phones. In August 2005, it was acquired and funded by Google. In June 2007, Google established open handset alliance with 84 hardware manufacturers, software developers and telecom operators to jointly develop and improve the Android system. Then Google released the source code of Android under the authorization of Apache open source license. The first Android smartphone was released in June 2008. Android has gradually expanded to tablet computers and other fields, such as televisions, digital cameras and game consoles. 20 1 1 In the first quarter, the global market share of Android surpassed Saipan system for the first time, ranking first in the world. 20 13 in the fourth quarter, the global market share of Android platform mobile phones has reached 78. 1%. ? [1] 2065438+On September 24th, 2003, Android, an operating system developed by Google, celebrated its 5th birthday, and the number of devices using this system in the world has reached1100 million.

The word Android first appeared in L'ève future, a science fiction novel published by French writer August Villier de Le-Adam in 1886. He named this machine that looks like a human a robot.

The Logo of Android was designed by Ascender Company and was born on 20 10. Its design is inspired by graphic symbols on men's and women's toilet doors. [ 1]? So Brock drew a simple robot with a trunk like a tin can and two antennas on its head, and the Android robot was born. The characters in it use the font named "Droid" specially produced by Ascender Company. Android is a robot with a green body, and green is also the symbol of Android. Colors are drawn in RGB by PMS 376C and hexadecimal #A4C639, which is the brand logo of Android operating system. Sometimes, they also use plain text signs.