Android APK Decompilation

Apk file structure APK file is actually a zip compressed package, which can be unpacked by the decompression tool. The following is what we saw after unpacking the helloworld.apk file with zip. It can be seen that its structure is somewhat similar to the newly established engineering structure. Java code:

The manifest file androidmanifest.xml must be defined and included in each application. It describes the name, version, permissions, referenced library files and other information [,]. If you want to upload APK to Google market, you also need to configure this XML. There are many materials on the Internet, so I won't introduce more here. Androidmanifest.xml in APK is compressed and can be unpacked by axmlprinter2 tool [,]. The specific command is: Java code:

Meta inf directory meta inf directory stores signature information to ensure the integrity of APK package and system security. When eclipse compiles and generates an API package, it will perform a verification calculation on all files to be packaged, and put the calculation results in the meta-inf directory. When installing the APK package on the ophone platform, the application manager will verify the files in the package according to the same algorithm. If the verification result is inconsistent with the content under meta inf, the system will not install the APK. This ensures that the files in the APK package cannot be replaced at will. For example, after getting an APK package, if you want to replace an image, a piece of code, or a piece of copyright information in it, it is basically impossible to decompress, replace, and repackage it directly. This makes it more difficult for virus infection and malicious modification, and helps to protect the security of the system. Classes.dex file classes.dex is a Java bytecode file generated after compiling the Java source code. However, because the Dalvik virtual machine used by Android is incompatible with the standard Java virtual machine, the DEX file is different from the class file in both file structure and opcode. At present, the common Java decompilation tools can not process DEX files. Android simulator provides a decompile tool for DEX files, dexdump. Usage: first start the Android simulator, upload the DEX file to be viewed into the simulator with ADB push, then log in through the ADB shell, find the DEX file to be viewed, and execute dexdump xxx.dex. The Hello world program is still used as a demonstration. Java code:

Reproduced at: https://www.cnblogs.com/ITlearning/p/3143499.html

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>