Too bad the article is incorrect in a few vital places. Basically the article's description of dex-files is backwards.
1. .dex-files are NOT cache files for the .odex-files. .dex-files are the quivalent of the .class-files found in compiled Java programs. It's basically the compiled Java code.
2. .odex-files are the result of the process called DexOpt that runs the app once during first boot (or during the build process in the case of factory roms) and stores such information as simplified method calls and references, inlined versions of methods where beneficial and several other optimizations. Because of this the generated .odex-file becomes dependent on the specific framework and rom DexOpt was run on. That's the reason you can't directly mess around with them or run odexed apps on any other rom.
In summary: The .dex file is the original product of the compilation. The .odex is then produced to improve start-up and general speed of the apps.
See
Dalvik Optimization and Verification for more information.
The article does manage to describe why custom roms are deodexed fairly well though, ie. because it allows more freedom in terms of customization and because the resulting apk becomes portable since it no longer depends on that specific rom.
Click to expand...