[GUIDE][TOOL] Android L 5.0 (Lollipop) deodex tool for windows! Oat2dex convertor.

Search This thread

Tech N You

Senior Member
Jul 10, 2014
648
631
Unknown Land
EDIT 2 : WAIT NO MORE! Thanx to our friend @joeldroid for his AMAZING TOOL that can batch deodex lollipop files.!
Head over HERE and learn more about it. It is in early stages but works perfectly! ;)


EDIT : I didn't made these tools as I said I compiled (gathered) a set of tools and wrote the guide and so mentioned on XDA Portal that I created a "Quick Guide" please refer that point. Credit goes to the devs of these tool creator. I am extremely sorry for my ignorance but I don't know the devs, please PM me your names so I can give proper credits.
A related guide to this can be found here on this blog, here is the link http://softdx.kr/220200813802
Hello Guys,
I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
Now on XDA Portal :D : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
Well now lets get to it.
As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.

* odex.art.xz -> The art mode to native file.
* .odex.xz -> 7zip * .odex appears when you unzip the file.

* .odex.xz unpack the file compression, uses the * .odex file.
unless the ARM is compressed folder * .odex

So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.

Procedure

1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.

2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter

3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.

4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.

5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.

6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".

7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"

Hope this guide makes you to deodex your required file(s) properly :)
P.S. I am not big of a dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide :p, if you spot any error please do help me correcting it.
I am writing a program that can batch deodex all files, but as I said I am no dev :p Hope someone can do this to write a program to batch deodex.
Please hit like if this helped you :) :fingers-crossed:
Any suggestion(s) are welcome.:laugh:
 

Attachments

  • oat2dex.7z
    1.9 MB · Views: 38,422
Last edited:

Tech N You

Senior Member
Jul 10, 2014
648
631
Unknown Land
For Example

Say we need to deodex SemcVideo.apk
Keep SemcVideo.odex in the folder and then

1) 7za x SemcVideo.odex.xz
To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.

Then, using the oat2dex tool*
2) oat2dex.bat SemcVideo.odex
With this command, you confirm that OAT file and DEX file header is present.
If a file error occurs here it will not convert.

In order to convert the file name to dex format.
3) oat2dex.bat SemcVideo.odex temp.dex
temp.dex file is created, it is odex file with the old structure.

Now, using the baksamli / smali to De-Odex.
4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
If a deodex folder is created without any error during Decompile, next step is to pack it properly.

Now, the recompiling process to generate classes.dex file.
5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Now, without any error a classes.dex file is generated.

Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SemcVideo.apk video files with file newly created classes.dex

Hope this helps. :)
 
Last edited:

hlxanthus

Senior Member
Jun 10, 2011
1,523
1,177
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL

Edit: A little lost here. So I extracted the shamu factory image, and I have the full set of system files. I extract the package you uploaded. So I would simply drop an apk or jar into the directory with the tools, along with its matching odex file, right? Could you provide an example of how to deodex say "SystemUI.apk"? I am not following the steps and understanding what you are suggesting we do . .
 
Last edited:
  • Like
Reactions: andy_zhang

Tech N You

Senior Member
Jul 10, 2014
648
631
Unknown Land
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL

Edit: A little lost here. So I extracted the shamu factory image, and I have the full set of system files. I extract the package you uploaded. So I would simply drop an apk or jar into the directory with the tools, along with its matching odex file, right? Could you provide an example of how to deodex say "SystemUI.apk"? I am not following the steps and understanding what you are suggesting we do . .

Check Post 2 added an example
 

hlxanthus

Senior Member
Jun 10, 2011
1,523
1,177
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:

Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . . :eek:
 
  • Like
Reactions: Tech N You

elliwigy

Retired Forum Moderator / Recognized Developer
XDA App Taskforce
what do u push to phone? i pushed apk i drug over earlier and wont install?

---------- Post added at 07:42 PM ---------- Previous post was at 07:40 PM ----------

i did following:

1) unzipped the oat2dex archive
2) run command prompt
3) drag apk and apk.odex.xz
4) follow all steps successfuly
5) what gets pushed to phone? I found apk i drug over in step 3? or do i find in a folder or where lol.. is the apk.odex go too?
 

hlxanthus

Senior Member
Jun 10, 2011
1,523
1,177
This doesn't touch your phone at all . . you put the apk and odex file in the tools directory and follow the guide, see the example in the second post.
 
  • Like
Reactions: Tech N You

fhem

Senior Member
Nov 4, 2013
880
1,573
Pittsburgh, PA
For Example

Say we need to deodex SemcVideo.apk
Keep SemcVideo.odex in the folder and then

1) 7za x SemcVideo.odex.xz
To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.

Then, using the oat2dex tool*
2) oat2dex.bat SemcVideo.odex
With this command, you confirm that OAT file and DEX file header is present.
If a file error occurs here it will not convert.

In order to convert the file name to dex format.
3) oat2dex.bat SemcVideo.odex temp.dex
temp.dex file is created, it is odex file with the old structure.

Now, using the baksamli / smali to De-Odex.
4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
If a deodex folder is created without any error during Decompile, next step is to pack it properly.

Now, the recompiling process to generate classdex.dex file.
5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
Now, without any error a classes.dex file is generated.

Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SecVideo.apk video files with file newly created classes.dex

Hope this helps. :)

Thanks much for this. I been have using the oat2dex script (Pau Oliva) on my linux build but have not been able to successfully deodex. I got the classes extracted but hit the wall there. I just gave you method a quick try with my sysui apk and i got an fc on reboot. I will start fresh in the morning and report back to you. I am currenty using an N9 with LRX22C stock factory images. Also, I thought I understood that JesusFreke may need to fix the smali/baksmali for us to properly deodex lollipop.

Regards
 
  • Like
Reactions: Tech N You

lewonsky

Senior Member
Jul 8, 2014
1,126
129
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
 

Q9Nap

Senior Member
Feb 13, 2009
1,019
1,890
anyone know how to convert the modified dex file back to oat format odex?
i found dex2oat, but it is an android binary; would like to be able to convert on pc.
i'm hoping there's a way to do this to be able to make minor smali edits without deodexing the entire system.
 

Tech N You

Senior Member
Jul 10, 2014
648
631
Unknown Land
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:

Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . . :eek:

I am so sorry for late reply. Glad it worked. Some files that don't have .odex.rz can be deodexed simply by Xultimate. Give a try :)
 

Tech N You

Senior Member
Jul 10, 2014
648
631
Unknown Land
Thanks much for this. I been have using the oat2dex script (Pau Oliva) on my linux build but have not been able to successfully deodex. I got the classes extracted but hit the wall there. I just gave you method a quick try with my sysui apk and i got an fc on reboot. I will start fresh in the morning and report back to you. I am currenty using an N9 with LRX22C stock factory images. Also, I thought I understood that JesusFreke may need to fix the smali/baksmali for us to properly deodex lollipop.

Regards

Great, If you face any FC issues try to avoid those apk's as this is still a beta phase but many devs out there can work on this to make it stable. :)
 

Tech N You

Senior Member
Jul 10, 2014
648
631
Unknown Land
  • Like
Reactions: lewonsky

paco_1

Senior Member
Dec 17, 2010
234
282
forum.xda-developers.com
Hello Guys,
I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
Now on XDA Portal :D : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
Well now lets get to it.
As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.

* odex.art.xz -> The art mode to native file.
* .odex.xz -> 7zip * .odex appears when you unzip the file.

* .odex.xz unpack the file compression, uses the * .odex file.
unless the ARM is compressed folder * .odex

So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.

Procedure

1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.

2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter

3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.

4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.

5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.

6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".

7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"

Hope this guide makes you to deodex your required file(s) properly :)
P.S. I am no dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide :p, if you spot any error please do help me correcting it.
I am writing a program that can batch deodex all files, but as I said I am no dev :p Hope someone can do this to write a program to batch deodex.
Please hit like if this helped you :) :fingers-crossed:
Any suggestion(s) are welcome.:laugh:



don't be posting the you create this mode ..! i was the one the found how to get the job down ..thank you to (Goldie) and ( tdunham) and SAC23) for creating the tools ...NOT YOU ! give the credit to proper person.. .it's not about creating a conflict without you.

ORIGINAL
http://forum.xda-developers.com/gal...-5-0-gonna-t2961967/post57262607#post57262607
 

Dusty tears

Member
Jan 24, 2013
43
33
Beijing
www.wonderkane.com
Excellent!! That was all it took to figure it out. As they say, now we are cooking with gas. :good:

Successfully deodexed several apks and jars from the nexus 6 factory images, trying to figure out where the heck to shoehorn in an extended power menu . . but android.policy.jar doesnt have an odex . . :eek:

You can find it on "/system/framework/arm/" directory.;)

---------- Post added at 11:18 PM ---------- Previous post was at 11:13 PM ----------

For Example
Now to add this in apk
6) 7za u -tzip SemcVideo.apk classes.dex
This will update SecVideo.apk video files with file newly created classes.dex

Hope this helps. :)

Thank you very much!!But, do you know how to re-odex the modified dex file?:)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 82
    EDIT 2 : WAIT NO MORE! Thanx to our friend @joeldroid for his AMAZING TOOL that can batch deodex lollipop files.!
    Head over HERE and learn more about it. It is in early stages but works perfectly! ;)


    EDIT : I didn't made these tools as I said I compiled (gathered) a set of tools and wrote the guide and so mentioned on XDA Portal that I created a "Quick Guide" please refer that point. Credit goes to the devs of these tool creator. I am extremely sorry for my ignorance but I don't know the devs, please PM me your names so I can give proper credits.
    A related guide to this can be found here on this blog, here is the link http://softdx.kr/220200813802
    Hello Guys,
    I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
    Now on XDA Portal :D : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
    I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
    Well now lets get to it.
    As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.

    * odex.art.xz -> The art mode to native file.
    * .odex.xz -> 7zip * .odex appears when you unzip the file.

    * .odex.xz unpack the file compression, uses the * .odex file.
    unless the ARM is compressed folder * .odex

    So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.

    Procedure

    1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.

    2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter

    3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.

    4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.

    5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.

    6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".

    7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"

    Hope this guide makes you to deodex your required file(s) properly :)
    P.S. I am not big of a dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide :p, if you spot any error please do help me correcting it.
    I am writing a program that can batch deodex all files, but as I said I am no dev :p Hope someone can do this to write a program to batch deodex.
    Please hit like if this helped you :) :fingers-crossed:
    Any suggestion(s) are welcome.:laugh:
    14
    For Example

    Say we need to deodex SemcVideo.apk
    Keep SemcVideo.odex in the folder and then

    1) 7za x SemcVideo.odex.xz
    To decompress the compressed files that SemcVideo.odex has and to use them for later purpose.

    Then, using the oat2dex tool*
    2) oat2dex.bat SemcVideo.odex
    With this command, you confirm that OAT file and DEX file header is present.
    If a file error occurs here it will not convert.

    In order to convert the file name to dex format.
    3) oat2dex.bat SemcVideo.odex temp.dex
    temp.dex file is created, it is odex file with the old structure.

    Now, using the baksamli / smali to De-Odex.
    4) java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex
    If a deodex folder is created without any error during Decompile, next step is to pack it properly.

    Now, the recompiling process to generate classes.dex file.
    5)java -jar smali-2.0.3.jar -a 21 deodex -o classes.dex
    Now, without any error a classes.dex file is generated.

    Now to add this in apk
    6) 7za u -tzip SemcVideo.apk classes.dex
    This will update SemcVideo.apk video files with file newly created classes.dex

    Hope this helps. :)
    3
    A batch deodex tool for lollipop has been added congrats :)
    Head over to post 1 to visit the link
    3
    Hello Guys,
    I am back with another exciting guide. Deodex lollipop apps and jar's now successfully.! This tool can be useful for ROM developers, chefs and themers and for those who can port apps.
    Now on XDA Portal :D : http://www.xda-developers.com/android/deodex-lollipop-system-apps-with-ease/
    I compiled together a set of tool to deodex Lollipop. I'll be attaching it at the end of the thread.
    Well now lets get to it.
    As we know in Android 5.0 Lollipop framework, app, priv-app folder we have * .apk files and * .jar file, and subsequently when you look at the sub-folder called * .odex files they have a specific folder for art runtime in order to compress into two modes.

    * odex.art.xz -> The art mode to native file.
    * .odex.xz -> 7zip * .odex appears when you unzip the file.

    * .odex.xz unpack the file compression, uses the * .odex file.
    unless the ARM is compressed folder * .odex

    So in order to deodex files we need this deodex tool and your apk along with *.odex.xz.

    Procedure

    1) Extract the attached 7z file to desktop and hold right shift key and right click mouse button, you'll see "Open Command Prompt here" click on it.

    2) Now a command prompt window will open. Now place you .apk and .odex.xz file there and type "7za x *.odex.xz " and press enter. This will lead to xz uncompressing and output file we will recieve as an odex, though a new format odex will be given in output so we need oat2dex converter

    3) Now enter this command "oat2dex.bat *.odex and press Enter. With this command, you confirm that there is OAT file and DEX file header present. Note if you face any errors during this command you'll unfortunately have to give up as that apk won't be converted.

    4) Now assuming you got no error in converting enter this command "oat2dex.bat *.odex temp.dex. This command will will you give you your required output ,i.e. .temp.dex. file is created, it is odex file with the old structure.

    5) Now using the baksamli / smali to De-Odex use this command "java -jar baksmali-2.0.3.jar -a 21 -x temp.dex -o deodex". As you all know this command will decompile dex and as a result we will find find a deodex output folder without any error.

    6) Now to compile the output back to classes.dex use this command "java -jar smali-2.0.3,jar -a 21 deodex -o classes.dex".

    7) Now to put classes.dex into apk use this command "7za u -tzip *.apk classes.dex"

    Hope this guide makes you to deodex your required file(s) properly :)
    P.S. I am no dev and this guide may contain a number of errors as this took me around 2 hours to figure out the proper way to write this guide :p, if you spot any error please do help me correcting it.
    I am writing a program that can batch deodex all files, but as I said I am no dev :p Hope someone can do this to write a program to batch deodex.
    Please hit like if this helped you :) :fingers-crossed:
    Any suggestion(s) are welcome.:laugh:



    don't be posting the you create this mode ..! i was the one the found how to get the job down ..thank you to (Goldie) and ( tdunham) and SAC23) for creating the tools ...NOT YOU ! give the credit to proper person.. .it's not about creating a conflict without you.

    ORIGINAL
    http://forum.xda-developers.com/gal...-5-0-gonna-t2961967/post57262607#post57262607
    2
    Where is everyone finding this file?? apk.odex.xz

    Probably it's for Samsung only.