- There are 2 methods to deodex a ROM (set of system files whether it be stock or custom). One is doing it manually by using baksmali.jar and smali.jar. The other is easiest but, often not the most reliable. It involves using a script to perform the commands repeatedly. It saves times but there are often several apks or jars that need something different done to them.
Manually deodexing.
- 1. Download baksmali.jar and smali.jar from here: http://code.google.com/p/smali/
Linux users can also grab the wrapper scripts to save yourself some extra typing later
- 2. I personally renamed baksmali-x.x.x.jar to just baksmali.jar and did the same for smali. Its up to you.
Linux users place all 4 files somewhere that is already in your PATH (EX: /usr/local/bin/) or add the folder that they are in to your PATH (path=$PATH:). Make the files executable (chmod a+x)
Windows users: Create a new folder in you C:\ drive named something like Deodexing. Then place the baksmali.jar and smali.jar in that folder. You can also add that folder to your PATH but I am not 100% sure how to do that as I do not use windows. :Also, create a deodexed app and deodexed jar folder inside of the Deodexing folder to put the files once you complete them.
- 3. Grab your system dump and copy everything from the 'app' and 'framework' folder (*.apk, *.jar, *.odex) into your working folder :(Windows: C:\Deodexing).
- 4. Open up a terminal or command prompt and cd into your working folder (Windows:
).
- 5. Start by deodexing the .jars to make things easier in the future. Use the command:
java -jar baksmali.jar -x :nameofjar.odex (EX: java -jar baksmali.jar -x android.policy.odex).
- If everything went successful it should return you back to the prompt and create a folder named 'out' inside of your working directory. If it :returned an error it more than likely needs you to specify a custom boot class path, we will cover that later.
(Linux users: if you grabbed the wrapper scripts you can just type 'baksmali' instead of 'java -jar baksmali.jar')
- 6. Once you have the 'out' folder use the command:
java -jar smali.jar out
- This will recompile the out folder into .dex format. You should see a out.dex. Rename that out.dex to classes.dex. Open, not extract, the jar :as an archive using 7zip or something similar and place the classes.dex inside of the archive.
- 7. Clean up by deleting the 'out' folder, classes.dex (after you put it in the archive), and the .odex that you just decompiled.
- 8. Continue to do the same for all the .jar's odex files until you finish. Then move to the apk's odex files. It will be the same process.
- 9. If and when you run into errors it will more than likely look something like this:
Error occured while loading boot class path files. Aborting. org.jf.dexlib.Code.Analysis.ClassPath$ClassNotFoundException: Could not find superclass Ljavax/obex/ServerRequestHandler; at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.loadSuperclass(ClassPath.java:784) at org.jf.dexlib.Code.Analysis.ClassPath$ClassDef.(ClassPath.java:668) at org.jf.dexlib.Code.Analysis.ClassPath.loadClassDef(ClassPath.java:280) at org.jf.dexlib.Code.Analysis.ClassPath.initClassPath(ClassPath.java:163) at org.jf.dexlib.Code.Analysis.ClassPath.InitializeClassPathFromOdex(ClassPath.java:110) at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:98) at org.jf.baksmali.main.main(main.java:278) Error while loading class Lcom/android/bluetooth/opp/BluetoothOppObexServerSession; from file BluetoothOPP.odex Error while loading ClassPath class Lcom/android/bluetooth/opp/BluetoothOppObexServerSession;
- When this happens you have to specify the boot class path. It usually give you some sort of clue as what to add. In this example I attempted to deodex BluetoothOPP.odex. The line that says "Could not find superclass Ljavax/obex/...." is you clue. If you look in the folder there should be a .jar with a name that is similar to that clue. In this example I found javax.obex.jar. We need to add this as a path to be included in the deodexing. To do this use the following command:
java -jar baksmali.jar -c :javax.obex.jar -x BluetoothOPP.odex
- Note the colon (:) is important. It stands for the default class paths (core.jar|ext.jar|framework.jar|android.policy.jar|services.jar), without it you have to type each one plus the custom one.
EX: java -jar baksmali.jar -c core.jar:ext.jar:framework.jar:android.policy.jar:services.jar:javax.obex.jar -x BluetoothOPP.odex
- It is very possible that you will have more than one custom custom boot class path. Use a colon (:) to separate them, like the example above.
- 10. In theory you should have all apks and jars deodexed. Separated them by placing all apks inside the deodexed app folder and all the jars inside of the deodexed jar folder (excluding the framework-res.apk it should be in deodexed jar). Package them up in a flashable theme .zip and flash. It is usually best to use a previously made ZIP to reduce the amount of errors. I have :included a blank zip here that includes an update-script and deodex.sh, which deletes the now unneeded .odex files from the phone.
- Download it HERE
Notes:
- We started by deodexing the jars because once you start doing the apks you will have some that you need to specify the boot class paths. You can specify either the .jar or the .odex and to keep it all uniform it is best to use just one or the other. If you decide to do the apks first your command for custom boot class paths would be something like this:
java -jar baksmali.jar -c :javax.obex.odex:com.google.maps.odex -x APK.odex
You can also use the -o option with both baksmali and smali to specify the output.
EX: java -jar baksmali.jar -c :javax.obex.jar -x BluetoothOPP.odex -o bluetooth --this will name the output folder 'bluetooth' EX: java -jar smali.jar bluetooth -o classes.dex --this will recompile it into a classes.dex
Deodexing Scripts:
- 1. They work basically the same way. Follow the instructions from the location that has the script.
- 2. Most scripts will not deodex the entire rom due to the custom boot class paths. Typically they will leave the left over apks in a folder and you can just manually do the remainder. Then package it up same as above
Notes:
- Several apks may have sound files inside of them, phone.apk for example, and most scripts compress the apks after they finish deodexing. If an apk has a sound file and is compressed, it will not function properly. This is the main reason it is more stable to deodex the ROM manually. Usually you will know when an apk has sound files when the particular apk continues to FC (force close).
Notable Links.
'via Blog this'
I have followed your tutorial and it works fine until I use smali.jar, when I get the following error message:
ReplyDeleteC:\Deodexing>java -jar smali.jar out
UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.Util.ExceptionWithContext: method index is too large.
at org.jf.dexlib.Util.ExceptionWithContext.withContext(ExceptionWithCont
ext.java:54)
at org.jf.dexlib.Item.addExceptionContext(Item.java:177)
at org.jf.dexlib.Item.writeTo(Item.java:120)
at org.jf.dexlib.Section.writeTo(Section.java:119)
at org.jf.dexlib.DexFile.writeTo(DexFile.java:716)
at org.jf.smali.main.main(main.java:231)
Caused by: java.lang.RuntimeException: method index is too large.
at org.jf.dexlib.Code.Format.Instruction35c.writeInstruction(Instruction
35c.java:102)
at org.jf.dexlib.Code.Instruction.write(Instruction.java:57)
at org.jf.dexlib.CodeItem.writeItem(CodeItem.java:258)
at org.jf.dexlib.Item.writeTo(Item.java:117)
... 3 more
code_item @0x3ee0dc (Landroid/accessibilityservice/AccessibilityService$IEventLi
stenerWrapper;->(Landroid/accessibilityservice/AccessibilityService;Landro
id/accessibilityservice/AccessibilityService;)V)
C:\Deodexing>
Any ideas How I can avoid the runtime exception?
Use:
ReplyDeletejava -Xmx1024m -jar smali.jar out
SO GOOD JOB
ReplyDeleteSamsung Led TV
hey,,i just want to ask u something..what about the file that does not has .odex? for example browsermanagement? do i need to put it in deodex jar or just delete it??
ReplyDelete
ReplyDeleteBigg Boss season 11 Live streaming
Voting Process of Bigg Boss 11
Bigg Boss 11 Theme of House
nice post but how to check my Lenovo Warranty Check
ReplyDeleteIt hit greatest TRPs and started picking up a considerable measure of ubiquity and that is the point at which the makers thought of opening this stage to people in general. The tenth Season was a turn to the idea on the grounds that the basic man was permitted to select themselves and the achievement step of this show saw no limits.
ReplyDeleteIt hit greatest TRPs and started picking up a considerable measure of ubiquity and that is the point at which the makers thought of opening this stage to people in general. The tenth Season was a turn to the idea on the grounds that the basic man was permitted to select themselves and the achievement step of this show saw no limits.
Bigg Boss 11
Who Will Win BB Season 11
Bigg Boss 11 Online Streaming
Bigg Boss 11 News
It's trick-or-treat time so collect the goblins, conjure up some creative halloween costumes and prepare intimidating, also keep in mind about your computer systems. In this article we present amazing assortment of Scary Halloween wallpapers related to spirits, witches, rituals, haunted properties and, obviously, a lot of pumpkins and candle lights.
ReplyDeleteHappy Halloween quotes
Halloween Picture Frames Online
Happy Halloween messages
happy halloween images
Nice blog.
ReplyDeleteHere are my sites for voot bigg boss 11 and Bigg Boss 11.
You are really a good explained and really discussed the topic in a detailed but understandable manner. Thanks for the blog and awaiting to read more on such topics.
ReplyDeleteBigg Boss 11
Sharing serious and banner waving Happy Veterans Day Images is the simplest approach to celebrate and appreciate the most extraordinary day of the year. We have additionally assembled some great, adorable and Funny Veterans Day Images to spread the genuine substance and satisfaction of the celebration. Our colossal gathering of Images for Veterans Day are impeccably passed on your profound opinions and appreciative sentiments towards your military staff's and will beyond any doubt to fill their heart with joy as a paramount and prominent devour.
ReplyDeleteveterans day message
Veterans Day Pictures to Download
Veterans Day Cards Printable
Also Read
ReplyDeleteHappy New Year 2018 Wishes
Happy New Year 2018 Quotes
Happy New Year 2018 SMS
Merry Christmas 2017 Images
Merry Christmas 2017 Greetings
Merry Christmas 2017 Wallpapers
Veterans Day
Veterans Day Quotes
When Is Veterans Day
When will Dell Recruitment 2018 notification release for BCA students?
ReplyDeleteinfo menarik dari www.bolavita.pro
ReplyDeleteHello sir, your web site is lovingly serviced and saved as much as date. So it should be, thanks for sharing this with us.
ReplyDeletei also found some helpful sites like yours.
IPL 2018 time table
Vivo ipl 2018 team schedule
IPL 2018 teams squad
Vivo ipl 2018 team players
IPL2018 live score
Vivo ipl 2018 live score card
Vivo ipl 2018 team point table
Vivo ipl 2018 full team players list
Best Tourist Place in india
Tourist Place in Jaipur
Travel Destination Near Delhi
Best Honeymoon Destination in India
Best Adventure Place in India
Beautifull Hill Station for Couples
Tourist Place Near Maharasthra
Weekend Destination Near Mumbai
Weekend Destination near Delhi
best hill station in India
cbse 10 results 2018
10 class results 2018
2018 cbse results
12th class results 2018
cbse board results 2018
haryana board 10th&12th results 2018
uttar pardesh 12th board results 2018
hos board 10 results 2018
rbse board 10 results 2018
pbse board 10 results 2018
tamilnadu 10 results 2018
maharashtra 10 results 2018
Bihar 10th & 12th results 2018
cbse 10th & 12th results 2018
Kerala board 10 results 2018
This is really a great support for the latest adviser from online. Really a supportive work for writing a good article.Any one can enjoy it with the style of writing.
ReplyDeleteBest organic farm in Rajasthan
Top organic farm in India
Organic Pomegranate Farming
Organic thai ber farm
Tourist Places in Himachal Pradesh
ReplyDeleteTravel Destination Near Manali
Beautifull Hill Station Shimla for Couples
Tourist Place Near Kasauli
Weekend Destination near Chamba
Weekend Destination near Kufri
Best Adventure Places in himachal pradesh
Places to Visit in Nahan
Beautifull Hill Station Munnar for Couples
ReplyDeleteTourist Place Near Kumarakom
Weekend Destination near Kovalam
Tourist Places to Visit in Kollam
Most Famous Hotels & Honeymoon Resorts in Munnar
Places to Visit in Calicut (Kozhikode)
Places to visit in Varkala
Places to visit in Alleppey (Alappuzha)
Beautifull Hill Station Udaipur for Couples
ReplyDeleteIncredible Places To Visit in Mount Abu
Alluring Tourist Places To Visit in Jodhpur
Most Tourist Places to Visit in Pushkar
Amazing Tourist Places To Visit in Chittorgarh
Places to visit in Bikaner
Places To Visit in Ranthambore
Places To Visit in Alwar
Places To Visit in Kota
flashable .zip download link dead :\
ReplyDeleteKlik dulu baru bisa rasakan ayam bangkok
ReplyDeleteThe Voice Usa
ReplyDeleteAGT The Champions: I’m really happy to say it was an interesting post to read. I learned new information from your article, you are doing a great job. Continue -> AGT The Champions Winner
Thanks for every other informative web site. Where else may just I get that type of information written in such an ideal means?
ReplyDeleteMost Beautiful Places To Visit in Digboi
Stunning Tourist Places To Visit in Jorhat
Most Amazing Places To Visit in Karimganj
Beautiful Places To Visit in Nalbari
Incredible Tourist Places To Visit in Tinsukia
Popular Tourist Places To Visit in Tezpur
Famous Tourist Places To Visit in Silchar
Most Beautiful Places To Visit in Majuli
Stunning Tourist Places To Visit in Dibrugarh
Best Places To Visit in Kaziranga
ReplyDeleteBeautiful Tourist Places To Visit in Meghalaya
Amazing Places To Visit in Tura
Best Tourist Places To Visit in Jowai
Most Beautiful Places To Visit in Cherrapunji
Incredible Tourist Places To Visit in Nongpoh
Most Famous Places To Visit in Shillong
Beautiful Places To Visit in Nongstoin
Most Beautiful Waterfalls in Meghalaya For Nature Lover
Most Beautiful Hill Stations in Meghalaya For Couples
Wildlife Sanctuaries & National Parks in Meghalaya
Do Follow New Blog Post on the New Current Running Shows
ReplyDeleteAmerican Idol 2019 Winner Predictions
American Idol 2019 who will win Predictions
Who Won American Idol 2019
Who Can Win American Idol 2019
Who Will Win American Idol 2019
The Voice 2019 who won
The Voice 2019 Who Won the Finale
The Voice 2019 Spoiler Winner
The Voice 2019 Winner Name Announced Who Won the Final
The Voice 2019 Winner Predictions
Do Follow New Blog Post on the New Current Running Shows:
ReplyDeleteThe Voice 2019 who won
The Voice 2019 Who Won the Finale
The Voice 2019 Spoiler Winner
American idol 2019 Spoiler Winner
American idol 2019 who will Win
American idol 2019 who can win the Final
The Voice 2019 who won
The Voice 2019 Who Won the Finale
The Voice 2019 Spoiler Winner
American idol 2019 Spoiler Winner
American idol 2019 who will Win
American idol 2019 who can win the Final
The Voice USA 2019 who won
The Voice USA 2019 Who Won the Finale
The Voice USA 2019 Spoiler Winner
The Voice 2019 Spoiler Winner Name Announced
Dancing with the Stars 2019 Season 27 Spoiler Winner Name Announced
American Idol 2019 Spoiler Winner Name Announced
America Got Talent 2019 Spoiler Winner Name Announced
AGT 2019 Spoiler Winner Name Announced
AGT 2019 Spoiler who Will Win
America Got Talent 2019 Spoiler Winner Name Announced
AGT 2019 Spoiler Winner Name Announced
AGT 2019 Spoiler who Will Win
The Voice 2019 Australia who won
The Voice 2019 Australia Who Won the Finale
The Voice 2019 Australia Spoiler Winner
Thanks for sharing the info.Losing a tooth can be a very traumatic experience, both emotionally and financially. If a dental implant is an option you are consideringTo know more click here.
ReplyDeleteDaftar Togel Online
ReplyDeleteAgen Togel Hongkong
Agen Togel Singapura
Museumbola Slot Pragmatic
Museumbola Slot Pulsa
Museumbola Joker123
AKSES SEGERA SITUS KAMI 1 ID BANYAK PERMAINAN
WA OFFICIAL : +6283157394921
I like this article. I was searching over search engines and found your blog and it’s really helps thank you so much:
ReplyDeleteAGT 2020 Vote Online
How to vote in AGT 2020 Vote Online
AGT 2020 Vote Online Text Details Numbers Website
America’s Got Talent 2020 Winner Name Spoiler Episodes
Dancing with the Stars 2020 Winner Name Spoiler Episodes
World of Dance 2020 Winner Name Spoiler Episodes
America’s Got Talent Voting Votes though app Website Xfinity Online
Who will win The Voice 2020
Who will win The Voice 2020 Season 19
Do Follow New Blog Post on the New Current Running Shows:
ReplyDeleteThe Voice 2020 Spoiler Winner
The Voice 2020 Who Won the Finale
Dancing with the Stars 2020 Season 29 Spoiler Winner Name Announced
AGT 2021 who Won the Finale
AGT 2021 Start Date Spoiler Winner
American Idol 2021 Start Date Spoiler Winner
American Idol 2021 Start Date Spoiler Winner
The Voice Australia 2021 Start Date Premiere Schedule