Search code examples
androidcompilationdalvikandroid-runtime

Applications are compiled in odex instead of oat


As mentioned by Google for ART runtime (AOT) applications will be compiled in oat format/completely in native code.

Checked Nexus 6P device & system applications have oat folder but inside odex file is present. I was expecting corresponding oat files similar to boot.oat As far as I know odex is just optimized dex used from dalvik's time using dexopt tool.

ART should be using dex2oat during installation then why odex files are stored.

Can someone please provide explanation regarding this behavior ?

Thanks, Vinay


Solution

  • The files are oat files, regardless of the file extension. An easy way to check is to look at the first few bytes of the file. An odex file should have"dey\n035\0" (64 65 0x79 0a 30 33 35 00), while oat files are elf files, so they should have the elf magic value of 7F 45 4C 46