What's Deodex and Odex?

Search This thread

danknee

Senior Member
[search] deodex [/search]
Berzerker said:
De-odex: Apk files have respective odexes that devs use to supposedly save space. Deodexing means you convert it back to a .dex file and put it back inside the apk. This allows you to easily replace files (not having to worry about odexes), but the main point was to deodex services.jar so that you can change all text to different colors (such as the clock color to white) and to deodex services.jar, you need to deodex everything.
 

sablesurfer

Senior Member
Nov 15, 2009
354
5
Related question also....

- Which can live with which? (Deodexed ROM + Odexed Theme? or Odexed ROM + Deodexed Theme?)

You know, like type O is universal donor and type AB is universal recipient...do these work similar or only deodexed with deodexed...?

(where is that darn wiki??)
 
  • Like
Reactions: superboy123

sudhirkhanger

Senior Member
Jun 29, 2010
909
48
Related question also....

- Which can live with which? (Deodexed ROM + Odexed Theme? or Odexed ROM + Deodexed Theme?)

You know, like type O is universal donor and type AB is universal recipient...do these work similar or only deodexed with deodexed...?

(where is that darn wiki??)

Dear GOD,

Please come down from heaven and explain by some magic show what the hell these deodexed and odexed means?

Thank you,
A non-believer.
 

SilverZero

Senior Member
May 18, 2010
1,550
409
Dear GOD,

Please come down from heaven and explain by some magic show what the hell these deodexed and odexed means?

Thank you,
A non-believer.

Deodexed ROMs have their .apk's (which are basically the application packages) repackaged in a certain way. An "odex" can be thought of as a collection of parts of applications that have been pulled out and optimized before booting. This speeds up the boot process - in a way, it preloads part of the applications - but it also makes hacking those apps difficult because part of the original code is already extracted somewhere else.

Deodexing is just a process of putting those pieces back into the original applications. It takes a while to extract those parts and build the .dex cache (aka Dalvik cache), but only because the relevant parts aren't in an easy-to-access place for the system. The advantage of this is that an app can be modified effectively and the developer doesn't have to worry about conflicts from the separate odex part of the code.

So, short version: "Deodexed" ROMs have all their apps put back together. If an app can be themed, for example, a deodexed version of that app will not get messed up when the modified .apk tries to mesh with the odex of the original un-modified .apk. Because it's not there.

If you want an aftermarket theme, you need a deodexed ROM. I'm not sure if deodexing can be done to individual apps within a non-deodexed ROM.

I think that's the general idea, anyway.
 
Last edited:

faster3200

Senior Member
Jul 10, 2010
138
19
Seattle
Related question also....

- Which can live with which? (Deodexed ROM + Odexed Theme? or Odexed ROM + Deodexed Theme?)

You know, like type O is universal donor and type AB is universal recipient...do these work similar or only deodexed with deodexed...?

(where is that darn wiki??)

You will never find an odexed theme since the odex file would contain things that needed to be changed, thus themes are deodexed. Themes basically just replace the .apk or .jar with their version, which wouldn't work on an odexed rom.

Dear GOD,

Please come down from heaven and explain by some magic show what the hell these deodexed and odexed means?

Thank you,
A non-believer.

Basically, Android uses a a java based virtual machine as the bases for running programs. This virtual machine is called Dalvik. A .dex file contains the cache used by the Dalvik VM (called Dalvik-cache) for a program and is stored inside the .apk. A .odex file is an optimized version of the .dex file which gets stored next to the .apk as opposed to inside the .apk. This process is done by default to system apps. Deodexing is the process of converting the .odex files back into .dex to be stored inside the .apk so that things can be more easily modified. So a deodexed rom is one that has been through the deodexing process. Deodex can just as easily be called Unodex or any other pre-fix you wish to use.

Hopefully that cleared that up.

EDIT: Darn, beaten.
 

sablesurfer

Senior Member
Nov 15, 2009
354
5
Thank you all. So...themes are deodexed. And only run on deodexed rom...got it. Meaning...I need a deodexed version of the new Froyo to keep my white Rosie. Cool.
 

vinconti

Senior Member
Feb 21, 2007
93
5
if you install a de-odexed rom, will the system automatically rebuild the Dalvik cache and appropriately odex the apk's, or is this something that a dev needs to do manually beforehand? In other words, are there any disadvantages to a de-odexed rom other than an initially slower phone? will the phone eventually rebuild the cache and perform as an odexed system would?
 

r4zv4n

Member
Sep 19, 2008
22
2
^bump^

Same question as vinconti - will a deodexed ROM run slower than an odexed one?

Thanks :)
 

KrushR

New member
Aug 13, 2008
2
1
<InigoMontoya>You keep using that word. I do not think it means what you think it means.</InigoMontoya>

:D

Thanks for the explanations, all. I just rooted my D2 but haven't done any themes yet. This helps, but only from the standpoint of I'll have to get back into flashing. I thought I left that behind when I trashed my Omnia.
 
  • Like
Reactions: lngwstx

kasper_h

Inactive Recognized Developer
Oct 8, 2010
5,308
16,087
Xiaomi Mi Mix 2S
Samsung Galaxy A52 4G
I have a regular odexed ROM. I replace some of the apk+odex files by deodexed APK's, so that seems to be no problem. But I was wondering whether this would also work for jar+odex files (e.g. android.policy.jar)....
 
I have a regular odexed ROM. I replace some of the apk+odex files by deodexed APK's, so that seems to be no problem. But I was wondering whether this would also work for jar+odex files (e.g. android.policy.jar)....

If this does actually work without problems does that mean we'd only have to de-odex certain .apks rather than the whole ROM?
 

lngwstx

Member
Dec 10, 2010
14
0
Phoenix
<InigoMontoya>You keep using that word. I do not think it means what you think it means.</InigoMontoya>

:D

Thanks for the explanations, all. I just rooted my D2 but haven't done any themes yet. This helps, but only from the standpoint of I'll have to get back into flashing. I thought I left that behind when I trashed my Omnia.

Thanks for the Inigo moment. You made my night. :D:D:D

Question to the room: Do I need this deodexing thing just to install apps and run the wifi tether (the whole reason I'm venturing into root territory to begin with)? :confused: I don't care what it looks like, I just want it to provide wifi to my soon-to-be-rooted Nook Color. Thanks in advance.
 

Ninjew1

New member
Dec 31, 2010
1
0
But... All I want is WiFi tethering!

Question to the room: Do I need this deodexing thing just to install apps and run the wifi tether (the whole reason I'm venturing into root territory to begin with)? :confused: I don't care what it looks like, I just want it to provide wifi to my soon-to-be-rooted Nook Color. Thanks in advance.

This is pretty much my question as well. This whole Odex/Deodex thing is totally frying my brain.

I'm not trying to do anything fancy, I just want to use the WiFi tether feature. Which one is good enough for just doing THAT?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 32
    Dear GOD,

    Please come down from heaven and explain by some magic show what the hell these deodexed and odexed means?

    Thank you,
    A non-believer.

    Deodexed ROMs have their .apk's (which are basically the application packages) repackaged in a certain way. An "odex" can be thought of as a collection of parts of applications that have been pulled out and optimized before booting. This speeds up the boot process - in a way, it preloads part of the applications - but it also makes hacking those apps difficult because part of the original code is already extracted somewhere else.

    Deodexing is just a process of putting those pieces back into the original applications. It takes a while to extract those parts and build the .dex cache (aka Dalvik cache), but only because the relevant parts aren't in an easy-to-access place for the system. The advantage of this is that an app can be modified effectively and the developer doesn't have to worry about conflicts from the separate odex part of the code.

    So, short version: "Deodexed" ROMs have all their apps put back together. If an app can be themed, for example, a deodexed version of that app will not get messed up when the modified .apk tries to mesh with the odex of the original un-modified .apk. Because it's not there.

    If you want an aftermarket theme, you need a deodexed ROM. I'm not sure if deodexing can be done to individual apps within a non-deodexed ROM.

    I think that's the general idea, anyway.
    17
    Related question also....

    - Which can live with which? (Deodexed ROM + Odexed Theme? or Odexed ROM + Deodexed Theme?)

    You know, like type O is universal donor and type AB is universal recipient...do these work similar or only deodexed with deodexed...?

    (where is that darn wiki??)

    You will never find an odexed theme since the odex file would contain things that needed to be changed, thus themes are deodexed. Themes basically just replace the .apk or .jar with their version, which wouldn't work on an odexed rom.

    Dear GOD,

    Please come down from heaven and explain by some magic show what the hell these deodexed and odexed means?

    Thank you,
    A non-believer.

    Basically, Android uses a a java based virtual machine as the bases for running programs. This virtual machine is called Dalvik. A .dex file contains the cache used by the Dalvik VM (called Dalvik-cache) for a program and is stored inside the .apk. A .odex file is an optimized version of the .dex file which gets stored next to the .apk as opposed to inside the .apk. This process is done by default to system apps. Deodexing is the process of converting the .odex files back into .dex to be stored inside the .apk so that things can be more easily modified. So a deodexed rom is one that has been through the deodexing process. Deodex can just as easily be called Unodex or any other pre-fix you wish to use.

    Hopefully that cleared that up.

    EDIT: Darn, beaten.
    5
    Deodexed ROMs have their .apk's (which are basically the application packages) repackaged in a certain way. An "odex" can be thought of as a collection of parts of applications that have been pulled out and optimized before booting. This speeds up the boot process - in a way, it preloads part of the applications - but it also makes hacking those apps difficult because part of the original code is already extracted somewhere else.

    Deodexing is just a process of putting those pieces back into the original applications. It takes a while to extract those parts and build the .dex cache (aka Dalvik cache), but only because the relevant parts aren't in an easy-to-access place for the system. The advantage of this is that an app can be modified effectively and the developer doesn't have to worry about conflicts from the separate odex part of the code.

    So, short version: "Deodexed" ROMs have all their apps put back together. If an app can be themed, for example, a deodexed version of that app will not get messed up when the modified .apk tries to mesh with the odex of the original un-modified .apk. Because it's not there.

    If you want an aftermarket theme, you need a deodexed ROM. I'm not sure if deodexing can be done to individual apps within a non-deodexed ROM.

    I think that's the general idea, anyway.

    Great way to put it. :)

    The deal is this. Odex can be themes just as well as deodex. You can have afternarket themes in odex or deodex flavors.

    At boot up, when dalvik dexopts the dex files from the apk and jar, there is a specific order. It starts with the bootclasspath, a group of core framework jars, and then moves onto the rest of the jars. Then it dexopts the system apks, usually just alphabetical order, then lastly the data apks (market apps, et cetera).

    In order to boot properly, the framework dex files must be assigned a correct id. If the id is out of wack, say the wrong jar was dexopted first, it will not boot up. So what does that mean for odex?

    Similarly, when optimizing the dalvik executables (odex), you have to do it in a specific order. The core jars first, then regular jars, then so on and so forth. If it is the wrong order, then you will not boot up.

    So can you you have deodexed files within an odex Rom? Yes. But not the framework jars. You cannot deodex services.jar and expect your Rom to boot. By deodexing, you are removing the id and thus the order is messed up. Let's say you deodex services.jar and push it back, keep in mind that services.odex is still existent, meaning dalvik continues to call from the odex and not the classes.dex from within services.jar. But with system apks, you can have a mix of deodex and odex. Just deodex an apk, remove the .apk and .odex, then push hack the deodex file. But you don't want to do this. No reason to. You want to dexopt the newly modded apk. Odex is simply better. Faster boot times, and because the classes are not compressed within the apk (they are in the odex file) Android can call on these code chunks much faster...meaning snappier system.

    I simply remember it this way:

    De-odexed = Changable

    Odexed = NOT Changable

    Hopefully that clears some things up. Anything you can do deodex can be done on odex.

    Sent from my PC36100 using XDA Premium App
    5
    Related question also....

    - Which can live with which? (Deodexed ROM + Odexed Theme? or Odexed ROM + Deodexed Theme?)

    You know, like type O is universal donor and type AB is universal recipient...do these work similar or only deodexed with deodexed...?

    (where is that darn wiki??)

    Dear GOD,

    Please come down from heaven and explain by some magic show what the hell these deodexed and odexed means?

    Thank you,
    A non-believer.
    3
    [search] deodex [/search]
    Berzerker said:
    De-odex: Apk files have respective odexes that devs use to supposedly save space. Deodexing means you convert it back to a .dex file and put it back inside the apk. This allows you to easily replace files (not having to worry about odexes), but the main point was to deodex services.jar so that you can change all text to different colors (such as the clock color to white) and to deodex services.jar, you need to deodex everything.