File formats and APIs
Here are the most important file formats associated with applications written for different versions of Android.
DEX
The DEX format holds a set of class definitions and associated data. The file layout is as follows:
The rest of the fields define the sizes and offset of other data blocks:
Figure 13.8 – A DEX header with the fields described in detail
The header starts with an 8-byte DEX_FILE_MAGIC
value that consists of a dex
string (\x64\x65\x78
) followed by the newline symbol (\x0a
), the 3 bytes defining the format version, and finally a zero byte (\x00
). This format aims to provide a way to identify DEX files and the corresponding layout used, and to prevent basic data corruption.
ODEX
Actively used before the appearance of ART, ODEX files are the result of the optimizations made to DEX on the device in order to improve performance and decrease the result size. ODEX files consist of...