.dex and .apk file: What are they and how do they execute ?
2 Answers
Actually, an APK file is a ZIP file, where you can found the Magic Number PK
in the file header. It contains not only classes.dex
but also other meta files such as AndroidManifest.xml
which contains the basic configuration of this file.
A .dex file is just... uh, I regard it as a "real" executable, like an .exe file in Windows or an ELF in Linux, which contains the machine code(for Dalvik VM).
What is the difference between .dex and .apk file?
.dex file Compiled Android application code file.
Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically by Android translating compiled applications written in the Java programming language.
Reference: Answer by Vineet Shukla
-
That's.. not how you refer to another post on SE. You should quote the relevant part, and give the link as the reference, not posting the link only.– Andrew T. ♦Commented May 10, 2016 at 7:33
-
1
classes.dex
to be executed but this can be ignored if a proper exported*.dex
or*.odex
file is present.