[Resolved] [CLOSE THREAD] [Q] Android 2.2.1 with ODEX ROM - General Questions and Answers

Hi,
I have a phone that have Android 2.2.1 with ODEX Rom.
The phone GPS has a problem, it reports the speed in knots instead m/s.
I have the solution to solve this GPS problem but I need to edit one of the classes inside the framework.odex (class location).
This is my problem:
How can I decompile the odex file and, after I make my changes, compile it again in odex format?
Hope someone can help me with this.

http://tinyurl.com/5ru2hrl
also
http://goo.gl/xB9rK

Hi,
I just found how to decompile odex files with baksmali.
But, it is possible generate the new odex file with dexopt-wrapper or something like that without use the phone?
I dont have root access in my phone because of that I must do it in my computer and use the update.zip to update my phone.
I try z4root but I think is not working with my phone.

Android 2.2.1 with ODEX ROM (Solved)
Problem solved.
I fallow this tutorial and it works just fine.
Just one thing, when I decompile the .odex file with the Baksmali I had to use the BOOTCLASSPATH.
To Baksmali and dexopt-wrapper we need to know the BOOTCLASSPATH.
In adb just type: adb shell echo $BOOTCLASSPATH

Related

[Q] "smali" files on the I727? Can they be edited without Baksmali (Deodex)?

[Q] "smali" files on the I727? Can they be edited without Baksmali (Deodex)?
I've been looking into the coding on this phone for a while. I've made a couple of posts trying to figure out how to get Nfc enabled on this phone with no luck. So I am trying to look into it a bit further myself. I'm learning as I go, but I am trying to compare other phones files (and custom ROM files) with working Nfc with the stock ROM files on the SkyRocket to try and find clues as to which files are needed to start working on this. One thing I notice (difference) is there doesn't seem to be any "smali" files or code on the SkyRocket stock ROM. Can someone please tell me where they are located (I am rooted and use Root Explorer) on the Stock ROM or which files are used in their place?
Thanks.
**Edit**
OK, I've done a little more research and found out the "smali" code in an Odexed ROM is located in the Odexes. In order to work on them I am guessing they would need to be DeOdexed? Or is there a way to view and edit them without Baksmali?
typically bc
an odex file is renamed to class.dex and combined into the same apk
deodexing basically works likethis
every apk needs a set of instructions
thats the odex
so by removing the odex and turning it to a classes.dex
file we can remove the unwanted odex file
and speed up access to the files instructions
opens faster closes and caches faster i do beleive i could be wrong
but i know the general idea

[Q] Modifying .odex file

Is it possible to modify code in a system .odex file without de-odexing?
Here is what I've been trying, without success (Windows computer, Samsung Epic 4G Touch phone, stock ROM with 2.3.6):
On my computer, using Android Commander, I pull a .odex from /system/app to my computer. There is a corresponding .apk, but I leave that alone. I also pull the entire /system/framework folder.
On my computer, from the location containing the framework folder and the .odex file, I run "java -jar baksmali.jar --api-level 10 -d framework -x <FILE_NAME>.odex". This creates an "out" folder, with the com/android/<FILE_NAME> folder structure and the code.
I modify the code (.smali files).
I rename the original .odex file and run "java -jar smali.jar --api-level 10 out/ -o <FILE_NAME>.odex". This creates a new .odex file that, as far as I can tell, should have the updated code in it.
Using Android Commander, I push the new .odex to /system/app on my phone, change the permissions to 644, and reboot the phone.​
The changes aren't having an effect. In fact, the status bar is completely gone (the example I'm working on is a mod to the status bar in SystemUI.odex).
Any idea what I'm doing wrong?
So I'm getting the feeling that it's not possible to edit odexed apks. Is there anyway to de-odex just a single apk rather than the whole rom?
Brent212 said:
So I'm getting the feeling that it's not possible to edit odexed apks. Is there anyway to de-odex just a single apk rather than the whole rom?
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1208320
Basically, no odex can be edited and put back that easy. Wrapping and Signing ODEX style is required.
Awesome! That thread's perfect. I'm hoping I can deodex, mod the code, create a classes.dex file and put it in with the .apk, zipalign it, and just replace the existing .apk and .odex with the new .apk.
That thread (http://forum.xda-developers.com/showthread.php?t=1208320) had the answers I was looking for.
The trick was to either rename the new .odex to classes.dex and put it into the .apk, and zipalign the .apk (although I have a feeling that wasn't actually necessary), or to copy the signature from the old .odex file to the new one.
Brent212 said:
That thread (http://forum.xda-developers.com/showthread.php?t=1208320) had the answers I was looking for.
The trick was to either rename the new .odex to classes.dex and put it into the .apk, and zipalign the .apk (although I have a feeling that wasn't actually necessary), or to copy the signature from the old .odex file to the new one.
Click to expand...
Click to collapse
Odex is not dex. And vice versa. Remember that. When compiling, the result is always dex. To have odex, you need to wrap it with dexopt-wrapper within your phone.
sent from my white ray using XDA App

[Q] Services.jar changes, even simply deodexing the file prevents phone from booting

I am trying to make a minor change to my services.jar and so far have no been successful.
I deodexed the file with xultimate2.3.3 , extracted the classes.dex with 7zip 9.2, I used apktool 1.4.3 to "expand" the contents, made the change, repacked the dex file and put it back into services.jar and the phone cannot compelete boot. I made sure to change the permissions, owner a group to match the previous file.
I then tried using Xultimate to deodex the file and put it back on the phone and this also keeps it from booting.
I then tried using the already deodexed file from another rom (2.2.1 vs 2.2.2) and it had the same issue.
So far I have to reflash my phone with Odin every time and I am getting tired of making the same mistake over and over.
edit: Maybe I should ask - what is the appropraite way to move the file over? I am doing it by going into root explorer, deleting /system/framework/services.jar+services.odex, using adb push to put the file on the sdcard, using root explorer to move it from sdcard to /system/framework then changing the permissions in root explorer to match the previous file before finally running "chown root.root /system/framework/services.jar" from adb shell
Either my method for copying the file is bad or xultimate 2.3.3 is messing up the deodex. Any advice on another tool to use to deodex this file?
You should be using baksmali/smali to decompile/recompile classes.dex, not apktool :/
Apktool can decompile .jars too
I use it and works fine
@OP
After deodexing decompile the jar using Virtuous Ten Studio by Diamondback(Google it)
Burned from my laser torch using pencil cells
Thank you for the replies. I will try these suggestions.
As a side note I also tried to use Xultimate to deodex the file, then ran dexopt-wrapper on the output to reodex the unchanged file and the phone is stuck in a boot loop.
You can read about re-odexing files here http://themikmik.com/showthread.php...w-About-adb-odex-themes-etc&p=75225#post75225
Can you give suggestions on another tool to de-odex the services.jar file? I think xultimate is the problem. It is the only common denominator.
I forgot to add that the original services.odex is a different size and has different contents from the new services.odex created by xultimate+dexopt-wrapper
I didn't expect it to work but I took the modified/deodex services.jar from a 2.2.1 rom and put it into my 2.2.2 rom and it had the same non boot issue.
The newest version of xUltimate i could find.
Enjoy
http://www.xeudoxus.com/android/xUltimate-v2.4.2.zip

How to re-odex?

Normally to decompile my dex files I use smali and baksmali, how can I re-odex them?
Id like to get my service.jar re-odexed so I can try and push it to my phone via a zip update.
Sent from my MB865 using xda premium
[mini HOW-TO] Re-Odex (or create a new .odex file)
Fall of Enosis said:
Normally to decompile my dex files I use smali and baksmali, how can I re-odex them?
Id like to get my service.jar re-odexed so I can try and push it to my phone via a zip update.
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
It all needs to be done on your phone, live.. with adb.
Here's how I accomplished it - I will use the services.jar in this example. Just change the file name and path to existing .odex accordingly for other files (not sure if all steps are required exactly, but it has worked for me multiple times with different jars and SysUI apk):
Requirements:
Odexed system
adb
dexopt-wrapper
Put this dexopt-wrapper file (unzip first) in /system/bin with 775 permissions:
X X X
X....X
X....X
Probably a good idea to reboot after pushing that file, if you use root explorer (like I did).
Put the deodexed services.jar (or other jar/apk file you want to make an new odex of) on your sd card.
Go to /system folder (with root explorer or equal) and mount it R/W (not sure if this is necessary - but won't hurt)
Put your USB connection to "Charge only" mode.
Go here (big props and credit to jhotmann for this) and follow steps 8-12 (I've recreated the steps with the A2's bootclasspath below).
The bootclass path is located in the /init.rc file at the root of your phone.
Connect with adb (do a adb devices check to make sure you're all good).
To create the new odex:
Code:
adb shell
su
cd /sdcard/
dexopt-wrapper services.jar new.odex /system/framework/core.jar:/system/framework/bouncycastle.jar:/system/framework/ext.jar:/system/framework/framework.jar:/system/framework/android.policy.jar:/system/framework/services.jar:/system/framework/core-junit.jar:/system/framework/com.motorola.android.frameworks.jar:/system/framework/com.motorola.android.widget.jar
I know it's a long entry for those who don't work with command lines often (like me), but double check your entry before hitting enter.
To copy the signature from the existing odex (change path to /system/app/.. if necessary):
Code:
busybox dd if=/system/framework/services.odex of=new.odex bs=1 count=20 skip=52 seek=52 conv=notrunc
Done! Rename new.odex (created on your /sdcard) to services.odex since that is your new signed odex file...
You can then get that on your odexed system by your choice of method (adb push, update.zip, root explorer push, etc.. - note: please know what you are doing before trying to push files with root explorer! - you cannot simply copy and paste!)
Or, if you want to deodex it right away again for some odd reason like I did (personal issues )... Take the services.jar and the new services.odex from your sdcard and put them on your computer - and open the services.jar with 7-zip (maybe winzip) and delete the classes.dex file from the 7-zip window. Now you have a fresh new set of .jar/.odex files ready for deodexing (I did this all with the SystemUI.apk last night, that's why I elaborated and re-typed this whole thing today..).
Frigging brilliant man.
Much appreciated. I'm super sick and my USB cable is at work.
Once i get it back on Wednesday, I'll work all this out. If I could thank you twice I would.
Thanks man!
Sent from my MB865 using xda premium
Fall of Enosis said:
Frigging brilliant man.
Much appreciated. I'm super sick and my USB cable is at work.
Once i get it back on Wednesday, I'll work all this out. If I could thank you twice I would.
Thanks man!
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
Not a prob.
And, I updated the dexopt-wrapper link so it's easier to download - just unzip it first..
Good luck on your quest.. let me know if you catch any snags along the way - and i'll try and help you out.
Sent from my mind using XDA
Ok sooo, I think we (or most likely me) are confused on what I wanted to do. I don't want to make a NEW odex file. I need to recombine my modded classes.dex BACK with the service.jar.
Since I needed to modify some script in the services.jar I had to de-odex it so I had a classes.dex file to use baksmali with so I could modify it. Once I modded it I used smali to create the NEW MODDED classes.dex. And now I need to re-odex(bad terminology?) them to re-combine the services.jar with the classes.dex so the modded services.jar could be used on a odexed ROM.
I'm working on a de-odexed version also, but I'd like to be able to offer both
Fall of Enosis said:
Ok sooo, I think we (or most likely me) are confused on what I wanted to do. I don't want to make a NEW odex file. I need to recombine my modded classes.dex BACK with the service.jar.
Since I needed to modify some script in the services.jar I had to de-odex it so I had a classes.dex file to use baksmali with so I could modify it. Once I modded it I used smali to create the NEW MODDED classes.dex. And now I need to re-odex(bad terminology?) them to re-combine the services.jar with the classes.dex so the modded services.jar could be used on a odexed ROM.
I'm working on a de-odexed version also, but I'd like to be able to offer both
Click to expand...
Click to collapse
So, you have a deodexed services.jar (with an unedited classes.dex inside)? And, you also have an edited classes.dex (the new modded one). Just drag and drop the new modded classes.dex into the services.jar file with 7-zip to overwrite the old one.
Then I would check out the mods on a deodexed system, and provided they work, then go through the re-odexing process (separating that classes.dex from the apk and creating a new odex file) as described above to get it working on odexed systems.
Hope that helps.. Good luck!
Yes sir, you are correct. That was the first thing I tried to do was just drag and drop the modded classes.dex with 7zip, save it, however when i tried to flash the "modded" ROM it can't install the system folder because (according to Jim), when I modded copied the new classes.dex, I changed the size, and so the signature needed to be changed as well. They mismatched.
Fall of Enosis said:
Yes sir, you are correct. That was the first thing I tried to do was just drag and drop the modded classes.dex with 7zip, save it, however when i tried to flash the "modded" ROM it can't install the system folder because (according to Jim), when I modded copied the new classes.dex, I changed the size, and so the signature needed to be changed as well. They mismatched.
Click to expand...
Click to collapse
Not sure about the details of that.. I know the signatures can be tricky, but I've modded a few apks/jars similarly with no problems... when you say "can't install.." is that it wouldn't flash in recovery, or you bootlooped?
Just wouldn't flash at all.
And thanks for all your help man.
Sent from my MB865 using xda premium
I've updated the 2nd post with more detail on creating a new odex file...
Not to be a "rooster" (replace with your word of choice) or anything, but maybe this info has a place somewhere besides the general threads..?:angel: (and what is up with these new Smilies and posting reply layout?) - it just seems so hard to come by good literature on this process (which, I suppose, is a process so rarely needed though...)
So I need to perform the processes above while running in an odexed environment correct? Does this process change the deodexed APK we are running the script on to an odexed one as well as create a new .odex file for that APK? I am just confused about what the result is after running the script. For my situation I want to take 2 deodexed files (systemui and sec settings.apk) and odex them. Then push them into an odexed rom. Once I run the script above what am I left with?
Didact74 said:
So I need to perform the processes above while running in an odexed environment correct?
YES.
Does this process change the deodexed APK we are running the script on to an odexed one as well as create a new .odex file for that APK?
(Yes, it will create a new odex file that you will need to rename, but..)NO. You will need to take the classes.dex out of the deodexed apk/jar - use something like 7-zip. Unless you only edited smali, then you really only need the new odex file.
I am just confused about what the result is after running the script. For my situation I want to take 2 deodexed files (systemui and sec settings.apk) and odex them. Then push them into an odexed rom. Once I run the script above what am I left with?
Click to expand...
Click to collapse
I broke up your quote with my best answers...
As for what your're left with is a new.odex file, properly signed, if all goes well. You are going to need to do it for each of your deodexed files.
Rename them, remove the classes.dex from the deodexed files you used, and get them on your phone however you choose (I prefer zip packages and a restore.zip in case something goes wrong).
Also note that the bootclass path is different from GB to ICS.. and among different devices of course. Check init.rc file if need be. I posted the one to use for A2 ICS (think it may be the same for razr too) here: http://forum.xda-developers.com/showthread.php?t=1753659
I can't garuntee you won't have problems, but good luck... if you do you could try the dexopt-wrapper from here: http://forum.xda-developers.com/showthread.php?t=1645950 - just unzip it first obviously (but I think it's the exact same file though..)
Btw, it's all done with adb, one line at a time.. not really a script, but thank you for the idea - maybe a batch file?
Sent from my phone's mind
Great, thank you for the detailed response. Last question.
What if I have the original SystenUI.odex and SecSettings.odex files that used to be attributed to them before i deodexed them? Can I simply reuse those without having to run through the adb process?
Thanks,
Didact74 said:
Great, thank you for the detailed response. Last question.
What if I have the original SystenUI.odex and SecSettings.odex files that used to be attributed to them before i deodexed them? Can I simply reuse those without having to run through the adb process?
Thanks,
Click to expand...
Click to collapse
But, you deodexed them to edit the smali files in the classes.dex right? So, no, you will need to use the new odex files that are created from the modded deodexed files you used..
If you never edited any of the smali files, then you didn't need to deodex in the first place... you only need to deodex in order to mod the smali files - everything else in the apk can be modded as is on odexed systems.
Sent from my phone's mind
Thank you very much. Can you repost the wrapper file? Its not downloading correctly.
Didact74 said:
Thank you very much. Can you repost the wrapper file? Its not downloading correctly.
Click to expand...
Click to collapse
Updated the link in Post #2 with a zip file - you need to unzip it first then move it.
Thank you.
So I am getting an error trying to re-odex. See the attached image of the error.
Weird thing is that even though I get an error it still creates the new.odex file. I triedto go through the entire process even though I was getting errors and it just got stuck on the boot screen and never loaded. Anything in my error attached raise any flags?
Thanks,
Didact74 said:
Thank you.
So I am getting an error trying to re-odex. See the attached image of the error.
Weird thing is that even though I get an error it still creates the new.odex file. I triedto go through the entire process even though I was getting errors and it just got stuck on the boot screen and never loaded. Anything in my error attached raise any flags?
Thanks,
Click to expand...
Click to collapse
Hmmm... First thing I can think of is: are all of those framework files in the bootclass path that you used actually in your /framework folder? With our A2, in ICS there are a few extra .jar files listed that were not actually on our phone, so I had to remove those from the path...
I will try to make a new odex myself and make sure that's not a standard error message... @Fall of Enosis, you recall what it spits out?
EDIT: Shoot - forgot I'm deodexed right now... will attempt later or hear back from Fall by then..
alteredlikeness said:
Hmmm... First thing I can think of is: are all of those framework files in the bootclass path that you used actually in your /framework folder? With our A2, in ICS there are a few extra .jar files listed that were not actually on our phone, so I had to remove those from the path...
I will try to make a new odex myself and make sure that's not a standard error message... @Fall of Enosis, you recall what it spits out?
EDIT: Shoot - forgot I'm deodexed right now... will attempt later or hear back from Fall by then..
Click to expand...
Click to collapse
Yes, all .jar files listed in my bootclass were located in the framework directory.
Nevermind...my mistake. I had an issue with my files not being deodexed correctly from the start. I went back and deodexed, made the edits to res and smali then odexed using the method above again and all went well!
Thanks!

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

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 : 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 , 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 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:
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.
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 . .
hlxanthus said:
Nice, I will be trying this out a little later. Would love a batch option though. Major pain to deodex everything manually LOL
Click to expand...
Click to collapse
Yup working on the batch deodex thing hope some advanced dev can write a program and help in batch deodexing
hlxanthus said:
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 . .
Click to expand...
Click to collapse
Check Post 2 added an example
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 . .
any method to do this on linux?
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?
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.
Tech N You said:
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.
Click to expand...
Click to collapse
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
hlxanthus said:
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.
Click to expand...
Click to collapse
i know.. i meant there is no way to port apks using oat2dex? after deodex what do we push to phone?
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
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.
hlxanthus said:
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 . .
Click to expand...
Click to collapse
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
Hi, no I am sorry but I have no expertise on Linux may be some of you can try this to port to linux
fhem said:
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
Click to expand...
Click to collapse
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.
lewonsky said:
can someoen explain to me whats ht epoint of doing this guide?
will it make lollypop GPE compatible with xposed?
Click to expand...
Click to collapse
Hi, First refer this guide for difference b/w odex and deodex http://forum.xda-developers.com/showthread.php?p=40026270#post40026270
It will not make it compatible with Xposed, but you can manually theme it as many themers do or you can port apps to different android versions.
elliwigy said:
i know.. i meant there is no way to port apks using oat2dex? after deodex what do we push to phone?
Click to expand...
Click to collapse
After deodexing the files successfully you can create flashable zip and flash via recovery, as I can see that Lollipop already has TWRP for it.
Tech N You said:
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 : 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 , 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 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:
Click to expand...
Click to collapse
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
hlxanthus said:
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 . .
Click to expand...
Click to collapse
You can find it on "/system/framework/arm/" directory.
---------- Post added at 11:18 PM ---------- Previous post was at 11:13 PM ----------
Tech N You said:
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.
Click to expand...
Click to collapse
Thank you very much!!But, do you know how to re-odex the modified dex file?

Categories

Resources