Double Tap to Wake on the Nexus 6 Without Root

A few weeks ago, we featured an app which allowed the Nexus 6 to regain the double tap to wake … more

Make Your Own Heat Sink for the LG Optimus 4X HD

Its not a rare occurrence that performing a resource heavy task on your Android device (e.g. … more

Learn How to Create an Old School Dialer

XDA is not only a great source for custom ROMs, kernels, and various modifications for numerous … more

USB Desktop Charger Roundup – XDA TV

Sometimes you learn one way to do something, and that’s the way you do it forever. You never … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[Guide] [Tutorial] How to Deodex Stock Rom using Universal Deodexer (Easiest Way)

OP divyamg28

7th February 2014, 05:37 PM   |  #1  
divyamg28's Avatar
OP Member
Thanks Meter: 15
 
59 posts
Join Date:Joined: Aug 2013
More
Hello Friends..!!!
This guide is for all who wants to deodex their roms for easy customization.

First Lets know some Basic knowledge about DEODEX/ODEX...

What is Odex and Deodex ROM

What is 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.
These ‘odex’ files are actually collections of parts of an application that are optimized before booting.
Doing so speeds up the boot process, as it preloads part of an application.
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.

What is an DEODEX file?

Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files.
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.

So, 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.

How this works?

For the majority noobs amongst us, Android OS uses a Java-based virtual machine called the Dalvik Virtual Machine.
A deodexed or .dex file contains the cache used by this virtual machine (referred to as Dalvik-cache) for a program, and it is stored inside the APK.
An .odex file, on the other hand, is an optimized version of this same .
dex file that is stored next to the APK as opposed to inside it.
Android applies this technique by default to all the system applications.

When an Android-based system is booting, the davlik cache for the Davlik VM is built using these .odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process.

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.

Advanteges & Disadvantages

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,
since that would not only allow him to modify various APKs, but also leave room for post-install theming.

On the other hand, since the .odex files 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.

Note: Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.

Now Lets Start!!!

Requirements:-

1. Java installed on your PC

2. Universal Deodexer (Download from here - http://d-h.st/bMp)

3. Android SDK (for installing deodexed files)


Instructions:-

1. Now first of all you need to copy system/framework and system/apps folders from your phone to your PC. You can do this by simply using the Root Explorer or using ADB commands.

2. Download and extract the zip. You will get a folder called "Universal Deodexer V4"

3. Open the folder and place all your apks or jars from the apps folder in the "apks" folder. No need to manually check if a apk has the corresponding .odex file or not. Apks or Jars which do not have .odex files are automatically deleted.

4. Double click on Universal Deodexer V4.jar. If it does not open then right click--->Properties--->change the Opens With: to "Java(TM) Platform SE Binary". Now double click and it will open. If it still doesn't open then shift+right click anywhere in the folder and open a command prompt window there. Then type - "java -jar Universal Deodexer V4.jar" (no quotes) and see the output.



5. Select the various options (android version, compression level, debug mode).

6. Then chose the deodex all apks option. Once the deodex is complete, you will get a popup message if it was successful or not.



7. You can find the deodexed apks in the "deodexed" folder. Copy them to some other folder and empty the "apks" and "deodexed" folder.

8. Now for framewok files, you also need to put them in the "apks" folder not in "framework" folder (because there is a bug in this tool).

9. Then you need to choose both the options deodex all apks and deodex all jars one by one.

10. Thats it... Done



Now for installing deoedexed files in your phone:-

1. Put the phone in USB mass storage.

2. Go to folder where you have copied Deodexed apks and framework files and move them to the root of the sdcard.

3. Now get out from USB storage mode.

4. Go to the folder there you android SDK is installed. Go to C:\Program Files\Android\android-sdk\ [Assuming that your SDK is installed in C:\]. Then open a command prompt here. For this press Right Mouse click while holding the Shift key and select the "Open command window here" option.


5.Enter following codes.
(If you are using ADB shell in su for the first time, keep phone screen on. After entering "su" code, super user request prompt in phone. Press allow )

Code:
adb shell
su
stop
mount -o rw,remount /system/ /system/
cp /sdcard/done_app/* /system/app/
rm /system/app/*.odex
cp /sdcard/done_frame/* /system/framework/
rm /system/framework/*.odex
mount -o ro,remount /system/ /system/
reboot
6. Congrats...!!! Now you have deodexed rom
Last edited by divyamg28; 7th February 2014 at 05:41 PM.
The Following 8 Users Say Thank You to divyamg28 For This Useful Post: [ View ]
26th February 2014, 09:18 AM   |  #2  
buinghia98's Avatar
Senior Member
Flag Thai Nguyen
Thanks Meter: 36
 
252 posts
Join Date:Joined: Jan 2014
More
Does this need unlocked bootloader?
25th June 2014, 09:12 PM   |  #3  
gusato's Avatar
Member
Flag Nagaland
Thanks Meter: 18
 
77 posts
Join Date:Joined: Jun 2014
Donate to Me
More
Unhappy ADB shell not working
Quote:
Originally Posted by divyamg28

Hello Friends..!!!
This guide is for all who wants to deodex their roms for easy customization.

First Lets know some Basic knowledge about DEODEX/ODEX...

What is Odex and Deodex ROM

What is 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.
These ‘odex’ files are actually collections of parts of an application that are optimized before booting.
Doing so speeds up the boot process, as it preloads part of an application.
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.

What is an DEODEX file?

Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files.
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.

So, 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.

How this works?

For the majority noobs amongst us, Android OS uses a Java-based virtual machine called the Dalvik Virtual Machine.
A deodexed or .dex file contains the cache used by this virtual machine (referred to as Dalvik-cache) for a program, and it is stored inside the APK.
An .odex file, on the other hand, is an optimized version of this same .
dex file that is stored next to the APK as opposed to inside it.
Android applies this technique by default to all the system applications.

When an Android-based system is booting, the davlik cache for the Davlik VM is built using these .odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process.

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.

Advanteges & Disadvantages

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,
since that would not only allow him to modify various APKs, but also leave room for post-install theming.

On the other hand, since the .odex files 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.

Note: Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.

Now Lets Start!!!

Requirements:-

1. Java installed on your PC

2. Universal Deodexer (Download from here - http://d-h.st/bMp)

3. Android SDK (for installing deodexed files)


Instructions:-

1. Now first of all you need to copy system/framework and system/apps folders from your phone to your PC. You can do this by simply using the Root Explorer or using ADB commands.

2. Download and extract the zip. You will get a folder called "Universal Deodexer V4"

3. Open the folder and place all your apks or jars from the apps folder in the "apks" folder. No need to manually check if a apk has the corresponding .odex file or not. Apks or Jars which do not have .odex files are automatically deleted.

4. Double click on Universal Deodexer V4.jar. If it does not open then right click--->Properties--->change the Opens With: to "Java(TM) Platform SE Binary". Now double click and it will open. If it still doesn't open then shift+right click anywhere in the folder and open a command prompt window there. Then type - "java -jar Universal Deodexer V4.jar" (no quotes) and see the output.



5. Select the various options (android version, compression level, debug mode).

6. Then chose the deodex all apks option. Once the deodex is complete, you will get a popup message if it was successful or not.



7. You can find the deodexed apks in the "deodexed" folder. Copy them to some other folder and empty the "apks" and "deodexed" folder.

8. Now for framewok files, you also need to put them in the "apks" folder not in "framework" folder (because there is a bug in this tool).

9. Then you need to choose both the options deodex all apks and deodex all jars one by one.

10. Thats it... Done



Now for installing deoedexed files in your phone:-

1. Put the phone in USB mass storage.

2. Go to folder where you have copied Deodexed apks and framework files and move them to the root of the sdcard.

3. Now get out from USB storage mode.

4. Go to the folder there you android SDK is installed. Go to C:\Program Files\Android\android-sdk\ [Assuming that your SDK is installed in C:\]. Then open a command prompt here. For this press Right Mouse click while holding the Shift key and select the "Open command window here" option.


5.Enter following codes.
(If you are using ADB shell in su for the first time, keep phone screen on. After entering "su" code, super user request prompt in phone. Press allow )

Code:
adb shell
su
stop
mount -o rw,remount /system/ /system/
cp /sdcard/done_app/* /system/app/
rm /system/app/*.odex
cp /sdcard/done_frame/* /system/framework/
rm /system/framework/*.odex
mount -o ro,remount /system/ /system/
reboot
6. Congrats...!!! Now you have deodexed rom

As per the above guide, i was able to deodex all system apk/framework. Then i have copied the deodexed apk and framework folder to the root of the sdcard as said above but at the time of running adb shell, all commands were accepted and except "cp /sdcard/done_app/* /system/app/", it says "cp: /sdcard/done_app/*: No such file or directories. By this, what does it mean, i don't know as it is available on sdcard and i can access it through root explorer. I am totally stuck here, kindly help me to get out of this ...
26th June 2014, 08:12 PM   |  #4  
gusato's Avatar
Member
Flag Nagaland
Thanks Meter: 18
 
77 posts
Join Date:Joined: Jun 2014
Donate to Me
More
Unhappy Problem using adb shell
[/INDENT][/INDENT][/INDENT][/INDENT][/INDENT]
Quote:
Originally Posted by gusato

As per the above guide, i was able to deodex all system apk/framework. Then i have copied the deodexed apk and framework folder to the root of the sdcard as said above but at the time of running adb shell, all commands were accepted and except "cp /sdcard/done_app/* /system/app/", it says "cp: /sdcard/done_app/*: No such file or directories. By this, what does it mean, i don't know as it is available on sdcard and i can access it through root explorer. I am totally stuck here, kindly help me to get out of this ...

Thanks for your advice but i think you didn't get my point, i have done all the process of deodexing apk n jar file successfully. Then i tried to push them bach into my fone with adb shell and it didn't work. Using adb shell when i entered
"cp /sdcard/done_app/* /system/app/" it says No such file or directory but when entered
"cp /sdcard/done_frame/* /system/framework/" it accept. Why this used to happen????????
30th June 2014, 07:26 AM   |  #5  
Nihal George's Avatar
Junior Member
Flag Bangalore
Thanks Meter: 2
 
10 posts
Join Date:Joined: Jun 2013
More
Thank you so much !! This Worked really well on my Micromax a25
4th September 2014, 05:20 AM   |  #6  
Junior Member
Thanks Meter: 0
 
13 posts
Join Date:Joined: Apr 2013
I tried it bt it doesn't work for me....showing some classpath error...however my java is perfectly install even test result show completely fine n every thing got passed
14th November 2014, 10:40 AM   |  #7  
Member
Thanks Meter: 0
 
43 posts
Join Date:Joined: Nov 2011
Unhappy same here!
Quote:
Originally Posted by deoboy

I tried it bt it doesn't work for me....showing some classpath error...however my java is perfectly install even test result show completely fine n every thing got passed

Mybe theres somtething is missing in this guide! after deodexing both apks and jars, when i opened in archive still no classes.dex which is needed in decompling the apks. I think the boothclasspath is missing here?

---------- Post added at 10:40 AM ---------- Previous post was at 10:37 AM ----------

Guys can you help me decompiling the apks of huawei which being odexed? I have tried decompiling some apks of huawei and was successfully recompile without error. But my huawei g526 is odexed room which really hard to decompile. Can yopu help me? please?
18th November 2014, 05:34 AM   |  #8  
Member
Thanks Meter: 0
 
43 posts
Join Date:Joined: Nov 2011
Quote:
Originally Posted by divyamg28

Hello Friends..!!!
This guide is for all who wants to deodex their roms for easy customization.

First Lets know some Basic knowledge about DEODEX/ODEX...

What is Odex and Deodex ROM

What is 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.
These ‘odex’ files are actually collections of parts of an application that are optimized before booting.
Doing so speeds up the boot process, as it preloads part of an application.
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.

What is an DEODEX file?

Deodexing is basically repackaging of these APKs in a certain way, such that they are reassembled into classes.dex files.
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.

So, 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.

How this works?

For the majority noobs amongst us, Android OS uses a Java-based virtual machine called the Dalvik Virtual Machine.
A deodexed or .dex file contains the cache used by this virtual machine (referred to as Dalvik-cache) for a program, and it is stored inside the APK.
An .odex file, on the other hand, is an optimized version of this same .
dex file that is stored next to the APK as opposed to inside it.
Android applies this technique by default to all the system applications.

When an Android-based system is booting, the davlik cache for the Davlik VM is built using these .odex files, allowing the OS to learn in advance what applications will be loaded, and thus speeds up the booting process.

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.

Advanteges & Disadvantages

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,
since that would not only allow him to modify various APKs, but also leave room for post-install theming.

On the other hand, since the .odex files 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.

Note: Themes for android come in APKs too, and if you want to modify any of those, you should always choose a dedoexed custom ROM.

Now Lets Start!!!

Requirements:-

1. Java installed on your PC

2. Universal Deodexer (Download from here - http://d-h.st/bMp)

3. Android SDK (for installing deodexed files)


Instructions:-

1. Now first of all you need to copy system/framework and system/apps folders from your phone to your PC. You can do this by simply using the Root Explorer or using ADB commands.

2. Download and extract the zip. You will get a folder called "Universal Deodexer V4"

3. Open the folder and place all your apks or jars from the apps folder in the "apks" folder. No need to manually check if a apk has the corresponding .odex file or not. Apks or Jars which do not have .odex files are automatically deleted.

4. Double click on Universal Deodexer V4.jar. If it does not open then right click--->Properties--->change the Opens With: to "Java(TM) Platform SE Binary". Now double click and it will open. If it still doesn't open then shift+right click anywhere in the folder and open a command prompt window there. Then type - "java -jar Universal Deodexer V4.jar" (no quotes) and see the output.



5. Select the various options (android version, compression level, debug mode).

6. Then chose the deodex all apks option. Once the deodex is complete, you will get a popup message if it was successful or not.



7. You can find the deodexed apks in the "deodexed" folder. Copy them to some other folder and empty the "apks" and "deodexed" folder.

8. Now for framewok files, you also need to put them in the "apks" folder not in "framework" folder (because there is a bug in this tool).

9. Then you need to choose both the options deodex all apks and deodex all jars one by one.

10. Thats it... Done



Now for installing deoedexed files in your phone:-

1. Put the phone in USB mass storage.

2. Go to folder where you have copied Deodexed apks and framework files and move them to the root of the sdcard.

3. Now get out from USB storage mode.

4. Go to the folder there you android SDK is installed. Go to C:\Program Files\Android\android-sdk\ [Assuming that your SDK is installed in C:\]. Then open a command prompt here. For this press Right Mouse click while holding the Shift key and select the "Open command window here" option.


5.Enter following codes.
(If you are using ADB shell in su for the first time, keep phone screen on. After entering "su" code, super user request prompt in phone. Press allow )

Code:
adb shell
su
stop
mount -o rw,remount /system/ /system/
cp /sdcard/done_app/* /system/app/
rm /system/app/*.odex
cp /sdcard/done_frame/* /system/framework/
rm /system/framework/*.odex
mount -o ro,remount /system/ /system/
reboot
6. Congrats...!!! Now you have deodexed rom

I had some few questions? After deodexing my apks and frameworks, I was able to check the classes.dex was there but why when I decompiled the apks then smali is empty? I thought that the size of deodexed apks would be bigger but the size of odexed apk still the same with deodexed apks? can you help to solve my problem? I dont why encounter ?

---------- Post added at 05:27 AM ---------- Previous post was at 05:10 AM ----------

Quote:
Originally Posted by deoboy

I tried it bt it doesn't work for me....showing some classpath error...however my java is perfectly install even test result show completely fine n every thing got passed


yes thats what I think coz after reading the error I thnink the bootclasspath is missing. hope it will be fixed soon...

---------- Post added at 05:34 AM ---------- Previous post was at 05:27 AM ----------

[QUOTE=toto2011;56840723]I had some few questions? After deodexing my apks and frameworks, I was able to check the classes.dex was there but why when I decompiled the apks then smali is empty? I thought that the size of deodexed apks would be bigger but the size of odexed apk still the same with deodexed apks? can you help to solve my problem? I dont why encounter ?

---------- Post added at 05:27 AM ---------- Previous post was at 05:10 AM ----------




yes thats what I think coz after reading the error I thnink the bootclasspath is missing. hope it will be fixed soon...please see attaeched photos

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes