• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [Boost Mobile] smali / baksmali

MyndCTRL

Well-Known Member
Mar 23, 2012
176
39
41
Rio Grande, NJ
I'm having a hard time with a few things concerning smali / baksmali. I'm in the process of making my own rom, it's tough starting out since I have no friggin clue as to what im doing. I've learned a ton of information and I feel like i got the basics. Apollo so graciously let me use his Unitology rom as a base, but for learning sake I decided to start off from the stock rom and work my way up using unitology as a guide. Ive run into a problem and I cant seem to solve it. Here are the steps as to how I get my problem:

1) Took a fresh copy of stock b08c rom into dsixda kitchen.
2) Setup my working folder in kitchen
3) Went to system/framework and copied the android.policy.jar file and pasted a copy into my directory to work with smali / baksmali
4) Now I enter the following command:

Code:
java -jar baksmali.jar -x android.policy.jar -o classout

and this is what I get:

Code:
UNEXPECTED TOP-LEVEL EXCEPTION:
org.jf.dexlib.DexFile$NoClassesDexException: zip file android.policy.jar does not contain a classes.dex file
     at org.jf.dexlib.DexFile.<init><DexFile.java:298>
     at org.jf.baksmali.main.main(main.java:269)

Then it sends me back to my command prompt. Now the reason why I brought up Unitology rom is because I followed the same steps with that rom as I did with the stock rom, but without the error on the android.policy.jar file when it was being disassembled. I'm wondering if the two files are different, but I don't really think so...

Now granted I am only trying to do this for the extended power menu with reboot, recovery and download options and it probably really isnt needed but it's a nice feature to have and I really want to incorporate it into my rom. Also this is probably a really good learning experience. Im stuck though so any advice would be welcomed :)

Edit: Just remembered I forgot to mention that smali / backsmali is the latest version, latest JDK and Java. Im also running windows vista home premium 32bit if the OS really matters.
 
Have you deodexed the rom?

Edit&&&&: because if you haven't deodexed yet then the classes.Dex file isn't contained within the android.policy.jar... which would explain the error you're getting... it can't locate the classes.dex

Sent from my N860 using Tapatalk 2 Beta-5

That makes a lot of sense. I've been spending days on this power menu and with every little step I stumble and managed to figure everything out until now. But that sounds like an idea, I'll deodex the stock rom and try again, thanks for the suggestion! I'll get back to you :cool:
 
Upvote 0
Haha... you can't do all that much modding to a rom until its deodexed... all of the smali code is contained in the classes.dex file of ever jar or apk... if you don't deodex then it is contained outside of the apk or jar

Sent from my N860 using Tapatalk 2 Beta-5

Currently de-odexing in the kitchen. I think you were exactly spot-on when you told me to try that. Thanks so much. But now I got another question. If you remove an .apk from /system/app, is it safe to remove the corresponding .odex file as well?
 
Upvote 0
I will b the first to use yo rom:D

alright! I'll def let you know when im gettin close. I have a lot of learning to do and I keep gettin stuck. Right now im tryin to figure out why I cant flash my rom after i build it in the kitchen. I keep gettin the status code 7. I fix my mount points, replace the updater-binary but it still wont install in cwm. So im workin on that problem now
 
Upvote 0
alright! I'll def let you know when im gettin close. I have a lot of learning to do and I keep gettin stuck. Right now im tryin to figure out why I cant flash my rom after i build it in the kitchen. I keep gettin the status code 7. I fix my mount points, replace the updater-binary but it still wont install in cwm. So im workin on that problem now

Use hroarks cwm templates

Sent from my N860 using Tapatalk 2 Beta-5
 
Upvote 0
Use hroarks cwm templates

Sent from my N860 using Tapatalk 2 Beta-5

Now that I got his templates, which one's do I use, and how do I use them?

Edit: I threw something together real quick and i might have a successful installation in CWM! *crosses fingers*
Edit2: It def worked, my first rom was successful but needs massive amounts of work :)
 
Upvote 0
Now that I got his templates, which one's do I use, and how do I use them?

Edit: I threw something together real quick and i might have a successful installation in CWM! *crosses fingers*
Edit2: It def worked, my first rom was successful but needs massive amounts of work :)

rom installer is to install an entire rom... rom updater is to add or replace files without erasing everything everything else is pretty much self explanatory

Sent from my N860 using Tapatalk 2 Beta-5
 
Upvote 0
rom installer is to install an entire rom... rom updater is to add or replace files without erasing everything everything else is pretty much self explanatory

Sent from my N860 using Tapatalk 2 Beta-5

Thanks Jet, I got it to work. I flashed my first rom and I'm already using it. This is so great. Pretty soon i'll have a new rom for people to test. As for versioning, im still stuck. Dont know how to do it
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones