[script] Generic, fully automated Deodexer (OS X, Linux... Cygwin) - Atrix 4G Android Development

This is a script that I made for my own use awhile ago because I couldn't find an OS X deodexer. I recently modified it for use with Linux, and if you're on Windows and have Cygwin, well, it works with that too.
What is it:
It's a generic deodexer, for any ROM, and theoretically for any recent phone. What do I mean by theoretically? Well, the Atrix is my first and only Android so far, but I expect to be able to use it when I get others It should work with any phone that has all its framework in /system/framework and all its apps in /system/app. Any phone that doesn't have that doesn't qualify.
How does it do it:
It uses the phone's own BOOTCLASSPATH and patches together any additional necessary dependencies from /system/framework. It then uses the phone's own files to create the deodexed frameworks and apps (via JesusFreke's baksmali/smali). All the other deodexers I've seen use canned files that have been created ahead of time, or require you to specify the proper dependencies for your phone. This is fully automated and requires almost no intervention on your part. This means you don't have to go looking for "the right" deodexed files for the new stock ROM you just flashed, or know anything about dependencies. All it asks for is Super User permission at the very start (which you need to allow and check "remember", because it will need it later).
When will it be done:
In about a half hour from when you start. At least that's how long it takes on my Core2Duo 2.53Ghz, 4GB RAM MB Pro. There are 250+ files to decompile and recompile. It's a lengthy process.
Prerequisites:
1. You must be rooted with Super User installed.
2. USB Debugging must be turned on on your phone. Settings > Applications > Development > USB Debugging.
3. You need Java on your computer, and it has to be in your path (you can test by opening a terminal (or cmd for win) and typing 'java' on the command line. If you see help for that command, you're good).
There are 3 scripts:
1. deodex.sh: This is the main deodexer script. Run this to deodex a ROM for the first time. It will do its thing, and once it tells you it's rebooting, you should be deodexed.
2. postcompile.sh: If you restore to a non-deodexed state somehow and you have run deodex.sh previously on the same ROM, you can use this to skip the lengthy compiling and just deodex with the files you already created (they will be in framework.out and app.out on your computer).
3. restore.sh: Use this to return your phone to an odexed state. Obviously, you have to have used deodex.sh to deodex first.
After running deodex.sh, you may want to zip up and save framework.out, app.out, and the system folder in the deodex folder. These contain the deodexed files and your original files for the current ROM. If you ever want to use the restore or postcompile scripts, you need these.

please help
line 15: ./bin/osx/adb: No such file or directory
Error in previous command above line 18.
Exiting.
logout

cyrux said:
please help
line 15: ./bin/osx/adb: No such file or directory
Error in previous command above line 18.
Exiting.
logout
Click to expand...
Click to collapse
Interesting, either it's saying you have no /data/tmp folder on your phone, or you're missing ./bin/predeodex.sh.
Are you able to check if your phone has a /data/tmp folder? Also, a step I forgot in the OP. Do you have USB Debugging turned on?
*edit* Okay, so I downloaded my zip from here just to be sure, and tested only the section you're having trouble on by making it quit out right after the part you error'd out on. I've verified that predeodex.sh is working, so /data/tmp must be missing on your phone?

Related

creating personalized roms

my question is this, say for example I have my phone setup just as I like with the theme of my choosing, htc music app instead of the stock android app in the cyanogen mod. i would like to be able to create a rom from this setup that I could then just load on my phone as oppsed to loading a cm mod, then installing music player, then installing the theme. before the flaming begins, i tried the search to no avail. i am aware of how to sign the zip and all of that. just a point in the right direction would be MUCH appreciated.
Its something I would like to be able to do as well. According to Haykuros twitter hes going to be making a video about android rom cooking soon so that should help
jholt0130 said:
my question is this, say for example I have my phone setup just as I like with the theme of my choosing, htc music app instead of the stock android app in the cyanogen mod. i would like to be able to create a rom from this setup that I could then just load on my phone as oppsed to loading a cm mod, then installing music player, then installing the theme. before the flaming begins, i tried the search to no avail. i am aware of how to sign the zip and all of that. just a point in the right direction would be MUCH appreciated.
Click to expand...
Click to collapse
This should've gone in the Q&A section. Will probably get locked soon.
But in response to your question, I guess you could grab the CM rom, then grab the theme you use and overwrite the files in the rom, and then overwrite the music app with the HTC music. Resign and you got your update.zip customized how you want it.
xidominicanoix said:
This should've gone in the Q&A section. Will probably get locked soon.
But in response to your question, I guess you could grab the CM rom, then grab the theme you use and overwrite the files in the rom, and then overwrite the music app with the HTC music. Resign and you got your update.zip customized how you want it.
Click to expand...
Click to collapse
Thanks for the help and my apologies for the wrong section
how do you resign it?
joey3002 said:
how do you resign it?
Click to expand...
Click to collapse
by searching.
Stericson said:
Automatic version!
Do not use this to sign APK files in Vista or windows 7! It will cause your theme to loop phones when placed on a device. Only use this to sign update files if your using those O/S's
Note, this will not work if your SDK or the path that you place this in has any spaces in the dir name!
An Example of this is c:\users\Nikki and Stephen\sdk\tools
Try to put the SDK and the contents of the zip in a dir where the names are all together and not like the one above.
I have made a batch file that will automate the entire process of setting up to use the signing tool made by JF. This batch file will set the CLASSPATH, set the PATH, install the registries, and will even allow you to sign files manually if you wish. I plan on building onto this batch file to include other things. However, for the moment, it will only include what you see here.
In order to use this you should have downloaded the sdk already. Simply extract all of the files into the tools dir of your sdk, and run autosign.bat follow the instructions and go through the options one by one, starting with 1 working through 4. You can however, put the contents of this zip anywhere on your computer and it will work. It is just better to put them into the tools dir of your SDK. Especially for the consideration of future versions.
Autosign .zip: http://www.fightforthepits.com/Androidstuff/signing.zip
Want to set up the signing tool manually?
Here is the link for the signing tool: Http://www.FightForthePits.com/testsign(2).zip
Before using this you need to know how to set this up:
Now you will need to add the tools dir of your sdk to the environment variable CLASSPATH.
FOR XP:
Right click on My Computer click properties, then choose the tab that says advanced.
Click the button that says environmental variables.
Go to system variables find the one that says CLASSPATH
double click it
go to the end of variable value.
There should be a semicolon ; at the end, type in the path to the testsign.jar located in the tools directory of your SDK
for example the path to my testsign.jar was c:\sdk\android-sdk-windows-1.0_r1\tools\testsign.jar
If CLASSPATH is not in your system variables then create it.
Secondly, Find the system variable called PATH and add to the end of it, the full path to your sdk directory.
For example, mine was c:\sdk\android-sdk-windows-1.0_r2\tools
FOR VISTA:
Open a cmd prompt.
Replace THEEXACTPATHTO-TESTSIGN with the path to the dir that holds the file testsign.jar.
Type:
echo %CLASSPATH%
If it is returns %CLASSPATH%
Type the following:
set CLASSPATH=THEXACTPATHTO-TESTSIGN\testsign.jar
If it comes back with something else then
Type the following:
set CLASSPATH=%CLASSPATH%;.;THEXACTPATHTO-TESTSIGN\testsign.jar
For Example, when I type this it looks like:
set CLASSPATH=%CLASSPATH%;.;c:\Android\SDK\tools\tests ign.jar
To set the PATH
Replace THEEXACTPATHTO-SDK with the path to the tools dir of your SDK.
Now type:
set PATH=%PATH%;.;THEXACTPATHTO-SDK\tools
For example, when I type this out it looks like this:
path-%PATH%;.;c:\Android\SDK\tools
Now through doing this you have done two things, first off you have made the resigning process extremely easy, secondly you will not have to cd to the tools dir of the sdk to use adb or any other tool in the sdk.
Signing the Files:
Now right click the reg file that you extracted and choose to install it, or merge.
Now, right click an apk, do you see an option that says ResignApk? That's how you will resign your .apks and .zips.
When you choose it a cmd window should open for a few seconds and then close. the file you signed will be overwritten with the new resigned file.
If you find the right click menu not working for some reason you can type the following in cmd to sign your files: java testsign whateverfiletosign
Click to expand...
Click to collapse
.apk's not showing up after flash in resigned .zip
Ok, so I've created a ROM to my liking. All the .apk's I normally use and got rid of the ones I don't. My problem is after I customized the ROM and flashed it none of the .apk's I added showed up. The only ones that showed up were the paid apps. I never opened the .apk's and made changes. I assume I don't need to change them to .zip resign and back to apk. Do I? I am using Windows 7 though and am able to resign no problem. Thanks to anyone who replies.

Edit roms before flash

I want to make my own rom based on the cyanogen rom. I want to add a few apps and remove a few that already exist.
I have tried using the adb but it wont uninstall the ones I dont want.
I would like to mod a rom before I flash it, Is there a how to for this?
Thanks,
Dubstar_04
I dont think there's a how-to, but I can type a quick one in a jiffy;
Tools;
A computer (Windows PC in this example)
7zip (google it)
The rom you wish to modify.
Either JRE or JDK (so you can run java apps) (google it)
JF's testsign.jar (google it)
Method:
Install 7zip in your computer. Also install the Java runtimes so you can run java apps through the console (ahem, command prompt).
Unzip (if it's not already) your testsign.jar and place it somewhere easy on your HDD (C:\, for example, doesn't get easier than that). Also place the rom you wish to modify in the same folder.
Open the update.zip file (or whatever it's called) with 7zip (you can do this by either using the command dialog (right click) and selecting 7-zip > Open Archive, or by going right-click > Open With > Choose Default Program and select "Always open with this program" with 7zip FM (file manager)).
Once it's open, navigate to the folder system/app and remove in there any apks you don't want in there (for example, I always remove VoiceSearch.apk, VoiceDialer.apk, SystemUpdater.apk, Talk.apk, and when available, SpareParts.apk, com.mp3.amazon.apk, and a few others). That is basically the uninstall process. If you have the apks for the apps you wish to install, you can drag them into the 7z windows at this point too (if you have hboot spl, you have a lot of space in system, so dumping them here is safe). If you don't have the apks, but you have them installed in your phone, you can use adb to get them. Just make a folder in your desktop called app (or whatever you wish) and run adb with your working directory in the desktop (C:\users\myname\desktop). The adb command would be: adb pull data/app app. This will place all the contents of downloaded apps (free ones) inside the app folder in your desktop as apks. I don't know that there's anything you can do at this point about paid apps.
Anyway, once you're done deleting and adding apks to your zip. Close the 7zip window (it saves the changes automatically, you should have kept the window open through the whole process).
Open up the command prompt again, and change your working directory to C:\ (usually cd ../..), then, if you placed all like I told you to, you can just run; java testsign updatenamewhateveritis.zip
Ofcourse, replace updatenamewhateveritisi.zip with the name of the update, but I recomend renaming it to update.zip beforehand so you don't have to type a lot.
After it's done signing, the rom is ready to flash.
Good lucks to you
Wow...Good explanation.
I have few questions.
-Do i need the jar sign thing?
-Can I create a flasheable update.zip to "add/remove" apps to a fresh flashed rom? (I mean, flash a custom rom and then apply update.zip which can add and remove apk ), or do you recommend to modify the zipped rom instead of creating a update.zip ?
Many thanks
Depending on your recovery you can just toggle on/off if you need a signed zip or not. This is a very old thread and I imagine it was much harder to push apps into /system back then or to remove /system apps for that matter. With root access there are many apps you can do this with now, or with adb or terminal emulator
What is your purpose for this by the way? I feel there may be easier ways to accomplish what you're after
Sent from my GT-I9100 using xda premium
Thanks for answer
Yeah...it's and old thread, but actually it saved me to post a similar topic thread again :good:
My purpose? Not developing anything nor cooking rom. I just found at http://wiki.cyanogenmod.com/wiki/Barebones that i can safely uninstall apks that i don't use. So i uninstalled some of then, and i was thinking, in case of reinstalling the rom or flashing a new version of it, how to erase the unusefull apks(for me at least) in one step.
I think the easiest way is removing them from the zipped rom before flashing.
What do you think?
yes you can unzip and rome .apks, but then you will have to sign it unless your recovery allows unsigned zipps. why not flash the rom as is, remove all the unwanted, add what you like, then make a nandroid copy of the way you like it. this can then be flashed whenever
Sent from my HTC Vision using xda premium
Oh...the sign thing!
Anyway, there are few useless apks, so i think i can do it manually after flashing rom.
Hey. I'd like to know what nandroid is...
I use CWM recovery to backup/restore data/rom and I use Titanium Backup for the applications. So what the **** is nandroid. I mean, is an apk? Is a boot tool? And what can i do with it?
Thanks a lot dude!
it is the backup you make in your recovery, you will make either a nandroid backup or bart backup. depending how it is done it will be an exact copy of your rom, apps, call log, etc. any thing stored to you phone @ that "recovery" point
it gets its name from nand (the nand flash memory) and android, some recoveries may just call it a backup
Sent from my HTC Vision using xda premium

[Tool] Inject Apps to ROM for Installation

If you're like me, you probably have installed a new ROM at least once a week. I usually use Titanium Backup to restore all my Apps, but it takes quite a long time since I use a lot of Apps. Also, if you don't have the Pro version of Titanium Backup, you will need to click through the Install button for every App you want to install.
This program is a simple way to fix that. What it does is it injects you Apps as part of the ROM when you install a new ROM. This way, as soon as you install your ROM, your Apps will already be installed as part of the ROM.
I have only tried this with the latest Team Whiskey Onyx ROM, but it should work with most, if not all ROMs.
Also, not all Apps can be installed this way, especially if you try to include the data. YMMV.
INSTRUCTIONS
Prepare your computer
1. Install Java JRE and SDK.
2. Install 7-Zip. It can be found here: http://www.7-zip.org/
3. Download Testsign.jar. It can be found here: http://www.robmcghee.com/android/creating-an-android-update-zip-package/. Download the file "Testsign.zip" and extract it. Testsign.jar should be in there. You will need this later.
4. Set up your windows Path Environment.
a. Go to your Control Panel and open "System."
b. For Windows 7, you will need to click on "Advanced System Settings."
c. Go to the "Advanced" tab.
d. Click on the "Environment Variables" button.
e. Under "System Variables" find "Path." Select it and click on the "Edit" button.
f. A window should pop up a field for "Variable value." In there, you will want to add your 7-Zip and Java SDK bin path. At the end of "Variable value," add (without the quotes)
";C:\Program Files (x86)\Java\jre6\bin;C:\Program Files\7-Zip"
It might be slightly different for you if you're not using a 64-bit Windows. Basically, this step is to allow you to run the Java and 7-Zip command-line tools from anywhere in your system.
5. Reboot your computer.
6. Test to make sure you can run the Java tools and 7-Zip tools. Do this by running "cmd." A command-line prompt should appear. In there, type "java" and hit enter. The usage info for running java should appear. Now type "7z" and hit enter. The usage info for 7-Zip should appear. Your computer is now set up to run my batch file.
Prepare your Apps
WARNING: Not all Apps work using this method, and not all data can be restored using this method. If it doesn't work, you can restore it using Titanium Backup and it should work fine. Once you find that a certain App doesn't work, you should probably remove it from your App/Data folder (read below) so it doesn't install next time using this method.
1. Get all your APKs and data. The easiest way I know how to do this is by using Titanium Backup to make a backup of all my Apps.
2. Use Titanium Backup and back up your Apps.
3. Inside your SD Card, you should have a TitaniumBackup folder. All your Apps and data are in here. Every App you have backed up in Titanium should have 3 files. A .properties file, a apk.gz file, and a tar.gz file. The apk.gz file will contain your APK. The tar.gz file will contain your data. You can extract these files using something like WinRAR.
4. Extract your APKs and put them in a folder called "data\app". Extract your App's data and put them in a folder called "data\data". Your "data\data" should look something like this "data\data\com.appname".
5. Once this is complete, you can use this APK/data set for any future ROMs.
Create your ROM with your Apps
1. Put AppToROM.bat, testsign.jar, your data folder, and your ROM's zip into the same folder.
2. Drag your ROM's zip onto AppToROM.bat.
3. The batch file will now start creating your new ROM for you. It will do the following steps:
a. Extract your ROM.
b. Copy your data to the extracted ROM folder.
c. Zip everything back up.
d. Sign the new Zip.
4. When everything is done, you should have a "NewROM.zip" file. Use this new Zip file to install your ROM like you normally would.
Disclaimer:
I take no responsibility for any harm that this may do to your device. All of the tools here, except the bat file, I did not write. I just created a bat file that puts all the tools together to make it easier to install your Apps after installing a new ROM.
or you could just open your update.zip and place your apks in system/app re-zip and flash. Done this multiple times and it works. just need to keep a copy of your apks on your computer. ill try this method tonight. thanks
If you put it into "system/app" it will install it as a System app, and I believe you can't uninstall it regularly (kind of like how you can't install the bloatware). You will need to use Titanium Backup to uninstall it.
Also, I remember reading that some people were not able to install the ROMs after zipping it up because it's not signed.
This script is very simple. It basically just unzips the ROM, copies over your apps, zips back the ROM, and then signs it. Once you have your Windows set up, you can just drag and drop the ROM to the .bat file and it'll do all that for you.
Is this useless? Maybe. But, the same could be said for something like RyanZA's OCLF. You can sit there, type in all the commands to convert to EXT2, wait for it to convert, and reboot, or you can just run OCLF (which is basically just running a script for the conversion, to put it simply).
blackerwater said:
or you could just open your update.zip and place your apks in system/app re-zip and flash.
Click to expand...
Click to collapse
Why not just put them into data/app instead?
or you could just...
Or you could just download a pro version of titanium backup so that it can restore all your apps without you needing to click. There are plenty to be found online. The latest version, the better, as it would be more stable with froyo
So doing things this way... since it will be signed, i can also take other things out form other roms that i like and toss them in this rom??
I have titanium paid version. Just run it and it does everything
Sent from my SGH-T959 using XDA App
Dude it's called WinRAR. Open up the zip. Drop your apps into the data/app folder.
Then flash it. Simple.
Want certain apps to stay even after hard resetting? put them in system/app
This tool is completely unnecessary.
That's really a good idea. I like the method very much, it give me more free time to do some other things when flashing...Thanks !
Anderdroid said:
Dude it's called WinRAR. Open up the zip. Drop your apps into the data/app folder.
Then flash it. Simple.
Want certain apps to stay even after hard resetting? put them in system/app
This tool is completely unnecessary.
Click to expand...
Click to collapse
Ditto. This seems way more complicated then the method I've been using. You say it's simple that there are like 20 steps.
yeah and CWM has the option to toggle signature verification.. so you can flash unsigned apps on the vibrant.. but if you use 7zip it doesnt mess with the sig...
epakrat75 said:
Why not just put them into data/app instead?
Click to expand...
Click to collapse
Or that should work. And as for signing problems I us ubuntu and ive never had that happen but I guess with windows anything is possible.
Sent from my vibrant
Etrnaly said:
If you put it into "system/app" it will install it as a System app, and I believe you can't uninstall it regularly (kind of like how you can't install the bloatware). You will need to use Titanium Backup to uninstall it.
Click to expand...
Click to collapse
$adb shell
$su
#rm /system/app/CrappyBloatwareAppOfChoice.apk
Done.
No need for titanium.
Sorry for the noob question
Anderdroid said:
Dude it's called WinRAR. Open up the zip. Drop your apps into the data/app folder.
Then flash it. Simple.
Want certain apps to stay even after hard resetting? put them in system/app
This tool is completely unnecessary.
Click to expand...
Click to collapse
When you say your apps do you mean your .apks thanks

[HOW TO] Turn an RUU into a "custom" de-odexed ROM

I first wrote this guide here on my site and thought I should put it here as well.
I am going to write this post to show how "easy", yet time-consuming, converting an RUU into a custom, de-odexed ROM can be as long as you can follow directions. I am doing this to hopefully help with development of ROMs for people who may be a bit intimidated on doing this. Before you start, you’ll need:
1. A Windows installation
2. VirtualBox installed in Windows
3. Ubuntu 10.04 (at least) installed in VirtualBox
4. dsixda’s Android Kitchen set up properly in Ubuntu
5. Java JDK installed in Ubuntu (Search openjdk in Synaptic Package Manager)
6. No fear of taking your time with this
I am suggesting the above because that’s what I’ll be using for this guide. Some devs frown at the use of kitchens but de-odexing manually can be a real pain in the ass and very time consuming.
First things first, you need to have Ubuntu up and running inside VirtualBox and you’ll need to get the Android Kitchen set up properly. To do this, extract the Android Kitchen zip file you downloaded. Rename the extracted folder to just “kitchen”. Copy that folder into your Ubuntu “home” directory. The final path will be “/home/username/kitchen”. You can test this by opening Terminal and typing:
Code:
cd kitchen
./menu
If the Android Kitchen starts, then you’re good to go. It’s that easy.
Now, going back to your Windows installation, download the RUU you want to build from. Once downloaded, you’ll need to double-click the RUU to run it. You’ll get a window that opens to allow you to continue installing the RUU. You need to not click anything there. Leaving that window open, open a Windows Explorer window. In the address bar type:
Code:
%temp%
and hit enter. This will take you into your Temp directory where the rom.zip is extracted. You can now do a search for rom.zip. Once found, copy the rom.zip to another directory (ie. Desktop). You can now close out of the RUU installer.
You’ll need to now copy your rom.zip to your Ubuntu virtual machine. How you do that is up to you. The easiest way is to set up Shared Folders in VirtualBox and copy it from within Ubuntu.
Once you have this file in Ubuntu, for simplicity, copy it to your desktop. Next, you’ll need to extract it. Simply right-click the rom.zip and select “Extract Here”.
If you now open you extracted folder, you should see a bunch of .img files. The 2 we are looking for are system.img and boot-signed.img. For now, create a new folder on your desktop, we’ll call it “custom”, and copy the boot-signed.img into that folder (I usually rename boot-signed.img to boot.img). Also create a folder called “system” in the same directory. Next we need to mount the system.img so we can extract the contents into the “system” folder you just created. Back in Terminal, type:
Code:
sudo mkdir -p /mnt/temp
sudo mount -o loop ~/Desktop/rom/system.img /mnt/temp
and then
sudo cp -r /mnt/temp/* ~/Desktop/custom/system
After several minutes, you should have a folder called “custom” on your desktop and inside of that should be “boot.img” and a “system” folder with a bunch of files and folders in it. You now need to change permissions on the folder so you can zip it up and copy it all. Back in Terminal type:
Code:
sudo chown -R username ~/Desktop/custom
Next step is to zip it all up so we can get it into the kitchen. Highlight both the “boot.img” and “system” folders, right-click them, and select “Compress”. Change the extension to .zip and click OK. Once zipped, drag (or copy) that folder into /home/username/kitchen/original_update.
Open Terminal and type:
Code:
cd ~/kitchen
./menu
Once the kitchen starts, you’ll need to set up a Working Folder, so select option “1″. If you only have 1 ROM zip in there you can just hit Enter. Follow through the prompts to rename your working folder if you want. I’m not going to guarantee that it will always work but it has worked for me in the past to select option “2″ from the main menu to “Add root permissions”. Moving on to de-odexing, select option “0 – ADVANCED OPTIONS”. Next, select option “11 – Deodex files in your ROM”. I usually do this by deodexing framework first and then system. If you’re de-odexing the ATT ROM, “PirateGhost” from xda clued me in that you need to temporarily remove the “com.att.vmm.sharedlib.jar” from /system/framework otherwise de-odexing will fail. When you get into the de-odexing option it will have you set your API level. The default is 10 which is Android 2.3.4 however, ICS can be 14 or 15. If on the latest 4.0.3, it’s API Level 15. Google can also help you here. If you’ve done everything right it will de-odex for 20 minutes or so depening on your hardware and should say “0 .odex files remain”. If you have any that remain, you can do them manually or not at all. Up to you on how you do it.
Since that’s basically all we’re discussing for right now on creating this ROM, we’ll continue on to building a flashable zip. Back at the main menu, select option “99 – Build ROM from working folder”. I recommend using the default “Interactive Mode”. Select yes to optimizing/zip-aligning all apks. When asked to add Updater-script to ROM, select yes. Here’s the thing with the updater-script that it builds. It’s only partially right. You need to fix the partition format section for the Vivid (or for whatever phone you’re building for). It’s best to look at some other’s scripts to see how it’s done. When asked by the wizard to sign your ROM, don’t do it. It’s not necessary. Feel free to rename it to whatever you want. After you’ve fixed the updater-script and I do mean AFTER, you can try flashing the ROM. And don’t forget to flash the boot.img as well.
There you have it. You now have a base ROM for you to work from. Obviously, this is just scratching the surface of what can be done but it’s a start. This is just how I do it. There are other ways to accomplish the same thing but this method has worked for me. Attached is a sample updater-script that I pulled from my AT&T stock ICS ROM. Use it only as a template and modify it to fit your needs and obviously, remove the txt extension.
Jirv311 said:
I first wrote this guide here on my site and thought I should put it here as well.
I am going to write this post to show how "easy", yet time-consuming, converting an RUU into a custom, de-odexed ROM can be as long as you can follow directions. I am doing this to hopefully help with development of ROMs for people who may be a bit intimidated on doing this. Before you start, you’ll need:
1. A Windows installation
2. VirtualBox installed in Windows
3. Ubuntu 10.04 (at least) installed in VirtualBox
4. dsixda’s Android Kitchen set up properly in Ubuntu
5. Java JDK installed in Ubuntu (Search openjdk in Synaptic Package Manager)
6. No fear of taking your time with this
I am suggesting the above because that’s what I’ll be using for this guide. Some devs frown at the use of kitchens but de-odexing manually can be a real pain in the ass and very time consuming.
First things first, you need to have Ubuntu up and running inside VirtualBox and you’ll need to get the Android Kitchen set up properly. To do this, extract the Android Kitchen zip file you downloaded. Rename the extracted folder to just “kitchen”. Copy that folder into your Ubuntu “home” directory. The final path will be “/home/username/kitchen”. You can test this by opening Terminal and typing:
Code:
cd kitchen
./menu
If the Android Kitchen starts, then you’re good to go. It’s that easy.
Now, going back to your Windows installation, download the RUU you want to build from. Once downloaded, you’ll need to double-click the RUU to run it. You’ll get a window that opens to allow you to continue installing the RUU. You need to not click anything there. Leaving that window open, open a Windows Explorer window. In the address bar type:
Code:
%temp%
and hit enter. This will take you into your Temp directory where the rom.zip is extracted. You can now do a search for rom.zip. Once found, copy the rom.zip to another directory (ie. Desktop). You can now close out of the RUU installer.
You’ll need to now copy your rom.zip to your Ubuntu virtual machine. How you do that is up to you. The easiest way is to set up Shared Folders in VirtualBox and copy it from within Ubuntu.
Once you have this file in Ubuntu, for simplicity, copy it to your desktop. Next, you’ll need to extract it. Simply right-click the rom.zip and select “Extract Here”.
If you now open you extracted folder, you should see a bunch of .img files. The 2 we are looking for are system.img and boot-signed.img. For now, create a new folder on your desktop, we’ll call it “custom”, and copy the boot-signed.img into that folder (I usually rename boot-signed.img to boot.img). Also create a folder called “system” in the same directory. Next we need to mount the system.img so we can extract the contents into the “system” folder you just created. Back in Terminal, type:
Code:
sudo mkdir -p /mnt/temp
sudo mount -o loop ~/Desktop/rom/system.img /mnt/temp
and then
sudo cp -r /mnt/temp/* ~/Desktop/custom/system
After several minutes, you should have a folder called “custom” on your desktop and inside of that should be “boot.img” and a “system” folder with a bunch of files and folders in it. You now need to change permissions on the folder so you can zip it up and copy it all. Back in Terminal type:
Code:
sudo chown -R username ~/Desktop/custom
Next step is to zip it all up so we can get it into the kitchen. Highlight both the “boot.img” and “system” folders, right-click them, and select “Compress”. Change the extension to .zip and click OK. Once zipped, drag (or copy) that folder into /home/username/kitchen/original_update.
Open Terminal and type:
Code:
cd ~/kitchen
./menu
Once the kitchen starts, you’ll need to set up a Working Folder, so select option “1″. If you only have 1 ROM zip in there you can just hit Enter. Follow through the prompts to rename your working folder if you want. I’m not going to guarantee that it will always work but it has worked for me in the past to select option “2″ from the main menu to “Add root permissions”. Moving on to de-odexing, select option “0 – ADVANCED OPTIONS”. Next, select option “11 – Deodex files in your ROM”. I usually do this by deodexing framework first and then system. If you’re de-odexing the ATT ROM, “PirateGhost” from xda clued me in that you need to temporarily remove the “com.att.vmm.sharedlib.jar” from /system/framework otherwise de-odexing will fail. When you get into the de-odexing option it will have you set your API level. The default is 10 which is Android 2.3.4 however, ICS can be 14 or 15. If on the latest 4.0.3, it’s API Level 15. Google can also help you here. If you’ve done everything right it will de-odex for 20 minutes or so depening on your hardware and should say “0 .odex files remain”. If you have any that remain, you can do them manually or not at all. Up to you on how you do it.
Since that’s basically all we’re discussing for right now on creating this ROM, we’ll continue on to building a flashable zip. Back at the main menu, select option “99 – Build ROM from working folder”. I recommend using the default “Interactive Mode”. Select yes to optimizing/zip-aligning all apks. When asked to add Updater-script to ROM, select yes. Here’s the thing with the updater-script that it builds. It’s only partially right. You need to fix the partition format section for the Vivid (or for whatever phone you’re building for). It’s best to look at some other’s scripts to see how it’s done. When asked by the wizard to sign your ROM, don’t do it. It’s not necessary. Feel free to rename it to whatever you want. After you’ve fixed the updater-script and I do mean AFTER, you can try flashing the ROM. And don’t forget to flash the boot.img as well.
There you have it. You now have a base ROM for you to work from. Obviously, this is just scratching the surface of what can be done but it’s a start. This is just how I do it. There are other ways to accomplish the same thing but this method has worked for me. Attached is a sample updater-script that I pulled from my AT&T stock ICS ROM. Use it only as a template and modify it to fit your needs and obviously, remove the txt extension.
Click to expand...
Click to collapse
Thanks, I've De-odexed ICS 4.0.3 ROM from WEE RUU. But. When I flash to Phone. The boot was successfully. And Everything works. But in the Sense Desktop. Any of ICON's Title Couldn't Display in the Sense Homescreen. It's totally naked!! including widgets. What's Problem? The others text display is work.
My Lab: Windows 7 with JDK&JRE
Cygwin+Kitchen 1.92
---------- Post added at 11:26 AM ---------- Previous post was at 11:24 AM ----------
Should I Cooking ICS with Ubuntu?
ChunD.K said:
Thanks, I've De-odexed ICS 4.0.3 ROM from WEE RUU. But. When I flash to Phone. The boot was successfully. And Everything works. But in the Sense Desktop. Any of ICON's Title Couldn't Display in the Sense Homescreen. It's totally naked!! including widgets. What's Problem? The others text display is work.
My Lab: Windows 7 with JDK&JRE
Cygwin+Kitchen 1.92
---------- Post added at 11:26 AM ---------- Previous post was at 11:24 AM ----------
Should I Cooking ICS with Ubuntu?
Click to expand...
Click to collapse
Can you grab a screenshot? Seems pretty strange.
I find problems out。When I tried to Extract All files form a Stock RUU。Than pack it up without any touching。flash to phone。Boot Successfully...
But IT'S JUST NAKED!!! I really confused!
RUU Version:Australian RUU-HOLIDAY-ICS-35-S-Telstra-WWE-3.25.841.4-Radio-3.02.4740.09-34.20.701040.19
Everything is fine when I Run RUU.exe to update。
Jirv311 said:
Can you grab a screenshot? Seems pretty strange.
Click to expand...
Click to collapse
Where you are? I need your Reply.
ChunD.K said:
Where you are? I need your Reply.
Click to expand...
Click to collapse
I need your screenshot.
Jirv311 said:
I need your screenshot.
Click to expand...
Click to collapse
Finally, Here is the Problem Screenshot. SO WERIED
I‘ve also use the latest Touch RECOVERY。 Problem is still。。。
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
You gotta help me!
I mean i Pack them pu without any touching。
Where are you?
If I had to guess, I'd say you're using an unsupported language? I honestly am not sure.
Sent from my HTC PH39100 using xda premium
No, Itried switch to English. It jut naked.
Thanks alot for the thread! Is there anyway you could go into more detail about fixing the updater script for vivid?
bennykudos said:
Thanks alot for the thread! Is there anyway you could go into more detail about fixing the updater script for vivid?
Click to expand...
Click to collapse
I attached the updater-script to the OP. The main thing that needs fixing when your building it is putting in the correct format commands for the Vivid.
Do you know how to decompile the apks? I have expiernce with decompiling
Apks on the Samsung infuse but I can not figure out how do it for this phone...I can't even successfully install the framework...and yes I'm using an ics apktool...I've tried on both windows 7 and ubuntu 11.04
Could someone please link me to an apktool that works with this phones stock ics apks and tell me any special/extra steps I need to do to install framework and decompile apks
Sent from my HTC PH39100 using xda app-developers app
mg2195 said:
Do you know how to decompile the apks? I have expiernce with decompiling
Apks on the Samsung infuse but I can not figure out how do it for this phone...I can't even successfully install the framework...and yes I'm using an ics apktool...I've tried on both windows 7 and ubuntu 11.04
Could someone please link me to an apktool that works with this phones stock ics apks and tell me any special/extra steps I need to do to install framework and decompile apks
Sent from my HTC PH39100 using xda app-developers app
Click to expand...
Click to collapse
i think its called apk manager now.. sorry to revive

[TOOLS][script] ROM Tools v2 (Kernel Extractor)(BML15 IMG backup)

ROM Tools v2 ​
Version 2 BETA
v2b (Officially v2)
Linux Script
by iamareebjamal
Automated Android script for extracting boot.img and bml15 partition​
My PC has issues so I can't use it to build mods and scripts, also, I have a very slow internet connection. That's why I don't upload my ROMs. Provided, I build EACH and EVERY one of my mod on my mobile, including those long scripts with repeating commands and making it easy for other guys to use, I could've just created a script with two commands which rendered error if used incorrectly, but I make it noob proof in every way possible so that there are minimum errors from your side and if something gets wrong, you know what it is. Even uploading 5 mb of mod makes it very difficult as I have to reupload if it fails. Writing scripts on mobile is not easy, you'll know if you have done it, it takes hours. Also, these colorful and easy guides are also made on mobile by writing BB codes ONE BY ONE by hand.
I am telling you because a person day before yesterday posted my Amazing Sounds Mod in another forum without my permission. However, he has removed it now. My work is fully open sourced for you to learn and make your own mods. But taking part of my work and posting as yours is not appreciated.
The MOST you can give me is love, prayers and Thanks
Click to expand...
Click to collapse
Out of the time I was absent from XDA(13 hours ) , I was searching for a method of extracting the kernel from your ROM
Imagine, you want to extract boot.img from your ROM but don't know what to do, you don't have internet to download the stock or custom kernel or simply want to extract it?
I did not find anything except the solution of Android Kitchen but what if you want to do it on your android?
As a bi product of this search, I got a lot of knowledge about the partitions used by Android system and the blocks that define them.
I also got basic knowledge about Linux Scripting.
So, I created this script that backs up your boot.img and bml15.img partitions.​
​ boot.img - kernel of your device
bootextractorv2.sh - Backs up your kernel
bml15.img - IMEI partition
bml15extractorv2.sh - Backs up your IMEI partition
Note:- SGY Toolbox also backs up and restores bml15_EFS.img. And that also with a nice user interface, I just created this mod, because I wanted to but I recommend newbies to use SGY Toolbox for backing up IMEI
However, I found no tool able to backup the kernel, so it may be very useful for some members
ChangeLog
Code:
*More Interactive
*More Intelligent
*Added Option to create Odin Flashable Tar package for kernel
*More Convinient
Requirements :​
Root Acess
Busybox
Android device
Hands
Terminal Emulator or Script Manager
(Script Manager recommended)​
Instructions​
Script Manager Method (Easy):-
1. Download Script Manager.
2.Download desired script and place it on sdcard.
3. Open Script Manager and enable browse as root.
4. Go to the downloaded script and click on the green android icon(root) in the pop up window.
5. Click on Run. Follow Instructions and enjoy
Terminal Emulator Method (Hard):
1. Download Terminal Emulator.
2. Download desired script and place it in the root of the sdcard.
(You can place it anywhere else but the directory should not have spaces and you will have to change the commands accordingly)
3. Open Terminal Emulator and type (After every command you have to press enter)
Code:
su
And Grant Root Access
Then, type
Code:
sh /sdcard/bootextractorv2.sh
or
Code:
sh /sdcard/bml15extractorv2.sh
according to the the script you want to run
4. Now, follow the instructions on screen and enjoy
Download bootextractorv2.sh
Download bml15extractorv2.sh​
Credits :
Miscellaneous Google search posts showing how to write Linux Script
Me for writing the script
Rafael.Baugis for source
Ryuinferno for guide
Reserved
I'll test on S5830 and report asap
edit: Script wouldn't run on S5830 with script manager. With terminal emulator it dumps an empty boot.img
daxanh said:
I'll test on S5830 and report asap
edit: Script wouldn't run on S5830 with script manager. With terminal emulator it dumps an empty boot.img
Click to expand...
Click to collapse
kernel partition of s5830 is different
Give me the Partition
And I will make the mod
V2 completed
Uploading ASAP
OP Updated
v2 released
nice work man...thaks a lot
Sent from my GT-S5830i using xda app-developers app
He didn't really mean the love and prayers.
Nabs Zains said:
He didn't really mean the love and prayers.
Click to expand...
Click to collapse
lol
ROFL
You disclosed my secret Nabs
:good: simple & important... all ace_i owner should get this before 'cooking' ur device...
nice tool for kernel backup... :good:
Doesn't work for me, S5830i stock firmware. If I use script manager method, a lot of "not found" messages, and finally the boot folder is empty. I give script manager root permission. And if I use a terminal emulator, the same error messages, finally there is a 5MB boot.img file, but "untouchable". I can not copy in any other folder. If I connect to PC, boot.img is missing. Appears again in the mobile when I disconnet the USB. I can not change file permissions with root explorer....
Also when the script ask if I want to create a zip file for recovery, I select 1 and I get "bad integer, run again"
Thank you
puntillero said:
Doesn't work for me, S5830i stock firmware. If I use script manager method, a lot of "not found" messages, and finally the boot folder is empty. I give script manager root permission. And if I use a terminal emulator, the same error messages, finally there is a 5MB boot.img file, but "untouchable". I can not copy in any other folder. If I connect to PC, boot.img is missing. Appears again in the mobile when I disconnet the USB. I can not change file permissions with root explorer....
Also when the script ask if I want to create a zip file for recovery, I select 1 and I get "bad integer, run again"
Thank you
Click to expand...
Click to collapse
You have busybox?
If no,
You can't run it
Yes, and the script founds it (it says). Finally I zipped boot.img with root explorer and that zip file could be copied to the PC. Guess the file is ok. Thanks.
puntillero said:
Yes, and the script founds it (it says). Finally I zipped boot.img with root explorer and that zip file could be copied to the PC. Guess the file is ok. Thanks.
Click to expand...
Click to collapse
Why you zipped it?
English is not my language. I explained that boot.img was untouchable. I tried to copy to computer and I always got writing errors. Rebooting wasn't useful. Permissions couldn't be changed with root explorer.. The file was there, but couldn't do anything with It. Tried to zip it and it worked, and I copied the zip to my computer..
puntillero said:
English is not my language. I explained that boot.img was untouchable. I tried to copy to computer and I always got writing errors. Rebooting wasn't useful. Permissions couldn't be changed with root explorer.. The file was there, but couldn't do anything with It. Tried to zip it and it worked, and I copied the zip to my computer..
Click to expand...
Click to collapse
Sure that there is problem in busybox applet sync
I don't know why script couldn't detect it
I don't know what the problem was. I installed, not without many problems, the last busybox available, and everything worked ok. Out of curiosity, I compared boot.img file extracted with "problems" and the boot.img extracted now cleanly, and are identical.
Regards
[Q] IMEI backup work on GT-S5570 Galaxy Mini???
Sent from East Borneo Isand use Honey Bear's Phone
S5570 has another partition table
So no
Sent from my GT-I9100 using muffin premium

Categories

Resources