[HowTo] Odex FRAMEWORK, all Android versions may apply. - AT&T, Rogers HTC One X, Telstra One XL

Here in this tutorial, I will show some facts about Deodex and Odex, then explain how to odex the framework of a ROM(which is pretty annoying, you'll find out). Credits goes to myself
This method should work on all Android devices.
------------------------------------------------------------------------------------------------------------
First of all, what is odex? Something you should know about classes.dex.
Odex stands for Optimized dex. I'm not gonna explain a lot because I'm not sure if I'm right. First of all, in typical apk files, when you open it with WinRAR or something like that, you can find a file called "classes.dex"(this type of apk is deodexed). This file is the key. It contains the core codes of the apk. However the other type of apk comes with an *.odex file and doesn't have classes.dex inside the apk file. This is odexed apk. There are 2 types of ROMs here, odexed and deodexed. Odexed ROMs' classes.dex are already out of the apk files, while deodexed ROMs' classes.dex are still in the apks. When Android executes an apk, it has to extract the classes.dex out and execute it. So when you flash an deodexed ROM, the first boot takes a long long time since the Android system needs to extract all the classes.dex into dalvik-cache(it shows "Optimizing apks" on the screen for 4.0 ROMs, shows boot animation on screen for 2.3 or below ROMs). However for the odexed ROMs, because the classes.dex are already out there, the system just grabs them and use them, without wasting time and storage space extracting classes.dex out.
Why odex framework?
It can boost your device a little by odexing your framework. Your phone can run more efficiently. Although it's a complicated process, but trust me, it's worth it.
What is so special about odexing framework files? What's the difference?
Odexing an app is very easy, and I believe everyone knows how to do it. But odexing framework is really annoying. Why? Because apps and more like stand-alone things, they are not a part of system. You delete it, nothing bad happens, your phone still boots, you just get endless FC if you delete the wrong one, or missing status bar, that's all. But framework files you cannot mess around. They are parts of the system. They have to match the system's codes precisely, without any error, even the order of files(keep this in mind, very important). So for every ROM, the framework initialize codes are different(same RUU or other ROM based ROMs count as its base ROM), and you must modify the odexing binary to make it odex for you properly, or you can sit and watch the beautiful bootloop.
What's the relationship between odexing apps and odexing framework?
Simple, but important. If you odexed apps, you cannot touch the framework. Framework always goes in the first place. If you wanna odex both, you must odex framework first. Or... "The Tragedy of App and Framework"...
So what do we have to keep in mind before we start?
Keep your mind clear, prepare a bag of ice in case you feel dizzy with the codes, and MAKE ENOUGH SPACE FOR FRAMEWORK ODEXING. I would prefer you remove a few useless apks in /system/app first to make more room in system partition. Failing odexing may brick your device forever! Nah just kidding it will only cause you to bootloop. No big deal. Also, it won't odex your framework-res.apk and always will not, so don't feel bad and do it again and again till your phone burn . Make sure your device is ROOTED and enable USB debug. You need Java Runtime Environment.
What tools do you need?
Notepad++ and a magical rar that contains all you need to success.
Let's get started.
------------------------------------------------------------------------------------------------------------
1. Use your file manager to find init.rc at the very root directory of your phone and copy it to SDCard for later code editing, or you simply adb pull it out and skip the coping step. (If you know how to compile boot.img it is even easier, just unpack boot in Android Kitchen, look for line "export BOOTClassPATH". I'm not gonna introduce that method since most people can't. Silly me, didn't I just intoduced that? XD)
2. Connect USB, set mode as disk drive so you can access your SDCard. Copy init.rc into your computer. Open it with notepad, and find where it says "export BOOTClassPATH", create a new file and copy line "export BOOTClassPATH" into the new file. For example:
Code:
export BOOTCLASSPATH/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/HTCExtension.jar:/system/framework/com.htc.framework.jar:/system/framework/com.htc.android.pimlib.jar:/system/framework/com.htc.android.easopen.jar:/system/framework/com.scalado.util.ScaladoUtil.jar:/system/framework/com.orange.authentication.simcard.jar:/system/framework/android.supl.jar:/system/framework/com.ecrio.sip.jar
3. Open dexopter in the rar you downloaded with Notepad++. Find the lines that show the similar contents to the things after "export BOOTClassPATH". It is Line 21 to Line 35 on my laptop. Edit them according to the things you just copied out of init.rc. For example, if the first file is "X.jar", then you will have to edit the line into "dexopt-wrapper/system/framework/X.jar /system/framework/X.odex". Then repeat until you finish with all the files that are listed in the long list you copied out of init.rc. File order DOES MATTER. Use the bag of ice I told you to prepare eariler to make you sober if you feel dizzy with the codes. The lines may be more or less after you edited them, doesn't matter.
4. Copy "dexopter" and "dexopt-wrapper" into /system/bin and set the correct permissions. Make sure they have enough permission to change your system files. Restart your phone.
5. Go to CMD and lead it to where adb.exe is(included in the rar). Type these in order:
Code:
adb shell
su
cd system/framework
dexopter fr
Then the codes will run crazy in your cmd window... The odex process has begun!
6. If the odex process completed without error, you are half way there! Well it doesn't mean you have to stare at your screen during the process. It's about time we figure it out! The phone will automatically reboot once it's finished. If it doesn't and you are sure all are done, reboot manually.
7. If you can't boot properly, go back and check everything carefully. If you can, then open your file manager and copy the entire framework directory into your SDCard. You can still adb pull and skip the next coping step.
8. Mount SDCard. Go into framework directory on your computer. Open every file that has an odex file with it, delete the classes.dex inside. WinRAR is okay. The files may seem ridiculously small after you delete the classes.dex, but don't worry since classes.dex are already pulled out and turned into odex files.
9. Copy the whole framework folder into the folder where adb is at. Use adb to push all the files back into /system/framework.
Code:
adb root
adb remount
adb push framework /system/framework
adb shell
su
chmod /system/framework xxx (xxx is a permission code, depends on your ROM. They should be the same as the old deodexed framework files. Use Google to find out how to use the permission codes.)
10. After all the files are pushed in, reboot your phone.
11. If it still boots into the system, congratulations! You've successfully odexed your framework! If it doesn't, then go back and read everything carefully. The most common error occurs when you are editing the dexopter code. You will have to redo everything again.
Done! Everything is ready to go!
You can directly grab the files you've odexed and put it in your custom ROM(must be the same base), just don't forget the odex files.
------------------------------------------------------------------------------------------------------------
Okay, hmm, what to say now? Still, I would be glad if you donated me, but if you don't it's okay, just reply and hit thanks .
Oh almost forgot, the magical rar: http://d-h.st/tYi
------------------------------------------------------------------------------------------------------------
Big thanks to Scott, see him in #3. He explained why some files aren't odexed and provided a easier method(but they all get you dizzy )
Big thanks to JSLEnterprises, see him in #4. He provided a newer busybox for Scott's method.

If you can, send me a PM on how to odex apps.
Sent from my HTC One X using Tapatalk 2

BreatheHT said:
Here in this tutorial, I will show some facts about Deodex and Odex, then explain how to odex the framework of a ROM(which is pretty annoying, you'll find out). Credits goes to myself
Also, it won't odex your framework-res.apk and always will not, so don't feel bad and do it again and again till your phone burn . Make sure your device is ROOTED and enable USB debug. You need Java Runtime Environment.
Click to expand...
Click to collapse
Good write up. Other files that wont "re-odex" are com.htc.resources.apk, com.htc.videowidget.res.apk, com.htc.weather.res.apk and framework-htc-res.apk.
The reason? The files dont have .dex files because there is no code in them. These files just carrier resources like images (for those that didint know).
The .dex files are the actual smali code that devs mod to make the ROM do crazy things
Also, an easier method can be found here: http://themikmik.com/showthread.php?12988-Tool-App-Dexo-the-Universal-Odex-Utility
It does it all and pulls the bootclass for you. And it also does /system/app/ in one simple shot.
Also, one last thing... You can just as easily pull the files back to the PC using the ADB Pull command...
Code:
adb pull /system/app ./app
adb pull /system/framework/ ./framework
EDIT: And another simple method to get your bootclass is do another ADB Pull
Code:
add pull init.rc
I find the adb pull method quicker and more simple...
theking_13 said:
If you can, send me a PM on how to odex apps.
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
You can use the method I just explained or if you want to try the framework manually then do apps seperately then you can use this: http://forum.xda-developers.com/showthread.php?t=1514576
I use that app to re-odex updated files in the ROM. For example... If Gmail updates (which it just did) I would remove the old gmail files from system/app/ and put the new one in and run that program then pull the files.
-Scott

If anyone finds this to be too much work... dont worry... it only unpacks the classes.dex once. It will only need to unpack a dex if original file has changed (changed entries need to propogate). That's why all the consecutive boots are back to a 'normal' span of time.
re-odexing your roms IS recommended if either A) you're anal-retentive/have OCD or B) propogation ("Android is Upgrading...") happens every time you reboot your device (it happens sometimes)
If you're going to use the tool scrosler linked to, replace the busybox binary with the one inside the attatched zip (this is busybox 1.20.1). The one that come with the tool is pretty dated.
:good:
Update: Busybox 1.20.2 has been released (though not compiled for android use yet)

Great stuff guys.

scrosler said:
Good write up. Other files that wont "re-odex" are com.htc.resources.apk, com.htc.videowidget.res.apk, com.htc.weather.res.apk and framework-htc-res.apk.
The reason? The files dont have .dex files because there is no code in them. These files just carrier resources like images (for those that didint know).
The .dex files are the actual smali code that devs mod to make the ROM do crazy things
Also, an easier method can be found here: http://themikmik.com/showthread.php?12988-Tool-App-Dexo-the-Universal-Odex-Utility
It does it all and pulls the bootclass for you. And it also does /system/app/ in one simple shot.
Also, one last thing... You can just as easily pull the files back to the PC using the ADB Pull command...
Code:
adb pull /system/app ./app
adb pull /system/framework/ ./framework
EDIT: And another simple method to get your bootclass is do another ADB Pull
Code:
add pull init.rc
I find the adb pull method quicker and more simple...
You can use the method I just explained or if you want to try the framework manually then do apps seperately then you can use this: http://forum.xda-developers.com/showthread.php?t=1514576
I use that app to re-odex updated files in the ROM. For example... If Gmail updates (which it just did) I would remove the old gmail files from system/app/ and put the new one in and run that program then pull the files.
-Scott
Click to expand...
Click to collapse
hehe yep I know the adb pull command, I thought about it and I didn't put it in...

theking_13 said:
If you can, send me a PM on how to odex apps.
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
You confused bro?

Thanks. Even though I won't ever be doing this, it's good to know what's going on.

This is awesome. Thanks so much for this. I wanted to know how to odex and deodex roms.
Sent from my HTC One XL using xda app-developers app

scrosler said:
Good write up. Other files that wont "re-odex" are com.htc.resources.apk, com.htc.videowidget.res.apk, com.htc.weather.res.apk and framework-htc-res.apk.
The reason? The files dont have .dex files because there is no code in them. These files just carrier resources like images (for those that didint know).
The .dex files are the actual smali code that devs mod to make the ROM do crazy things
Also, an easier method can be found here: http://themikmik.com/showthread.php?12988-Tool-App-Dexo-the-Universal-Odex-Utility
It does it all and pulls the bootclass for you. And it also does /system/app/ in one simple shot.
Also, one last thing... You can just as easily pull the files back to the PC using the ADB Pull command...
Code:
adb pull /system/app ./app
adb pull /system/framework/ ./framework
EDIT: And another simple method to get your bootclass is do another ADB Pull
Code:
add pull init.rc
I find the adb pull method quicker and more simple...
You can use the method I just explained or if you want to try the framework manually then do apps seperately then you can use this: http://forum.xda-developers.com/showthread.php?t=1514576
I use that app to re-odex updated files in the ROM. For example... If Gmail updates (which it just did) I would remove the old gmail files from system/app/ and put the new one in and run that program then pull the files.
-Scott
Click to expand...
Click to collapse
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app

SkizzMcNizz said:
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
Click to expand...
Click to collapse
Like Scott posted?
Basically that is the steps right there..you are doing the apk in the system/app and framework.
That link provides a tool which when done properly will run on the de-odexed stock Rom and odex it...
Good luck with that...it's a nightmare...haha..

SkizzMcNizz said:
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
Click to expand...
Click to collapse
Yep Android Kitchen can do it.

Hopefully this will help to see more odex ROMs

This is the first phone I've had where developers strive to odex their roms
Something to get used to
Sent from my HTC One X using Tapatalk 2

superchilpil said:
This is the first phone I've had where developers strive to odex their roms
Something to get used to
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
Most official ROMs are odexed.

BreatheHT said:
Most official ROMs are odexed.
Click to expand...
Click to collapse
Quite the opposite where I come from
Although I came from a different carrier so this side of the forums is different
Sent from my HTC One X using Tapatalk 2

superchilpil said:
Quite the opposite where I come from
Although I came from a different carrier so this side of the forums is different
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
Nah carrier doesn't matter.

SkizzMcNizz said:
Is there also a tool to deodex roms?
Sent from my HTC One XL using xda app-developers app
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1208320
(you'll have to update the versions included in the zip as this thread is dated - 2011)
Note: the API level for 4.0.3/4.0.4 (what our HOX's run) is '15'.
you can also use DSIXDA's kitchen which can be used to batch deodex apk's after you set the api level
(it's defaulted to '10'... which was Gingerbread -> 2.3.3-2.3.7)
Full list of API levels for their specific Android versions

BreatheHT said:
hehe yep I know the adb pull command, I thought about it and I didn't put it in...
Click to expand...
Click to collapse
Yeah, I like to do it better that way. Dont have to move my hands from the keyboard and mouse. Makes you more efficient :good:
BreatheHT said:
Most official ROMs are odexed.
Click to expand...
Click to collapse
I think all?
superchilpil said:
Quite the opposite where I come from
Although I came from a different carrier so this side of the forums is different
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
Carrier is irrelevant. Most people dont know how to work with ODEX files so they go with de-odex. Its mroe challanging but provides a better experience.
techlogik said:
Like Scott posted?
Basically that is the steps right there..you are doing the apk in the system/app and framework.
That link provides a tool which when done properly will run on the de-odexed stock Rom and odex it...
Good luck with that...it's a nightmare...haha..
Click to expand...
Click to collapse
No he is asking to go the other way from odex to de-odex.
BreatheHT said:
Yep Android Kitchen can do it.
Click to expand...
Click to collapse
JSLEnterprises said:
http://forum.xda-developers.com/showthread.php?t=1208320
(you'll have to update the versions included in the zip as this thread is dated - 2011)
Note: the API level for 4.0.3/4.0.4 (what our HOX's run) is '15'.
you can also use DSIXDA's kitchen which can be used to batch deodex apk's after you set the api level
(it's defaulted to '10'... which was Gingerbread -> 2.3.3-2.3.7)
Full list of API levels for their specific Android versions
Click to expand...
Click to collapse
Click to expand...
Click to collapse
Yep, I love that script. I was the one that sent him the mnt point file for the HOX :highfive:
I am going to talk to him about bringing in "official" support for the Asus TF300T. I got the boot.img fiugred out this morning! Woot. **** is about to get real with the Asus!

superchilpil said:
This is the first phone I've had where developers strive to odex their roms
Something to get used to
Sent from my HTC One X using Tapatalk 2
Click to expand...
Click to collapse
its a good final touch when cook done with smali tweaks.
another benefit is sorta kang-protection

Related

Theming files?

Sorry about the first post. I was wondering where the png files are located in the rom so I can start theming
Sent from my HERO200 using XDA App
If this has been addressed sorry. I searched but didn't find it. If it's been addressed please point me in the right direction. Thanks
Sent from my HERO200 using XDA App
abadasstanker69 said:
If this has been addressed sorry. I searched but didn't find it. If it's been addressed please point me in the right direction. Thanks
Sent from my HERO200 using XDA App
Click to expand...
Click to collapse
Ull find all the PNG in the individual apps in the system/app, system/framework, and data/app.
Papa Smurf151 said:
Ull find all the PNG in the individual apps in the system/app, system/framework, and data/app.
Click to expand...
Click to collapse
Thanks bro! All I see is apk files though. Where are the images?? Also, is there anything specific I have to do in order to export/import the files in Photoshop? I read something somewhere about a .9 PNG or something like that....what does this mean? BTW great work on your theme! It looks awesome! I love it!
Ok I'm a douche bad. lol I renamed the apk to .zip and extracted with winrar. Now I'm in to where I want to be! I'm looking for the little android guy when you make a phone call but, I can't seem to find him in the HTCdialer.apk. Am I looking in the wrong place? Thanks again for the help!
They are in the apk's.
http://developer.android.com/index.html
Good luck.
Ok found the little droid man! This is gonna be awesome!! Any more useful places I should mess around in? This is gonna be FUN!!!!!!!
Ok so I have edited some files and rezipped them. Now do I flash the updated files through recovery or do I have to rename it to .apk and stick it in the rom and re-flash?
abadasstanker69 said:
Ok so I have edited some files and rezipped them. Now do I flash the updated files through recovery or do I have to rename it to .apk and stick it in the rom and re-flash?
Click to expand...
Click to collapse
I may be wrong but I have done the same thing, all I did when I was finished was push them via adb to their respective places and then reboot and it worked fine for me. Nandroid before you push so if it boot loops you can recover. Then the easiest thing at that point would be to save your work in the ROM you modded, push to sd root, wipe and flash it. I am creating a themed version of Darchoid 2.7 but taking my sweet time as I dont have a lot of it to begin with.
For my HTC Keyboard modifications, I just dropped my new images into the APK that was open in 7zip and pushed it to the /system/app/ dir and launched the keyboard, and BAM, my new keyboard.
abadasstanker69 said:
Ok so I have edited some files and rezipped them. Now do I flash the updated files through recovery or do I have to rename it to .apk and stick it in the rom and re-flash?
Click to expand...
Click to collapse
You have to sign it too. If you want to flash it. If you wanna just push it through adb then then put your edited .apk in AndroidSDK\tools and push it.
Go to command prompt:
Code:
cd C:\android-sdk-windows\tools
adb remount
adb push xxxxx.apk /system/app/
exit
C:\android-sdk-windows\tools is assuming thats where your sdk\tools folder is
xxxxx.apk is the name of the .apk
/system/app/ is assuming that's where you got the .apk from
Thanks for all the help guys. I appreciate it but, I was attempting to make an update.zip so people could then flash them once I complete them. I like to make things idiot proof
So I did some looking and found an autosigner. Problem is, now it wants boot scripts? WTF? I know I could push them through adb and simply tell others to do the same. I was just wondering if there was an easy way of doing this? I'm currently using avabox. Thanks again guys!!
abadasstanker69 said:
Thanks for all the help guys. I appreciate it but, I was attempting to make an update.zip so people could then flash them once I complete them. I like to make things idiot proof
So I did some looking and found an autosigner. Problem is, now it wants boot scripts? WTF? I know I could push them through adb and simply tell others to do the same. I was just wondering if there was an easy way of doing this? I'm currently using avabox. Thanks again guys!!
Click to expand...
Click to collapse
Just use a mod or update.zip any will do and add ur files and delete the originals in the zip. Keep the meta file and such. Then u can autosign with avabox. It gets tricky with scripts when making a rom. The update.zip script is very basic
Check This Out
You can just take one from a working zip if you want
Otherwise you will be making a file (i use notepad++) called "update-script" *notice-there is no file extension like .txt or anything*
In general they ususally just have:
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
(but may be different depending on where you want the zip's contents to be put in)
Which will be placed into a folder directory META-INF/com/google/android/update-script
You can also add things such as:
Code:
delete SYSTEM:app/contacts.apk
*or whatever you want deleted*
After you make the update-script, just sign it and flash
See my attachment for a template
[/QUOTE]You can also add things such as:
Code:
delete SYSTEM:app/contacts.apk
*or whatever you want deleted*
After you make the update-script, just sign it and flash
See my attachment for a template[/QUOTE]
What would be the purpose in doing that? Would it actually delete people's contacts if they flashed my theme? That's kinda cool but, I'm not trying to be a **** like that! lol
Also, are you guys referring to an update.zip that's all ready out as in a theme file? Or as in a rom? I understand I can use the work that's all ready there and I actually tried that. I zipped the file back up.Then signed with avabox. Renamed it to .apk. Stuck it back in the rom. Attempted to flash and got the boot script error
abadasstanker69 said:
What would be the purpose in doing that? Would it actually delete people's contacts if they flashed my theme? That's kinda cool but, I'm not trying to be a **** like that! lol
Also, are you guys referring to an update.zip that's all ready out as in a theme file? Or as in a rom? I understand I can use the work that's all ready there and I actually tried that. I zipped the file back up.Then signed with avabox. Renamed it to .apk. Stuck it back in the rom. Attempted to flash and got the boot script error
Click to expand...
Click to collapse
haha i just used contacts.apk as an example, it could be anything you wanted really. But its generally only used for when making an update.zip for boot screens.
And yes, you could take an already existing zip... but i was a little confused as to what you were doing sorry.
Correct me if I'm misunderstanding you again lol, but you're editing images within .apks and want to make a flashable-update.zip once you finish?
Easiest way, as stated before would be to use 7-zip.
Open the .apk Directly with 7-zip (no renaming the .apk to .zip or anything) and drag the replacement images into the .apk - overwriting the older images
Test it by pushing the apk to your phone, if it works without any problems great
If it doesn't then use something like Apk Manager to extract the apk/edit the files/and zip them back up < generally what I do
Put the .apk into the apps folder in my "template update.zip" file
Delete the framework folder and readme.txt file
Sign the .zip
Flash
kyouko said:
haha i just used contacts.apk as an example, it could be anything you wanted really. But its generally only used for when making an update.zip for boot screens.
And yes, you could take an already existing zip... but i was a little confused as to what you were doing sorry.
Correct me if I'm misunderstanding you again lol, but you're editing images within .apks and want to make a flashable-update.zip once you finish?
Easiest way, as stated before would be to use 7-zip.
Open the .apk Directly with 7-zip (no renaming the .apk to .zip or anything) and drag the replacement images into the .apk - overwriting the older images
Test it by pushing the apk to your phone, if it works without any problems great
If it doesn't then use something like Apk Manager to extract the apk/edit the files/and zip them back up < generally what I do
Put the .apk into the apps folder in my "template update.zip" file
Delete the framework folder and readme.txt file
Sign the .zip
Flash
Click to expand...
Click to collapse
LOL I really appreciate the help! You guys kick ass!!!! BUT I tried this method MINUS the renaming part and it didn't work. Sooooo....I'm assuming the renaming caused the issue.
Also, I was using winrar. I read somewhere that 7zip should be used instead of winrar but I just don't think this should matter considering the compression method is no different. Am I wrong? Also, will my theme have to vary from rom to rom? If I create this theme for people will I have to specify what rom I'm on?
Thanks again SOOOOOOOOOO much for the help guys...I know working with noobs can be a headache. I did it in the WinMo world for YEARS till I came to the "Dark Side"
abadasstanker69 said:
LOL I really appreciate the help! You guys kick ass!!!! BUT I tried this method MINUS the renaming part and it didn't work. Sooooo....I'm assuming the renaming caused the issue.
Also, I was using winrar. I read somewhere that 7zip should be used instead of winrar but I just don't think this should matter considering the compression method is no different. Am I wrong? Also, will my theme have to vary from rom to rom? If I create this theme for people will I have to specify what rom I'm on?
Thanks again SOOOOOOOOOO much for the help guys...I know working with noobs can be a headache. I did it in the WinMo world for YEARS till I came to the "Dark Side"
Click to expand...
Click to collapse
Yes 7zip works better for theming and roming. I tried winrar and it was a pain in the ass.
Yes u will have to specify which roms it will work on. Files on darchdroid r different than our 2.1 roms and so forth. So they wont work right.
Download avabox and use the signing tool in there to sign ur zips.
Make sure in ur zip if ur editing an app it's in the right place...ie system/app or system/framework or data/app. Then make sure ur Meta file is in there. After that sign it and then u can change the name and flash it
Papa Smurf151 said:
Yes 7zip works better for theming and roming. I tried winrar and it was a pain in the ass.
Yes u will have to specify which roms it will work on. Files on darchdroid r different than our 2.1 roms and so forth. So they wont work right.
Download avabox and use the signing tool in there to sign ur zips.
Make sure in ur zip if ur editing an app it's in the right place...ie system/app or system/framework or data/app. Then make sure ur Meta file is in there. After that sign it and then u can change the name and flash it
Click to expand...
Click to collapse
I'm such a freaking noob....what's the meta file for? This seems like alot to do for a theme :/
abadasstanker69 said:
I'm such a freaking noob....what's the meta file for? This seems like alot to do for a theme :/
Click to expand...
Click to collapse
The Meta file is for the update script. It has other uses but for ur purpose its for the update script which is the instructions the recovery uses to flash the theme. Like I stated before just use an existing one from a different theme or mod. Creating ur own is possible but not needed. Hit me up on gtalk if u want to ask me questions.
[email protected]
I don't mind teaching if anyone wants to learn

Creating a new theme, but how to create a usable update.zip (or other easy methods)

I started a theme the other day, and I'm moving through the files pretty quickly but without context it's hard to know which graphic is which. So I want to flash or apply the current work I'm doing so I can see where things are and how they look.
Right now I'm working through a deodexed version of Froyo so all the files should be in order. Assuming that I strip out all files but the graphics, how do I create a update.zip for it or use any other method? I'm new to Android so any help would be appreciated.
I'm guessing you already have the sdk installed?
chocmatic said:
I'm guessing you already have the sdk installed?
Click to expand...
Click to collapse
Yup. SDK + Eclipse.
Emulator? no?
you can either figure out how to make them Metamorph compatible (sorry, can't give you advice on that, never done it)
Or you can put the images in the correct folder of whatever .apk they go in and make a flashable update.zip, basically replacing the existing .apk's with the full complete modded ones.
You'll need to put all the modded .apk's into a file structure that mimicks where they would be on the phone and zip that structure up with an update_script and sign the update.zip.
I would highly recommend you unzip some small flashable .zip and poke around in it to see the structure and look at the update_script.
This is a download link to a transparent tray mod I did. It replaces ONE .png but because I chose to make it a flashable .zip it requires replacing the framework-res.apk. Except for the actual .apk's you'll need to put in it, this .zip would be perfectly suitable to use as a base for your mods (and you're welcome to use it). If you did use it you would put your .apk's in the system/framework folder, delete the 3 cert files in the META folder, zip the system and META folders into "update.zip" and sign it using an autosign script.
fire away with any questions
ps, you don't need eclipse or the sdk for any of this but you will need an auto-sign script which is one of the tools in Avabox
AFAIK you couldnt use the emulator in the SDK to preview this stuff anyways because you can't get Sense running on the emulator, not to mention the emulator runs SOOOOO SLOOOOWWWWW. Even if you could get Sense running on the em I would bet you would spend less time making a nand, flashing your mods, checking them out and restoring your nand if you didn't like them than using an emulator to preview this stuff.
Award Tour said:
Yup. SDK + Eclipse.
Click to expand...
Click to collapse
Download the attached file and save folder in your tools directory. Then look at sign.txt to sign files
chocmatic said:
Download the attached file and save folder in your tools directory. Then look at sign.txt to sign files
Click to expand...
Click to collapse
Nothings attached.
nebenezer said:
you can either figure out how to make them Metamorph compatible (sorry, can't give you advice on that, never done it)
Or you can put the images in the correct folder of whatever .apk they go in and make a flashable update.zip, basically replacing the existing .apk's with the full complete modded ones.
You'll need to put all the modded .apk's into a file structure that mimicks where they would be on the phone and zip that structure up with an update_script and sign the update.zip.
I would highly recommend you unzip some small flashable .zip and poke around in it to see the structure and look at the update_script.
This is a download link to a transparent tray mod I did. It replaces ONE .png but because I chose to make it a flashable .zip it requires replacing the framework-res.apk. Except for the actual .apk's you'll need to put in it, this .zip would be perfectly suitable to use as a base for your mods (and you're welcome to use it). If you did use it you would put your .apk's in the system/framework folder, delete the 3 cert files in the META folder, zip the system and META folders into "update.zip" and sign it using an autosign script.
fire away with any questions
ps, you don't need eclipse or the sdk for any of this but you will need an auto-sign script which is one of the tools in Avabox
AFAIK you couldnt use the emulator in the SDK to preview this stuff anyways because you can't get Sense running on the emulator, not to mention the emulator runs SOOOOO SLOOOOWWWWW. Even if you could get Sense running on the em I would bet you would spend less time making a nand, flashing your mods, checking them out and restoring your nand if you didn't like them than using an emulator to preview this stuff.
Click to expand...
Click to collapse
Thanks a lot. Seeing the file, it makes sense. In your simple example you modded the framework res APK -- did you have to sign that single APK or was it taken care of when you signed the update.zip? I've modded some apps already and I know that with single APKs you have to sign them so it can be installable again. Don't know if that is needed once you sign the update.zip.
BTW, I can't wait to release this theme. It makes Sense look substantially better.
Award Tour said:
Thanks a lot. Seeing the file, it makes sense. In your simple example you modded the framework res APK -- did you have to sign that single APK or was it taken care of when you signed the update.zip? I've modded some apps already and I know that with single APKs you have to sign them so it can be installable again. Don't know if that is needed once you sign the update.zip.
BTW, I can't wait to release this theme. It makes Sense look substantially better.
Click to expand...
Click to collapse
Actually signing the .apk's is not necessary. If all you're doing is swapping out images just open the .apk's archinve with 7zip (or similar program) and drop the new .png's into the correct folder (almost always res/drawable-hdpi)
Signing the .zip makes it flashable, the .apk is usable whether you sign it into a .zip or not. Actually when you're testing stuff out I find it's much quicker to just push the modified .apk to the phone via usb, I don't make a flashable .zip until it's ready for sharing
If you push a framework file to the phone ADB REBOOT immediately.
Also, don't be surprised if some of your wallpaper gets reset to stock and your google account gets wiped out after reboot, comes with the territory
nebenezer said:
Actually signing the .apk's is not necessary. If all you're doing is swapping out images just open the .apk's archinve with 7zip (or similar program) and drop the new .png's into the correct folder (almost always res/drawable-hdpi)
Signing the .zip makes it flashable, the .apk is usable whether you sign it into a .zip or not. Actually when you're testing stuff out I find it's much quicker to just push the modified .apk to the phone via usb, I don't make a flashable .zip until it's ready for sharing
If you push a framework file to the phone ADB REBOOT immediately.
Also, don't be surprised if some of your wallpaper gets reset to stock and your google account gets wiped out after reboot, comes with the territory
Click to expand...
Click to collapse
Oh okay, I think I'd prefer using ADB too. What command would I use to push the files?
Award Tour said:
Oh okay, I think I'd prefer using ADB too. What command would I use to push the files?
Click to expand...
Click to collapse
this:
Code:
adb remount
adb pull /system/framework/framework-res.apk c:\
then I make my changes to the .apk and:
Code:
adb push c:\framework-res.apk /system/framework
adb reboot
nebenezer said:
this:
Code:
adb remount
adb pull /system/framework/framework-res.apk c:\
then I make my changes to the .apk and:
Code:
adb push c:\framework-res.apk /system/framework
adb reboot
Click to expand...
Click to collapse
Cool, just so it's clear, and I'm sorry to bug, but I'd have to pull (remove I guess)
the file before pushing the new one in?
Award Tour said:
Cool, just so it's clear, and I'm sorry to bug, but I'd have to pull (remove I guess)
the file before pushing the new one in?
Click to expand...
Click to collapse
meh, you can use another compatable copy. I always just pull it first for 2 reasons: 1) I know its the one I'm using at the moment and 2) if you're gonna be using adb it's just convenient to have it right on c:\, less typing
Award Tour said:
Oh okay, I think I'd prefer using ADB too. What command would I use to push the files?
Click to expand...
Click to collapse
adb push <filename> </target dir/targetfilename>
Read this guide, very informative on ADB
SteelH said:
Nothings attached.
Click to expand...
Click to collapse
oops my bad...it's attached now
nebenezer said:
you can either figure out how to make them Metamorph compatible (sorry, can't give you advice on that, never done it)
Or you can put the images in the correct folder of whatever .apk they go in and make a flashable update.zip, basically replacing the existing .apk's with the full complete modded ones.
You'll need to put all the modded .apk's into a file structure that mimicks where they would be on the phone and zip that structure up with an update_script and sign the update.zip.
I would highly recommend you unzip some small flashable .zip and poke around in it to see the structure and look at the update_script.
This is a download link to a transparent tray mod I did. It replaces ONE .png but because I chose to make it a flashable .zip it requires replacing the framework-res.apk. Except for the actual .apk's you'll need to put in it, this .zip would be perfectly suitable to use as a base for your mods (and you're welcome to use it). If you did use it you would put your .apk's in the system/framework folder, delete the 3 cert files in the META folder, zip the system and META folders into "update.zip" and sign it using an autosign script.
fire away with any questions
ps, you don't need eclipse or the sdk for any of this but you will need an auto-sign script which is one of the tools in Avabox
AFAIK you couldnt use the emulator in the SDK to preview this stuff anyways because you can't get Sense running on the emulator, not to mention the emulator runs SOOOOO SLOOOOWWWWW. Even if you could get Sense running on the em I would bet you would spend less time making a nand, flashing your mods, checking them out and restoring your nand if you didn't like them than using an emulator to preview this stuff.
Click to expand...
Click to collapse
This was very helpful to me as well; thanks!
Actually I just thought of a question. After you sign the file and it becomes update_signed.zip can you rename it to something else like BlahBlah.zip and have it still flash properly?
Tried twice and it failed. It would create to Meta files and not find the update script. Followed the directions but that still happened; any advice?

[Q] I want to make a theme...

But I don't exactly know how to get there.
I'm runing Wolfbreak's CM ROM V055, afraid to go to V06 because it might break my kernel install(still getting info on just what to do)
What I'm wanting is:
The status/pulldown bars(all icons except Wifi, and I want to keep Cyanogen 6's default slidey bar[the thing that ends up at the bottom]), and the animations from the theme used in SEMPITERNAL's Eternity 2 Build 0003a ROM. That will have to be ported to FroYo, I'm afraid(unless my theory at the bottom of this post will work).
I want the menu from LUCID-X10 by SicNside, with the black BG and white elements, but the png forthat i guess I'll have to negative a white hdpi one.
That's about it, the rest i want from arc theme which is default on my current ROM, including tickboxes, those arrows inside circles, the menu icons, etc.
My theory to sort of make this is to get the two involved APK's(default in CM and default in Eternity) onto my computer, and make them ZIP's. Then i can extract the drawable-hdpi folders from each and paste what I want from Eternity into Arc. Then I can replace the drawable-hdpi folder in the Arc framework file, and zip it at store.
That's where I stop knowing what I'm doing. Searching has not found me a guide on just how to make a framework-res.apk, nor even really making a theme altogether. All i can find is about xml files, resources, never anything about actually making the apk correctly.
Help, please?
I am stuck at the same point as you, I have no idea where to go from here :S
Anyone? I'm sure the two of us aren't the only ones...
Here's a zip of what I want. All I did was:
Took the framework-res.apk from the ETERNITY Rom and from the CM ROM, and pasted the png's i wanted from Eternity into drawable-hdpi-v4 in CM framework. Now, can someone make this work, please?
Its quite easy.
Just select the images you want to change.
Then open the framework-res.apk of your ROM with winrar or 7zip your choice.
Without extracting the files drag and drop the files to the winrar window in the right place. If you want to change images in drawable-hdpi migrate to res/drawable-hdpi and drag and drop images there.
Now close the archive and type this:
Code:
adb push <path to modified framework> /sdcard/framework-res.apk
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
Make sure you take a backup with xrecovery before doing this. If you do something wrong you may end up in a bootloop. In that case just restore from backup and try again!
realunited123 said:
Its quite easy.
Just select the images you want to change.
Then open the framework-res.apk of your ROM with winrar or 7zip your choice.
Without extracting the files drag and drop the files to the winrar window in the right place. If you want to change images in drawable-hdpi migrate to res/drawable-hdpi and drag and drop images there.
Now close the archive and type this:
Code:
adb push <path to modified framework> /sdcard/framework-res.apk
adb shell mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
adb shell dd if=/sdcard/framework-res.apk of=/system/framework/framework-res.apk
Make sure you take a backup with xrecovery before doing this. If you do something wrong you may end up in a bootloop. In that case just restore from backup and try again!
Click to expand...
Click to collapse
Grr, sorry but right now all my failure is just making that less clear. Type that where? Drag the files to the winrar/7zip window? Isn't that where i dont want them?
Ive followed all the different sets of instructions including yours on this forum as closely as i can make sense of them and always end up with a stream of FC's and reboot loops.
EDIT: does it only work on the stock kernel? I'm running Trip's kernel. I just pulled the framework apk then pushed that same apk back and it's still doing it.
EDIT 2: ok no stock kernel and its still doing it WHY THE HELL IS IT DOING THIS?!?!? I FLASHED THE SAME DAMN STOCK FRAMEWORK!
ok if i got the modded framework apk to my sdcard and used root explorer to paste it in, should that work? This laptop might be what's causing it
I have posted few tips here n there when ever people ask about it.
Check this for overall requirements
For your requirement, skip the optimization part out and just do image swap.
Like realunited123 said, dont extract, just open from 7zip, I use Win RAR and drag and drop the new image to the correct folder.
You need to remember few things here, check images name matches against old to new. Other important thing is resolution. you might get in to trouble if you take mpdi and put it to hdpi.
after updating the framwork I made a small template for you guys to play with.
Download attaches zip file open and go to
Framewrok-SJ.zip\system\framework folder and drag and drop the modified framework-res.apk
Dont try to install the attached file. its only a template for you guys to start working on....
After drag and drop you will see zip file size increased.
Simply copy to SD card and install via Xrecovery
You can try any framework to install like this without adb stuff
Remember to make a backup... because you will definitely screwup... we all have...... LOL
Realorasz said:
ok if i got the modded framework apk to my sdcard and used root explorer to paste it in, should that work? This laptop might be what's causing it
Click to expand...
Click to collapse
Well my friend if you have already did this. it will be your first screwup
Dont use root explorer or titanium for this work. Read this post I mention yesterday.......
Shiwantha said:
I have posted few tips here n there when ever people ask about it.
Check this for overall requirements
For your requirement, skip the optimization part out and just do image swap.
Like realunited123 said, dont extract, just open from 7zip, I use Win RAR and drag and drop the new image to the correct folder.
You need to remember few things here, check images name matches against old to new. Other impotent thing is resolution. you might get in to trouble if you take mpdi and put it to hdpi.
after updating the framwork I made a small template for you guys to play with.
Download attaches zip file open and go to
Framewrok-SJ.zip\system\framework folder and drag and drop the modified framework-res.apk
Dont try to install the attached file. its only a template for you guys to start working on....
After drag and drop you will see zip file size increased.
Simply copy to SD card and install via Xrecovery
You can try any framework to install like this without adb stuff
Remember to make a backup... because you will definitely screwup... we all have...... LOL
Well my friend if you have already did this. it will be your first screwup
Dont use root explorer or titanium for this work. Read this post I mention yesterday.......
Click to expand...
Click to collapse
Well i did try swapping mine with the framework apk in the froshed zip. I'll try it with yours though.
Shiwantha said:
I have posted few tips here n there when ever people ask about it.
Check this for overall requirements
For your requirement, skip the optimization part out and just do image swap.
Like realunited123 said, dont extract, just open from 7zip, I use Win RAR and drag and drop the new image to the correct folder.
You need to remember few things here, check images name matches against old to new. Other impotent thing is resolution. you might get in to trouble if you take mpdi and put it to hdpi.
after updating the framwork I made a small template for you guys to play with.
Download attaches zip file open and go to
Framewrok-SJ.zip\system\framework folder and drag and drop the modified framework-res.apk
Dont try to install the attached file. its only a template for you guys to start working on....
After drag and drop you will see zip file size increased.
Simply copy to SD card and install via Xrecovery
You can try any framework to install like this without adb stuff
Remember to make a backup... because you will definitely screwup... we all have...... LOL
Well my friend if you have already did this. it will be your first screwup
Dont use root explorer or titanium for this work. Read this post I mention yesterday.......
Click to expand...
Click to collapse
Is it just me is are you a savior!! Thanks, it's working now!!!!
Hey, by the way, can you teach me how i can make an xrec zip of a dialer mod I made? I want to post it on the CM 6 thread so people can like actualy install it but the only way i currently have for that is adb(which works on apps, but not themes...)
And one more thing, Is any sort of file transfer possible with ADB, or will i have to stick with WiFi File Explorer?
Realorasz said:
Is it just me is are you a savior!! Thanks, it's working now!!!!
Hey, by the way, can you teach me how i can make an xrec zip of a dialer mod I made? I want to post it on the CM 6 thread so people can like actualy install it but the only way i currently have for that is adb(which works on apps, but not themes...)
And one more thing, Is any sort of file transfer possible with ADB, or will i have to stick with WiFi File Explorer?
Click to expand...
Click to collapse
Thats good news.. one less problem to deal with....
create a folder call app on your pc and drag it to system folder in the zip file.
So you should have framework and app folders inside of it.
then copy Phone.apk & Contacts.apk and try to install via xrecovery.
there is a chance you might not be able to install as my initial signing of Zip file dosent included app folder and so MANIFEST.MF & CERT.SF dont have reference. on the other hand during installation Xrecovery dont check
key signature.
I didnt test this way so try, no harm will come to your phone.
Dont know about wifi explorer much. Im testing with adb generally. only final version im publishing in xrec.
Can you teach me how to make that meta inf stuff?
Sent from my X10a using XDA Premium App
Realorasz said:
Can you teach me how to make that meta inf stuff?
Sent from my X10a using XDA Premium App
Click to expand...
Click to collapse
You cannot, after putting stuff, need to sign by app sign tool or there are alternative called APK manager... search its on XDA i think........
I'm not getting it. The update script ange all that forxrecovery...?
Sent from my X10a using XDA Premium App
Realorasz said:
Can you teach me how to make that meta inf stuff?
Sent from my X10a using XDA Premium App
Click to expand...
Click to collapse
In META-INF create \com\google\android folders for update-script file.
Make update-script a text file containing the following
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
Be sure to add an extra blank line after "show_progress 0.1 10"
Compress META-INF and system folders to a zip, then move to your sd and sign with signAPKtic which is a free app in the market. Use "test keys" to sign. (signAPKtic is easiest to me,or you can use 1 of the methods Shiwantha suggested to sign)
I would also suggest zipaligning your apks before adding them to optimize your phone's performance when accessing them. Search zipalign on XDA and you'll find what you need...
*Edit- Also, X10 Mod Tool is great for pushing/pulling apks via adb without all the typing. I use it a LOT when testing different pieces of themes.
AyDee said:
In META-INF create \com\google\android folders for update-script file.
Make update-script a text file containing the following
Code:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
Be sure to add an extra blank line after "show_progress 0.1 10"
Compress META-INF and system folders to a zip, then move to your sd and sign with signAPKtic which is a free app in the market. Use "test keys" to sign. (signAPKtic is easiest to me,or you can use 1 of the methods Shiwantha suggested to sign)
I would also suggest zipaligning your apks before adding them to optimize your phone's performance when accessing them. Search zipalign on XDA and you'll find what you need...
*Edit- Also, X10 Mod Tool is great for pushing/pulling apks via adb without all the typing. I use it a LOT when testing different pieces of themes.
Click to expand...
Click to collapse
I think adb mask controller can do it in the zipalign tab> zipalign /system/app button.
And what format does the text file need to be in?
Signapktic is either telling me the zip doesnt exist or gives me an unzp error... and I supposed to me signing the apk's or the zip?
EDIT: I think I got it. Zip signer instead of signapktic. Let's see what my phone does.
Ok it looks like it worked.
Make sure there are no spaces in the zip's name. Looks like you got it!
Sent from my X10a using XDA App
AyDee said:
Make sure there are no spaces in the zip's name. Looks like you got it!
Sent from my X10a using XDA App
Click to expand...
Click to collapse
So does that mean it worked for you?
EDIT: Oh, I'm stupid, I didn't even post it. Can you test it please?
It looks like it's signed already. Are you asking me to test the app or signature?
Sent from my X10a using XDA App

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!

How to create your own tw rom on your phone using root explorer

In this tutorial I will show you how to create your own T.W. rom using your GS3 and Root Explorer. There are many ways you can create a rom but not everyone has the time to sit at a computer every night. However, your phone is always on you and can find a few minutes here and there to create your own masterpiece.
For the sake of this tutorial, we will name our new rom "SLICK".
Here are a few things you will need...
1. The rom base from Scottsroms. I'm NOT talking about Cleanrom but the unmodified stock rooted rom.
2. Root Explorer.
3. Script Manager
4. Any mod you can flash or come up with on your own.
1. GET STARTED!
Download the base rom to your phones EXT-sdcard and extract it using Root Explorer. After it's extracted the new unziped rom will be located in /storage/sdcard0/SpeedSoftware/Extracted. The extracted rom is now your new base. At this point it would be a great idea to move it to your EXT-sdcard and create a new project folder for it and label the folder "Project SLICK". inside the folder is your rom. lets rename that rom "SLICK".
Lets open your new SLICK rom. You should have some folders...
BOOT IMAGE
DATA
META-INF
SYSTEM
3. THE SYSTEM FOLDER
/SYSTEM/APP
Most of your work will done in the System folder so lets open that up. This is the heart of your rom! There are many folders here but lets start with the app folder. This folder has every app installed in your rom. This is a good time to remove the bloat you don't want in your rom. Go ahead and delete the apk's you don't want or need.
/SYSTEM/BIN
Here you can speed up your system or make it more battery efficient by deleting things like "mpdecision" and things like that. Be careful what you delete though. In general you won't do much in here.
/SYSTEM/BUILD.PROP
Here you can change values or add values. The one value we are concerned with is "ro.build.display.id" This build property's value will be displayed in the end users settings menu under "about phone". So let's give this property the correct value "ro.build.display.id=SLICK ROM v1.0" The rest of the build properties you can do as you wish. Build.prop is simply a text file. You can use the text editor built into Root Explorer.
/SYSTEM/CSC
Open this file and you will see more files. Listed is "feature.xml". Here you can edit values for various items for texting and mms.
/SYSTEM/ETC
Here is where you will find a folder called "init.d". Located in this folder are various text files. The text files are scripts that are told to run when your phone boots. You can add or modify to the existing scripts or create a new text file.
So we went over a few of the basics of modding your new rom and molding it into something you can call your own but does it work??
4. TESTING YOUR NEW BASE.
So we have already modified our rom a considerable amount and should have a good solid base. Before we go any further we should really test things out first. If we did something wrong earlier we will at least have an idea where to look. So lets flash our new rom. Go to you EXT-sdcard and find our project folder. you should still have your SLICK file. Zip this file with Root Explorer. Make sure you have a good battery and a cool environment because it's going to take your GS3 about 30min of hard work to zip this file. When that is finally completed, flash your new rom located in /storage/sdcard0/SpeedSoftware/Archives. Flash it just like you would any other rom.
Test your new rom out on your GS3 and see how things are running. Check your existing modifications you did earlier. If everything looks good, we can continue modding. If not you will need to go back to your base to see where you went wrong. This is also a great time to check your init.d scripts. One way to do this is to download "Script manager" from the market and click on your init scripts to read there log. It will tell you if something went wrong.
If everything is looking good, we can continue modding...
5. THE MODS
So we have that nice clean base but what about all them mods in the roms we download and flash everyday? There are a few different ways we can do this and we will start with the easiest but first, do a nandroid backup of your new base. If one of your mods you perform next goes bad it's simply quicker to recover. Now, If you have flashable zips of some of the mods you like then you can flash them now and make sure they are working the way they should in your rom. Remember, just cause we have the d2vzw does not mean mods from the sprint or T-mobile won't work on our devices. Sometimes it's worth a try. It's all about which firmware they are on and what has changed with the firmware.
So we flashed a few mods but don't have everything we wanted. At this point you are left with only one option and that is to get on that PC of yours and learn to decompile a APK. I may touch on this subject later as it is a bit more involved for someone new to this sort of thing.
6. UNDERSTANDING THE FLASHABLE ZIP
The alternate method of a flashable zip is to extract your flashable using Root Explorer and picking it apart. For example we will use "Lean Kernel" and kill 2 topics with one stone. If you unzip the kernel you will see...
BOOT.IMG
META-INF
SYSTEM
As you can see there are some familiar files to us just like when we extracted our base rom in the beginning. Basically when you flash a mod like this or any flashable for that matter, it installs files into your rom in certain places. In this example we will be installing in BOOT.IMG and SYSTEM. But what? And what is that META-INF file for? Well this META-INF file is what tells your rom what files and what to do with those files. Inside META-INF is a text file called an "updater script".
Here is what it looks like...
Code:
show_progress(0.500000, 0);
mount("ext4", "EMMC", "/dev/block/mmcblk0p14", "/system");
package_extract_dir("system", "/system");
set_perm(0, 0, 0777, "/system/etc/init.d/00leanKernel");
unmount("/system");
assert(package_extract_file("boot.img", "/cache/boot.img"),
write_raw_image("/cache/boot.img", "/dev/block/mmcblk0p7"),
delete("/cache/boot.img"));
show_progress(0.100000, 0);
Line 2 shows it mounting the system so we can write to it.
Line 3 shows us extracting the entire directory of the system file in the flashable into the system file of our rom.
Line 4 shows we are setting permissions for one of the system files we just installed in the rom. In this case it is an INIT.D file.
Line 5 shows us returning the system to an un-writable state.
Line 6 shows we are now installing the other file called BOOT.IMG.
So we installed BOOT.IMG and the SYSTEM file. The BOOT.IMG file is usually only found in a rom or kernel zip so most of the time you won't see this file in a flashable but I wanted to use this as an example to show a bit about the kernel side of things.
Ok, so lets get back to the original files of this flashable zip. The updater script stated we installed a new system file into the rom so whats in there? If we open the SYSTEM file from our flashable with Root Explorer you will find a file hierarchy...
SYSTEM
-- ETC
--- INIT.D
---- "00LEANKERNEL"
-- LIB
--- MODULES
---- Listed here are a bunch of ".ko" modules and i'm not listing them all.
So whats the point of all this? Well lets say when we originally debloated our rom in the begining we could of included some of our flashable mods like a custom kernel before we zip the rom to test the base. So in this case we can manually install this kernel before we zip the base. We can take the BOOT.IMG from our extracted kernel and replace the BOOT.IMG in our extracted rom. We only need the files from the flashable so we need to copy and paste the "00LEANKERNEL" file from our flashable to our roms /system/etc/init.d folder. We can also take those ".ko" files from the flashable and dump those into the /system/lib/module folder and we are done. You have now manually installed a kernel into your base rom before you zipped it. Now when you zip your rom and flash it, your new base rom will boot with your custom kernel. Since we manually installed the kernel we don't need the META-INF file provides an auto install script for installing through recovery. Technically we could take all of our flashable mods, extract them, look at the file hierarchy and copy and paste the those files to our extracted base rom. That way we can zip our rom and test it with the mods right off the bat. You can really make things quicker this way and is in general the way to go.
I think it's rather important to fully understand a flashable zip. How it's built and how it completes it's task. It's used so often and makes mods so incredibly easy to install but it is also what installs our rom! One of the files we see when we open "slick" is a META-INF and there inside is the updater script to flash the rom. Again we are doing the same thing as we do with the flashable mod but this time we are installing a lot more files with a lot more permissions. It is the exact same thing as shown above just a bit more extensive.
7. PUT THE PIECES TOGETHER
Ok so we have our base rom running on our phone and possibly a few mods installed. We also have our extracted and debloated "slick" rom on the EXT-sdcard inside our project folder. The next part is rather easy if you understand how those flashable mods were installed. If you understand the whole flashable and its files, your better off just extracting them and then copy and paste them where they need to go. After you have all your mod files in place you can now zip your official "Slick" rom using Root Explorer of course. Prepare yourself for another 30 minutes for it to zip. After it's zipped your done. You have now created your first fully modded rom! However...
Lets say you don't get the whole flashable thing and or you had made some other changes to the rom while you were testing. Lets say you flashed some mods and created a few init.d scripts or the build.prop along the way. NO WORRIES! We can put the rom together another way. A lot of the mods you flash will install files in some usual areas of the rom like your Framework folder and such. Lets just say we don't know though. You can actually copy complete folders from the rom you are running right there and now and paste them into your extracted "Slick" base rom using Root Explorer. So you can take "/system/framework" from your currently running rom, copy it, and paste it in "/storage/EXT-sdcard/project folder/slick/system/framework". In short just take your copy of the framework file and put it in your extracted base and paste it. Root Explorer will then ask you if you want to replace this file and click yes. You have just transferred any modded file that might have been in framework to your extracted rom. Any folder you may think was modded, simply copy and paste it to your extracted base rom on your EXT-sdcard. Once you think you have it all the modded files transferred you can zip your new "Slick rom! Flash and enjoy!!
FINISHED
So we have now completed our own rom on the device itself. It's really not too difficult just a bit more time consuming with zipping and that. However, you may need to do a bit more research on how to decompile and recompile an APK. This is one of things that can really be a pain to setup. It's again the basics that will kill you. The whole PITA is not decompiling or making changes to a framework file, it's setting up the environment that sucked for me. You have to get the Java and files in order and all the little crap to get it to work. IMO, if you haven't decompiled an APK yet it's really not difficult at all. Like I said. It's the basics. I encourage you to learn this because it's so freakin easy after it's all setup and you will be able to do so much more with your rom. Once you get this APK thing down don't be afraid to take someone elses work and reverse engineer it. Try to figure out what that developer did to accomplish what he wanted. It's a great way to learn and thats what it's about.
I may add to this somewhere down the road but for now it's all I have. I hope this helped and motivated someone to create a rom and begin there journey to become developer someday! We can all use fresh ideas for development. There is so much more to come for Android so get your hands dirty and share!
Thanks guys!
Ha never really thought of doing this on the fly with my phone. Even though all the right stuff was sitting in my face thanks for opening my eyes razz1
Sent from my SCH-I535 using Tapatalk 4 Beta
dincdoes.me said:
Ha never really thought of doing this on the fly with my phone. Even though all the right stuff was sitting in my face thanks for opening my eyes razz1
Sent from my SCH-I535 using Tapatalk 4 Beta
Click to expand...
Click to collapse
It's another way. May not be the fastest way but it's another option. I also wanted to write this as a general rom creation and learning some basics. It's always the basics that will kill a project and motivation. I would like to see a complete newb to be able to complete a rom with this tutorial. Then I accomplished something. Going to have to finish this tomorrow though. It's taking longer than I thought lol.
Yea I mean I'm a newb at doing it from my phone if that counts =) .. What explorer do you like to use to repack the zips. I'm sure I'll try this method soon to play while bored at work. Rom tool box will help with boot animations, fonts and transition animations too take care thanks for giving our community some new skills I'm sure it will help out down the road.
Sent from my SCH-I535 using Tapatalk 4 Beta
Thank you for this post. This will definitely get me to try and make my own ROM the way I like, also I might just learn some new stuff. Great post thanks again
Sent from my SCH-I535 using xda app-developers app
Nice tutorial.
It's a great way to show what can be done just from your phone.
:good:
Right on man. Been waiting for this. Thank you.
Sent from my SCH-I535 using xda app-developers app
dincdoes.me said:
Yea I mean I'm a newb at doing it from my phone if that counts =) .. What explorer do you like to use to repack the zips. I'm sure I'll try this method soon to play while bored at work. Rom tool box will help with boot animations, fonts and transition animations too take care thanks for giving our community some new skills I'm sure it will help out down the road.
Sent from my SCH-I535 using Tapatalk 4 Beta
Click to expand...
Click to collapse
I use androzip man.
Sent from my SCH-I535 using xda app-developers app
More added
So would I make, say ROM manager a system app? Just copy the apk into the /System/App folder?
Evil Genius Jr. said:
So would I make, say ROM manager a system app? Just copy the apk into the /System/App folder?
Click to expand...
Click to collapse
Yes, but not all apps you download from google play work in /system/app. Some want to be installed into /data/app. However /data/app doesn't exist till after the rom is booted. You would need to add the folder to your extracted rom and modify the updater script.
razz1 said:
Yes, but not all apps you download from google play work in /system/app. Some want to be installed into /data/app. However /data/app doesn't exist till after the rom is booted. You would need to add the folder to your extracted rom and modify the updater script.
Click to expand...
Click to collapse
You are the fu**ing man razz1.
Sent from my SCH-I535 using xda app-developers app
That's about all I have for now. OP completed!:sly:
Hello. Ok so I created a ROM what I call MyTWGE (Tuchwiz Google Edition). Followed the instructions, unzipped the stock Verizon OS went into the -app- folder deleted all the Verizon, Samsung and Google apps (only the ones that are download able from Google Play). Replaced the stock launcher with the 5x6 version that I extracted from another zip, replaced the camera with the Google edition camera (download able from GP), replaced the keyboard with the Note2 keyboard (also unzipped from another zip). Looked around and deleted a few more files I found that were connected to some Samsung apps and zipped it up. Flashed the zip yesterday onto the phone and it's ALIVE working.
Thank you for your patience to write up all these instructions. I previously used TB to debloat my phone and that was it, learned a few thing thanks again
Sent from my SCH-I535 using xda app-developers app
Lehocki said:
Hello. Ok so I created a ROM what I call MyTWGE (Tuchwiz Google Edition). Followed the instructions, unzipped the stock Verizon OS went into the -app- folder deleted all the Verizon, Samsung and Google apps (only the ones that are download able from Google Play). Replaced the stock launcher with the 5x6 version that I extracted from another zip, replaced the camera with the Google edition camera (download able from GP), replaced the keyboard with the Note2 keyboard (also unzipped from another zip). Looked around and deleted a few more files I found that were connected to some Samsung apps and zipped it up. Flashed the zip yesterday onto the phone and it's ALIVE working.
Thank you for your patience to write up all these instructions. I previously used TB to debloat my phone and that was it, learned a few thing thanks again
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
Lol the whole time I was reading this I was waiting for you to say something didn't work out for you but it all did I guess. Nice!!
Yeah running for the past 24h no problems everything works. Thanks
Sent from my SCH-I535 using xda app-developers app
---------- Post added at 02:24 AM ---------- Previous post was at 02:07 AM ----------
Only thing that that's annoying is the wifi in the taskbar. I read in one of the posts that I have to go into systemui and some other files within n delete lines 12 through 21 but that didn't work , am guessing I need to decompile systemui to do that. The person in the post didn't clarify and I'm not ready to do that yet. Reason is I don't know anything about programming or linux or decompiler or anything like that. Deleting files I can do replacing some sure. But I'm happy my first attempt to mix something together worked and I'll keep doing it till I actually figure out what it is that I am doing. Thanks again for the post
Sent from my SCH-I535 using xda app-developers app
Yea. Follow Didacts write ups to get you through it. It's all in framework res apk.

Categories

Resources