Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,781,289 Members 36,735 Now Online
XDA Developers Android and Mobile Development Forum

(Newbies) Cooking a Rom with a Kitchen

Tip us?
 
Modding.MyMind
Old
#1  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
Exclamation (Newbies) Cooking a Rom with a Kitchen

The purpose of this guide is to show users here in our Forum how to use the DSIXDA kitchen so that they may become familiar with cooking their own Roms and possibly becoming a valuable asset to our community down the road. So I hope to see this become useful for some of you willing to learn and well, to also not be lazy and expecting others to do the work for you - no pun intended lol.

Let's understand what a basic Rom contains:
- First and foremost, a Rom.zip will always have at minimum:
-- A boot.img at the root of the Rom.zip
-- A /system folder
-- A /META-INF folder







--- Now, I assume you already have done me the favor of installing the kitchen and so by therefore, saving me the trouble of having to explain the process of installation. It's simple. Moving along now.

--- Go ahead and get the kitchen up and running in your CMD Window. I will be using Ubuntu in reference to this guide but the same should also apply to those who prefer Windows/Cygwin.







As you see in your CMD Window there are some options with basic information as to what those options will do for you.

The first thing we need to do is set up our working folder which will be option number 1, but before we can do that we need a Rom to work with. There are many ways to getting your hands on a Rom. However, for the sake of this tutorial I will use a Nandroid Backup created by TWRP (Custom Recovery).
-- Please note that a TWRP system backup will require additional steps.
-- This is because the kitchen does not support its backup format.

--- Go ahead and make a copy of your boot and system backup and paste them in the original_update folder which can be found in the kitchen directory. From a 'TWRP backup' the boot.img will be originally named boot.emmc.win and the system.img will originally be named system.ext4.win. Go ahead and change them respectively to boot.img and system.img (It is that easy).







--- Now, create a folder and name it whatever you like, BUT the name MUST include WORKING_ at the beginning of its name.
-- An example: WORKING_k2cl_412_deodexed

--- Move the boot.img in to the created folder. Open up the working folder and create another sudirectory folder named system.







--- Go ahead and move the system.img in to the subdirectory folder named system located inside of your working folder.

--- Open up a new CMD Window and change directories to where the system.img is currently located at.

--- Go ahead and enter:
Code:
tar -xvf system.img
-- This will unpack the system backup made by TWRP
-- DSIXDA Kitchen does not currently support this format so YOU must do it.







--- As you can see, the system folder is now complete with all that you will need to start on your Rom. Go ahead, and remove the actual system.img file as it will not be needed now.

--- Go back to the CMD Window which has the kitchen up and running. Select option 1 to set up your working folder for the kitchen. It will give options to show supported formats or to abort. Go ahead and just press enter.







--- It will bring up a list of working materials to use for establishing your working folder for the kitchen. In my case, the working folder I will be using is option number 2, WORKING_k2cl_412_deodexed. Go ahead and select your option now.

--- It will ask you if you want to change the name of the new working folder. The option is yours. Choose yes or no (this part really doesn't matter).

--- Once you press enter it will create the new working folder which can be found at the root of the kitchen directory. It will be copying the contents over to the new working folder.

--- It will detect whether or not your rom has an updater script, symlinks, root, busybox, etc. If any of these are detected it will let you know it found them and it will adjust accordingly to them. Which saves you lots of time.

--- Now it will ask you if you would like to view the Rom's information. This is optional for you. If you want to see it then select yes, if not, then select no.







--- Congratulations! You have a Rom set up to be worked on! At this point you can choose to deodex your Rom, unpack and edit your boot.img, root your device both, /system and boot.img. Add additional tweaks, apply init.d support, etc.

--- Once you have finished playing with your Rom as a first timer, go ahead and back out to the main menu of the kitchen. Select number 99 to build your Rom from the working folder.

--- You will be asked to select a build option. Go ahead and select option number 1.







--- Select yes to zipalign your apk files

--- Next it will build your updater-script for your Rom based on an android device. It will ask you to review the updater-script before proceeding forward. You MUST insure the updater-script is ready for your device or it will not flash!







--- Go to the working folder of that rom and scroll the the subdirectories found in the META-INF folder until you see the updater-file. Open it up with notepad++ for Windows users or Gedit for linux users. You are going to look at the top and add the following (PLEASE INSURE YOU USE THE PROPER SYSTEM PARTITION FOR YOUR DEVICE - THIS EXAMPLE IS BASED ON MY K2_CL DEVICE!:
Code:
mount("ext4", "EMMC", "/dev/block/mmcblk0p35", "/system");
delete_recursive("/system");
package_extract_dir("system", "/system");






--- Now scroll to the bottom of the updater-script. You may see some crazy stuff about raw writing the boot.img. Go ahead and remove that mess and replace it with the following (PLEASE INSURE YOU USE THE PROPER BOOT PARTITION FOR YOUR DEVICE - THIS EXAMPLE IS BASED ON MY K2_CL DEVICE!:
Code:
package_extract_file("boot.img", "/dev/block/mmcblk0p20");






--- Once done, go ahead and save the updater-script file. Go back to the CMD window running the kitchen and select yes to keep the updater-script for the Rom.

--- It will create the update.zip, it will ask you to sign the Rom (say yes), then it will ask you if you wish to change its name or leave it as is (your choice).

--- Congratulations, now go ahead and flash your Rom to test it out. Be sure to Factory reset your device from within the custom recovery, and insure that the system partition is wiped also. After it is done flashing the rom, wipe the dalvik and cache before rebooting, and remember... Any problems without a logcat is trivial!!!

--- Happy Hunting!!
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2014-01-26 22:19:09.png
Views:	559
Size:	204.3 KB
ID:	2541560   Click image for larger version

Name:	Screenshot from 2014-01-26 22:28:51.jpg
Views:	539
Size:	67.3 KB
ID:	2541561   Click image for larger version

Name:	Screenshot from 2014-01-26 22:47:44.jpg
Views:	549
Size:	65.8 KB
ID:	2541562   Click image for larger version

Name:	Screenshot from 2014-01-26 22:58:26.jpg
Views:	531
Size:	62.1 KB
ID:	2541563   Click image for larger version

Name:	Screenshot from 2014-01-26 23:07:40.jpg
Views:	539
Size:	120.1 KB
ID:	2541564  

Click image for larger version

Name:	Screenshot from 2014-01-26 23:18:49.png
Views:	535
Size:	240.0 KB
ID:	2541565   Click image for larger version

Name:	Screenshot from 2014-01-26 23:24:46.jpg
Views:	544
Size:	82.9 KB
ID:	2541566   Click image for larger version

Name:	Screenshot from 2014-01-26 23:36:09.jpg
Views:	551
Size:	77.8 KB
ID:	2541567   Click image for larger version

Name:	Screenshot from 2014-01-26 23:38:06.jpg
Views:	548
Size:	83.9 KB
ID:	2541568   Click image for larger version

Name:	Screenshot from 2014-01-26 23:44:42.png
Views:	523
Size:	247.9 KB
ID:	2541569  

Click image for larger version

Name:	Screenshot from 2014-01-26 23:50:40.jpg
Views:	549
Size:	118.2 KB
ID:	2541570  
The Following 8 Users Say Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
Modding.MyMind
Old
#2  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
That's my pet lizard, Saucy. He keeps me company, haha. :P

Sent from my C525c using Tapatalk
The Following User Says Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
Kreatur3
Old
#3  
Senior Member
Thanks Meter 62
Posts: 226
Join Date: Mar 2011
Thanks man. This is exactly what I wanted to get me going. It's late for me but I'll definitely be checking this guide out tomorrow.
The Following User Says Thank You to Kreatur3 For This Useful Post: [ Click to Expand ]
 
Modding.MyMind
Old
#4  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
Good luck. I used a TWRP backup as an example because it requires extra steps. Any other time, like a system dump for example, the kitchen will detect it and be able to unpack the system.img for you automatically, but because of how TWRP formats the ext4 backups it must be done manually since the kitchen doesn't support it yet. Just some insight so you know that you don't always have to manually unpack the system.img.

Sent from my C525c using Tapatalk
The Following User Says Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
Modding.MyMind
Old
#5  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
If a normal system img aside from TWRP then all is required is naming them boot.img and system.img then placing both inside of the 'original_' folder then running the kitchen. Select option 1 and it should detect both. It will build the working folder, the subdirectory system folder, meta-inf folder, place the boot.img, and unpack the system.img automatically. For future reference.

Sent from my C525c using Tapatalk
The Following User Says Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
russellvone
Old
#6  
russellvone's Avatar
Senior Member
Thanks Meter 801
Posts: 1,612
Join Date: Jan 2013
Location: Longview

 
DONATE TO ME
also, for the "newbies" including me,

http://forum.xda-developers.com/show....php?t=2597220

[KITCHEN][FORK] Android Kitchen Continuation (WIP) [Linux / Mac / Windows]

here's a link to a more up to date kitchen, I haven't used it but it seems legit.
The Following 4 Users Say Thank You to russellvone For This Useful Post: [ Click to Expand ]
 
Modding.MyMind
Old
#7  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
Haha, just took a look at it. Most of the added features I have already done for my personal use. Guess I can hit this guy up with some ideas. Thanks for that link @russellvone

Sent from my C525c using Tapatalk
The Following User Says Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
Modding.MyMind
Old
#8  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
Top priority is adding support for TWRP backups, and looking into implementing the ability to re-odex the Rom. It can be done, despite that the founder says otherwise.

Sent from my C525c using Tapatalk
The Following User Says Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
Modding.MyMind
Old
(Last edited by Modding.MyMind; 27th January 2014 at 05:55 PM.)
#9  
Modding.MyMind's Avatar
Senior Member - OP
Thanks Meter 1,443
Posts: 1,640
Join Date: Nov 2013
Location: Richmond, Virginia

 
DONATE TO ME
Oh, and don't no one take offense to my title, "Newbies". Meant nothing insulting by it. Just used it regarding that maybe you are new to it. We all got to start somewhere.

Sent from my C525c using Tapatalk
The Following 3 Users Say Thank You to Modding.MyMind For This Useful Post: [ Click to Expand ]
 
palmtree5
Old
#10  
palmtree5's Avatar
Member
Thanks Meter 35
Posts: 54
Join Date: Aug 2012
If you ran through and deodexed, did you by chance get an error when it attempts to deodex HTCNotes?

Here's what I'm getting:

Code:
NOW AT FILE 1 OF 1 IN system/app: HtcNotes.odex
Disassembling HtcNotes.odex ...
java -Xmx512m -jar baksmali.jar -a 17 -d ../framework -x HtcNotes.odex
Error while disassembling method Lcom/htc/notes/detail/NotesDetailActivity$13;->handleMessage(Landroid/os/Message;)V. Continuing.
org.jf.dexlib.Code.Analysis.ValidationException: Could not resolve the method in class Lcom/htc/widget/HtcSeekBarPopupWindowListener; at index 75
	at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInvokeVirtualQuick(MethodAnalyzer.java:3655)
	at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyzeInstruction(MethodAnalyzer.java:1110)
	at org.jf.dexlib.Code.Analysis.MethodAnalyzer.analyze(MethodAnalyzer.java:213)
	at org.jf.baksmali.Adaptors.MethodDefinition.addAnalyzedInstructionMethodItems(MethodDefinition.java:389)
	at org.jf.baksmali.Adaptors.MethodDefinition.getMethodItems(MethodDefinition.java:311)
	at org.jf.baksmali.Adaptors.MethodDefinition.writeTo(MethodDefinition.java:132)
	at org.jf.baksmali.Adaptors.ClassDefinition.writeMethods(ClassDefinition.java:338)
	at org.jf.baksmali.Adaptors.ClassDefinition.writeVirtualMethods(ClassDefinition.java:310)
	at org.jf.baksmali.Adaptors.ClassDefinition.writeTo(ClassDefinition.java:117)
	at org.jf.baksmali.baksmali.disassembleDexFile(baksmali.java:186)
	at org.jf.baksmali.main.main(main.java:308)
opcode: invoke-virtual-quick/range
CodeAddress: 1478
Method: Lcom/htc/notes/detail/NotesDetailActivity$13;->handleMessage(Landroid/os/Message;)V

ERROR: Aborting HtcNotes.odex

Finished system/app

WARNING: Could not deodex the following (you can try to deodex these files again):
HtcNotes.odex
I've already tried again too

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes