Post Reply

[GUIDE] - The differences between Odex and Deodex Files

24th June 2013, 07:57 AM   |  #1  
philos64's Avatar
OP Recognized Contributor
Thanks Meter: 2,665
 
3,396 posts
Join Date:Joined: May 2010
More
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.



Quote:

WHAT IS EXACTLY AN ODEX FILE ?


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


Quote:

AND NOW THE DEODEX FILE ?


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


Quote:

HOW THESE FILES WORK ?


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.


Quote:

CONCLUSION: ADVANTAGES & DISADVANTAGES FOR BOTH SYSTEM FILES


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
Last edited by philos64; 27th August 2013 at 01:53 PM.
The Following 145 Users Say Thank You to philos64 For This Useful Post: [ View ]
30th June 2013, 06:27 PM   |  #2  
Junior Member
Thanks Meter: 2
 
13 posts
Join Date:Joined: Mar 2013
it also makes hacking those applications difficult because a part of the coding has already been extracted to another location before execution
The Following User Says Thank You to falkuto For This Useful Post: [ View ]
1st July 2013, 01:08 PM   |  #3  
XperienceD's Avatar
Senior Member
Flag Here =)
Thanks Meter: 2,403
 
7,310 posts
Join Date:Joined: Jul 2010
More
This should help a lot of People.
The Following 2 Users Say Thank You to XperienceD For This Useful Post: [ View ]
4th July 2013, 07:56 AM   |  #4  
Junior Member
Thanks Meter: 1
 
17 posts
Join Date:Joined: Mar 2012
after tinkering with my phone from HTC DND to HTC One X to Lenovo P770 in a span of 2years, I finally understand what odex and deodex mean!

thanks!
4th July 2013, 07:58 AM   |  #5  
jonahly's Avatar
Senior Member
Flag Ashland
Thanks Meter: 130
 
635 posts
Join Date:Joined: Oct 2012
More
Cool

Sent from my LG-LS970 using xda app-developers app
5th July 2013, 09:45 AM   |  #6  
Junior Member
Flag Land of powercut
Thanks Meter: 30
 
23 posts
Join Date:Joined: Jan 2013
More
Angry INFO
Also mention that odexed ram uses less internal app storage space than deoxed rom
Useful on devices with low internal storage
5th July 2013, 08:21 PM   |  #7  
Junior Member
Thanks Meter: 0
 
7 posts
Join Date:Joined: Feb 2013
Thanks for your explanation. That's really help me..
7th July 2013, 10:02 AM   |  #8  
subha7082's Avatar
Senior Member
Flag Jhargram
Thanks Meter: 74
 
139 posts
Join Date:Joined: Oct 2012
More
Tutorial ODEX
How to make a ODEX rom for a android phone like company of that phone
7th July 2013, 10:10 AM   |  #9  
philos64's Avatar
OP Recognized Contributor
Thanks Meter: 2,665
 
3,396 posts
Join Date:Joined: May 2010
More
Quote:
Originally Posted by subha7082

How to make a ODEX rom for a android phone like company of that phone

Search a little and you will find a good thread for:
Use the search bar "Search all forums" and type "how to make a Odex rom"

Thanks
The Following 2 Users Say Thank You to philos64 For This Useful Post: [ View ]
8th July 2013, 01:39 AM   |  #10  
Member
Thanks Meter: 4
 
37 posts
Join Date:Joined: May 2011
thank you for this

Post Reply Subscribe to Thread

Tags
deodex files, differences, guide, odex files
Previous Thread Next Thread
Thread Tools
Display Modes


Top Threads in Android General by ThreadRank