|
|
#1 |
|
Retired Staff
My Device: HTC HERO
Join Date: Oct 2009
Location: Kanaky-New-Caledonia
Posts: 179
![]() |
Extract NAND image files To extract .img files, I have found unyaffs from http://code.google.com/p/unyaffs/ I have compiled it under ubuntu 64 (attached). Unyaffs works on system.img but on no other .img file To extract boot.img use attached extract-kernel.pl and extract-ramdisk.pl # extract-kernel.pl boot.img # extract-ramdisk.pl boot.img Should work for recovery.img but haven't tried as custom recovery images on the forum are great. Rebuild system.img Seems you just need "to loopback mount an image on your linux box and format it with YAFFS". But it is useless as because Hero's SPL does not allow flashing system.img directly. You should use an update.zip package for that. (read below) Rebuild boot.img After extracting your boot.img using attached extract-*.pl To find - how to dump radio from device - how to build a custom hero kernel (waiting for HTC sources)and tweaking it, in same folder run: # mkbootfs boot.img-ramdisk | gzip > ramdisk-boot # mkbootimg --kernel boot.img-kernel --ramdisk ramdisk-boot --cmdline "no_console_suspend=1 console=null" -o newBoot.img --base 0x19200000 Creating an update.zip package Creating an update.zip package is quite easy in fact. For example, to add a (valid) test.apk package to your rom: - create an empty folder <workdir> - create folder structure for test.apk (<workdir>/system/app) and copy the test.apk - create folder structure for update-script (<workdir>/META-INF/com/google/android) - edit <workdir>/META-INF/com/google/android/update-script - put in it: Code: show_progress 0.1 0 copy_dir PACKAGE:system SYSTEM: set_perm_recursive 0 0 0755 0644 SYSTEM:app show_progress 0.1 10 - compress the <workdir> content to zip (not the <workdir> folder itself) Now you are going to sign the zip file. Download attached testsign.zip and copy it in your <SDK>/tools folder. Extract it here. It should create a sign subfolder with a testsign.jar file in it. Then, from <workdir> folder, do: java -classpath <SDK>/tools/sign/testsign.jar" testsign file.zip file-signed.zip Ok, now your zip file is ready to be deployed using cyanogen recovery image. To find more command to use in update-script, look at other's. Modify .apk package Seems it is easy to uncompress an .apk package (zip) an to modify files in it and then compress it. But after all: you must sign it like update.zip packages. ODEX files - What are those Odex files? Answer. - How to get rid of them? Odex files depend on framework they are made for. To deodex an odex file use that how to Then you may create a classes.dex file by executing the smali program on the "out" folder. You then rename it to classes.dex and add it to the .apk. - How to create them? Use dexopt-wrapper on device. Porting an other device's rom Well, that part is easy ![]() - extract the system.img - extract boot.img - replace boot.img-kernel with the one from your stock Hero rom one. - rebuild boot.img - build update.zip package (look someone's hero custom rom to see how to do it) - sign and flash It should run place and make calls but probably won't have Wifi, BT, trackball support. If you make those work: tell me, but I think we should wait to be able to compile a 2.6.29 kernel to have those. Tools Androsign script (linux) I wrote that androsign script to quick sign zip files. Just put it in your <SDK>/tools folder, then chmod +x. If you have put the tools folder in your PATH, you can call it directly like this: androsign /dev/folder1/folder2/update.zip (or any zip/apk file) It will output an update-signed.zip (or app-signed.apk etc) in the same folder than original file was in. Notes Note1: thanks Thanks to every guy that helped me found all that. Note1: sharing I searched for hours, so I am more than happy to share it to save someone's time. I am just disappointed than some people here do not have that spirit: I could have use those hours for development instead of research... Note3: corrections So, if you found anything incorrect, would like to supply more informations or want to correct my bad english: just PM me. To come How to prepare your own kitchen and useful scripts (linux)
__________________
Lox "I make things for me and I am just sharing them" http://gecka.nc/Images/twitter.png http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif |
|
|
|
| Sponsored Links |
|
|
#2 |
|
Senior Member
My Device: Topaz , Rhodium , HD2 , G1
Join Date: Jul 2009
Location: Russia
Posts: 566
![]() |
very nice tutorial !
Well done lox ![]() Stuck thread ! Tom
__________________
If you like my work and want to offer some support please click on the Paypal button
|
|
|
|
|
|
#3 |
|
VIP Member
My Device: HTC TP2, HTC TP2 CDMA. TMO HD2
Join Date: Jul 2009
Location: Portugal
Posts: 1,127
![]() |
Nice one Lox, nice set of tools.
![]() Cheers. |
|
|
|
|
|
#4 |
|
New Member
My Device: htc magic
Join Date: Oct 2009
Posts: 3
![]() |
im trying to get dex file from extracted odex on my pc not phone and keep getting errors
any help |
|
|
|
|
|
#5 |
|
Retired Staff
My Device: HTC HERO
Join Date: Oct 2009
Location: Kanaky-New-Caledonia
Posts: 179
![]() |
How do you want me to help if you do not give any piece of the errors you get?
__________________
Lox "I make things for me and I am just sharing them" http://gecka.nc/Images/twitter.png http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif |
|
|
|
|
|
#6 |
|
New Member
My Device: HTC Hero
Join Date: Dec 2009
Location: VNM
Posts: 3
![]() |
Can we cook ROM on windows! As I read your post, you said that all things were made on Linux, right? Is there anyway to do these things on windows !?
|
|
|
|
|
|
#7 | |
|
Retired Staff
My Device: HTC HERO
Join Date: Oct 2009
Location: Kanaky-New-Caledonia
Posts: 179
![]() |
Quote:
mkbootfs and mkbootimg may be run using Cywin. Or, maby, windows alternatives exists. Unyaffs is available for windows (first result) For signing update.zip packages, you need Java in your PATH. I have not used windows for years so I won't be much help. But Linux and Macosx (unix based) are the preferred environments for that sort of things. Do you now that Ubuntu has a nice way to install it like a software in windows? Just download, burn the cd, and follow autorun from windows.
__________________
Lox "I make things for me and I am just sharing them" http://gecka.nc/Images/twitter.png http://www.paypal.com/en_US/i/btn/btn_donate_LG.gif |
|
|
|
|
|
|
#8 |
|
New Member
My Device: X1
Join Date: Nov 2009
Posts: 17
![]() |
nice share thanks bro
|
|
|
|
|
|
#9 |
|
New Member
My Device: X1
Join Date: Nov 2009
Posts: 17
![]() |
nice share thanks bro
|
|
|
|
|
|
#10 |
|
New Member
My Device: HTC Hero
Join Date: Dec 2009
Posts: 13
![]() |
Hi Lox
I'm trying to port a Magic ROM to hero. I've followed your instructions, they were clear enough. Though I got stuck when flashing the ROM where I get an error message that starts from line #4 of the update-script. I'm using the update-script attached... I'm using Amon RA 1.5 recovery image. would greatly appreciate your help. |
|
|
|
![]() |
| Tags |
| android, rom cooking, tutorial |
«
Previous Thread
|
Next Thread
»
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [GUIDE] 56 Universal Tutorials for Customizing any Device and Cooking |23 Jan 09| | MrMakk | Development and Hacking | 16 | April 1st, 2010 06:36 AM |
All times are GMT -4. The time now is 04:12 AM.
- About Us
- Corrections
- Donate
- Editorial Policy
- Test Lab
- Submit a Request
vBulletin® Copyright ©2000-2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.6.0
2009-2012 htcpedia.com. All rights reserved.


















Linear Mode

