Odex is the executable file that is extracted from the APK in the Android app, and the Classes.dex file in the APK will be optimized by the Dex optimization process to generate a dex file that is stored separately and the Classes.dex file in the original apk will be retained. This can speed up the software start-up, pre-fetch, reduce the use of RAM, because there is no odex, the system to extract from the APK package Dex and then run.
Effect
The so-called O-Dexis generated by Classes.dex in the Android software , and Odex is the ability to pre-extract that file to speed up software loading and boot speed. But o -Dex also has shortcomings, that is, sometimes brush things can cause problems.
Simply put, the original system restored to the factory after the first boot need to extract classes.dex out, and Odex is now you take it out ahead of time. This is why the system starts or the program runs faster. And turning Dex into Odex also saves space, since the Dex in the APK can be deleted after the extraction. If not Odex, then the system will still automatically extract Dex, this time not only the APK has Dex,/data/dalvik-cache directory also has Dex, although the APK within the Dex has been compressed, but two parts of Dex's overall product is more than a portion of the volume of Odex.effectAfter Odex, the system starts and the program running speed greatly increases, the stability is invariable. So it is recommended to do odex. In general, the official ROM is Odex rom (including odex files), and the custom ROM is mostly Deodex (no Odex file). Both should have advantages, it seems that there is no unified statement. Official ROM most of each apk corresponds to a. odex file, while the Deodex ROM contains only one apk, which converts the. Odex into Classes.dex into the apk bag. So the Odex rom of the. Apk+.odex=deodex ROM of the 1. APK (In a nutshell, it's actually the last merge process).Advantages1. The time of the first entry into the system will be shortened by the brush-off. The speed of the file should also be increased. 2.APK files cannot be installed separately, and if you decompile the apk file, you can usually only get the resource file. Can be said to play a certain protective role, to avoid being arbitrarily modified and used. This allows the manufacturer to guarantee a certain amount of anti-piracy because the APK without the Dex file cannot be installed properly. 3. There will be more space for installable applications, though not many. 4. Some mobile phones with too little memory are optimized to remove Dex files to achieve the purpose of making the internal storage package, but this kind of storage package will make the phone software start slow. For users who do not pursue speed and need more memory-loaded software.Disadvantages1. It is not convenient to modify the ROM and the file itself. 2. Increase the volume of ROM packets, although not many. 3. When you upgrade a Odex app, the app will fail, most commonly FC (in Android, a dialog will pop up when you run the program, forcing it to close).
Android Development Learn--odex