FORUMS
Remove All Ads from XDA

[GUIDE] - The differences between Odex and Deodex Files

3,452 posts
Thanks Meter: 2,853
 
By philos64, Senior Member on 24th June 2013, 07:57 AM
Post Reply Email Thread
25th July 2013, 03:02 PM |#21  
lastforone's Avatar
Member
Flag Heavenly Forest
Thanks Meter: 12
 
Donate to Me
More
i always wondered what they meant, thanks for the explaination.
28th July 2013, 10:44 PM |#22  
Junior Member
Flag California
Thanks Meter: 1
 
More
Thanks!
Quote:
Originally Posted by philos64

Now, it's impossible that you have not encountered the term ‘deodexed’ if you’ve ever installed a custom firmware on your device, since almost all ROM developers choose to deodexed their roms. What this means for the average user. To understand the concept, you’ll first need to grasp what odex files are, and why are present in the OS in the first place.
Odex files contain pre-optimized code extracted from the system libs and apps, and are in the same directory as the jar or apk files inside /system, so they are part of the ROM. Odex files depend on each other, so the whole system, once odexed, cannot easily be modified.





In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space The odexed file structure works well as an optimization tool. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster.
On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.

For instance, on a non-rooted device you’ll find
system/app/Phone.apk ===> as well as ===> system/app/Phone.odex




It’s the process to take all the packages out from .odex file and reassemble them all together in classes.dex file which is kept inside the APK file. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.
In summary, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity.

on the same device but rooted now, you’ll find this:
system/app/Phone.apk ===> but no longer the corresponding .odex file. The reassembled files become classes.dex




In normal cases, where an Android firmware is odexed, the .odex files for each /system APK (which are stored outside of the APKs themselves) are written into the Dalvik Virtual Machine when the OS boots up. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster. Ultimately, for the user, it means that boot times are significantly sped up, and you can put your device to use much sooner.
Android applies this technique by default to all the system applications.

By deodexing these APKs, a developer actually puts the .odex files back inside their respective APK packages. Since all code is now contained within the APK itself, it becomes possible to modify any application package without conflicting with the operating system’s execution environment.




The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, that’s why developers prefer it and most, if not all, of the custom ROMs come pre-deodexed.

The advantage of .odex file is the faster load time of the app and were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason.

And finally rooting need not necessarily mean your device is deodexed, rather that almost all stock ROMs are odexed to some extent, and usually most custom ROMs are deodexed for easy theming.
For a casual user, the main implication is in theming possibilities. Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.

This helped so much!
30th July 2013, 04:24 AM |#23  
kicksilver's Avatar
Senior Member
Flag Rio de Janeiro
Thanks Meter: 316
 
More
Thanks, made everything clear to me.
30th July 2013, 10:18 AM |#24  
Junior Member
Thanks Meter: 0
 
More
Very helpful, thanks.
31st July 2013, 12:57 PM |#25  
Junior Member
Flag Tekirdag
Thanks Meter: 3
 
More
Got it. thanks a lot.
2nd August 2013, 07:21 PM |#26  
Member
Thanks Meter: 54
 
More
Thanks for the guide. Probably the best simple explanation I have seen.

Do you have any recommendations as to where I can find more technical details on the process?
3rd August 2013, 12:03 AM |#27  
Member
Flag Poitiers
Thanks Meter: 9
 
More
Thumbs up thanks
thnks dude very nice
4th August 2013, 07:55 AM |#28  
santy_sayantan's Avatar
Junior Member
Flag Kolkata
Thanks Meter: 0
 
More
Smile ODEX a real confusion...:\
I have deleted the inbuilt media player...and want the n7 media player to be installed everytime whenever i reset the tab i've...so i have placed the n7 player .apk in system/app/....nw the thing the app is installing but whenever i am trying to use it..it shows an error and stops running....it most probably needs an odex file... i am a novice of this matters plz help...
4th August 2013, 12:12 PM |#29  
Junior Member
Thanks Meter: 0
 
More
Thumbs up
Useful information thank you !
4th August 2013, 04:57 PM |#30  
Junior Member
Thanks Meter: 1
 
More
Haven't seen it explained better. Thank you.
6th August 2013, 02:32 PM |#31  
coelhooliveirar's Avatar
Senior Member
Flag Porto Alegre
Thanks Meter: 22
 
More
Thumbs up
Great topic, useful information!

Quote:
Originally Posted by philos64

Now, it's impossible that you have not encountered the term ‘deodexed’ if you’ve ever installed a custom firmware on your device, since almost all ROM developers choose to deodexed their roms. What this means for the average user. To understand the concept, you’ll first need to grasp what odex files are, and why are present in the OS in the first place.
Odex files contain pre-optimized code extracted from the system libs and apps, and are in the same directory as the jar or apk files inside /system, so they are part of the ROM. Odex files depend on each other, so the whole system, once odexed, cannot easily be modified.





In Android file system, applications come in packages with the extension .apk. These application packages, or APKs contain certain .odex files whose supposed function is to save space The odexed file structure works well as an optimization tool. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster.
On the other hand, it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution.

For instance, on a non-rooted device you’ll find
system/app/Phone.apk ===> as well as ===> system/app/Phone.odex




It’s the process to take all the packages out from .odex file and reassemble them all together in classes.dex file which is kept inside the APK file. By doing that, all pieces of an application package are put together back in one place, thus eliminating the worry of a modified APK conflicting with some separate odexed parts.
In summary, Deodexed ROMs (or APKs) have all their application packages put back together in one place, allowing for easy modification such as theming. Since no pieces of code are coming from any external location, custom ROMs or APKs are always deodexed to ensure integrity.

on the same device but rooted now, you’ll find this:
system/app/Phone.apk ===> but no longer the corresponding .odex file. The reassembled files become classes.dex




In normal cases, where an Android firmware is odexed, the .odex files for each /system APK (which are stored outside of the APKs themselves) are written into the Dalvik Virtual Machine when the OS boots up. Since these .odex files contain preliminary load information about each system app, the OS knows what to expect when it’s booting up, and consequently, loads all these apps faster. Ultimately, for the user, it means that boot times are significantly sped up, and you can put your device to use much sooner.
Android applies this technique by default to all the system applications.

By deodexing these APKs, a developer actually puts the .odex files back inside their respective APK packages. Since all code is now contained within the APK itself, it becomes possible to modify any application package without conflicting with the operating system’s execution environment.




The advantage of deodexing is in modification possibilities. This is most widely used in custom ROMs and themes. A developer building a custom ROM would almost always choose to deodex the ROM package first, that’s why developers prefer it and most, if not all, of the custom ROMs come pre-deodexed.

The advantage of .odex file is the faster load time of the app and were supposed to quickly build the dalvik cache, removing them would mean longer initial boot times. However, this is true only for the first ever boot after deodexing, since the cache would still get built over time as applications are used. Longer boot times may only be seen again if the dalvik cache is wiped for some reason.

And finally rooting need not necessarily mean your device is deodexed, rather that almost all stock ROMs are odexed to some extent, and usually most custom ROMs are deodexed for easy theming.
For a casual user, the main implication is in theming possibilities. Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.



And don't forget to RATE FOR THIS THREAD -

if it's helped you and eventually click to "Newsworthy Thread? "Thanks in advance

Post Reply Subscribe to Thread

Tags
deodex files, differences, guide, odex files

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes