Tutorial For building custom rom for G1 - G1 Q&A, Help & Troubleshooting

Can any body post tutorial for building a custom rom for G1 and Hero?

wrong area to post this... probably should take it off.

were should i put this thread then

Q&A buddy.

I wrote a few how-to's on compiling your own android build from source, i recommend starting here:
http://robblue2x.blogspot.com/2009/07/how-to-set-up-ubuntu-virtual-machine.html
it is a bit out of date now because android moves so fast, its incredibly hard to keep up to date!

robblue2x said:
I wrote a few how-to's on compiling your own android build from source, i recommend starting here:
http://robblue2x.blogspot.com/2009/07/how-to-set-up-ubuntu-virtual-machine.html
it is a bit out of date now because android moves so fast, its incredibly hard to keep up to date!
Click to expand...
Click to collapse
Just visited this link But how do modify the existing files of android OS ?

If you have to ask how to change the files then you probably shouldn't be messing with the code for an OS. There is alot to it. You need to know how to set up linux, Git, repo, sdk, emulator, learn java,maybe some C++, edit xml files, and compile the edited code just to name a few.
read this
If you get that working then all you need is a text editor to start changing code.
Good luck!

What about modding existing roms?
Here is what I know so far...
system apps are not individualy signed
Rom must be packaged in zip having 3 root directories.
data (holds apps normaly)
META-INF (holds some kind of build files... and android manifest)
system (holds the OS and scripts and such.)
Also boot.img in the root dir.
The update.zip needs to be resigned if repackaged.
=) that is it all that I have gathered after hours of searching.
I dont want to recompile a kernel as I dont need to modify one. I would rather leave that to the more experienced DEVs. All I want is to remove/replace few apps...
My questions:
How do you sign a file... (tried the sign java thing in ubuntu and I get some king of error... could not find library and what not...)
There is a windows batch file floating around I have not tryed that.
I have some basic understanding of code language and I can flollow instructions even if I have to find my way around some stuff... but this rom building is like black magic... Everyone is doing it no one wants to explain how its done... If its too damn hard then so be it. I can modify it on the back end after installing. I just believe in clean simple installs.
What generates the META-INF directory and the files in there. Seems like there is some instructions on setting permissions for certain files and (manifest) seems like signiture keys..
Is that generated when the file is signed?
is it manualy generated?
is can those files be modified?
I know if this is answered it would be helpful in letting people optimize the builds for their own needs.
Sorry for the long post. I hope this gets explained or I dont care if I have to read, give me a bunch of homework (links).

zambezy said:
What about modding existing roms?
Here is what I know so far...
system apps are not individualy signed
Rom must be packaged in zip having 3 root directories.
data (holds apps normaly)
META-INF (holds some kind of build files... and android manifest)
system (holds the OS and scripts and such.)
Also boot.img in the root dir.
The update.zip needs to be resigned if repackaged.
=) that is it all that I have gathered after hours of searching.
I dont want to recompile a kernel as I dont need to modify one. I would rather leave that to the more experienced DEVs. All I want is to remove/replace few apps...
My questions:
How do you sign a file... (tried the sign java thing in ubuntu and I get some king of error... could not find library and what not...)
There is a windows batch file floating around I have not tryed that.
I have some basic understanding of code language and I can flollow instructions even if I have to find my way around some stuff... but this rom building is like black magic... Everyone is doing it no one wants to explain how its done... If its too damn hard then so be it. I can modify it on the back end after installing. I just believe in clean simple installs.
What generates the META-INF directory and the files in there. Seems like there is some instructions on setting permissions for certain files and (manifest) seems like signiture keys..
Is that generated when the file is signed?
is it manualy generated?
is can those files be modified?
I know if this is answered it would be helpful in letting people optimize the builds for their own needs.
Sorry for the long post. I hope this gets explained or I dont care if I have to read, give me a bunch of homework (links).
Click to expand...
Click to collapse
my advice for signing files would be to read through this thread. stericson says that JF's autosigning tool will work in linux. if you still can't get it pm stericson, he is a very nice member and should be able to help you

Thanks... That worked in windows.
Im getting some FC's but I can at least work on that now...
I did remove everything from the MANIFEST before signing just in case something did not get overwriten correctly.

I don't mess with the manifest files, so try not touching them and see if that helps

Can any body describe what does these files do while building a theme and how to edit these files:
android.policy.jar
framework.jar
services.jar
build.prop
build.sapphire.prop
build.trout.prop

sabin123 said:
Can any body describe what does these files do while building a theme and how to edit these files:
android.policy.jar
framework.jar
services.jar
build.prop
build.sapphire.prop
build.trout.prop
Click to expand...
Click to collapse
the prop files are configuration files and should NOT be replaced if your making a theme.
the .jar's should only be messed with if your adding stericsons lockscreen. you will have to decompile them for it to work

How to decompile the services.jar files?

Check out my theme thread. It's from when I was porting Android but most of these questions are explained in pretty good detail with links for more info. That should help you out quite a bit:
http://forum.xda-developers.com/showthread.php?t=578421
Go to the second post

Thanks for the link..

Related

[help] how to make a update.zip???

hey does anyone know how to make a update.zip for a apk???
you need to create an update-script that basically tells the flashing app where the file of your apk goes in the live system.
zip and sign and you're done.
if your next question is "how do I write an update-script" I would suggest you download any of the roms available, extract their script and have a look at it.
its quite basic, not much more difficult than writing a batch file on DOS.
there are a couple of threads that give a few pointers as well but they are somewhere in xda, not necessarily in the nexus section.
search for update-script and you'll see.
nmesisca said:
you need to create an update-script that basically tells the flashing app where the file of your apk goes in the live system.
zip and sign and you're done.
if your next question is "how do I write an update-script" I would suggest you download any of the roms available, extract their script and have a look at it.
its quite basic, not much more difficult than writing a batch file on DOS.
there are a couple of threads that give a few pointers as well but they are somewhere in xda, not necessarily in the nexus section.
search for update-script and you'll see.
Click to expand...
Click to collapse
thanks mam ill give it a try
Remove the .txt extension or use the META-INF folder in the .zip that already has the same update-script in it or finally, you can use the empty update.zip which already has all the components in it, you just need to add your .apk's and .jar's to it.
This is a basic update script that works well for themes (or at least for me it does). In your .zip have META-INF (for the update-script) folder (take one from a ROM or theme) and an app and a framework folder and it will work.

Editing 9.pngs unparsed error?

Okay, i need a little help, I try to add a 9.png to a sample app in eclipse so i can export it and have it show up corectly, however i get this error everytime i move the file into a drawable folder-
Description Resource Path Location Type
Unparsed aapt error(s)! Check the console for output. com_example_android_softkeyboard Unknown Android ADT Problem
This also makes it so i cannot export the apk, I have been reading and searching for a long time, but have no success.
I've followed the thread on how to edit 9.pngs also found on xda but i seem to have a problem not mentioned.
Any Help?
Shooot, i thought i was in a diffreent section my bad! Please move this!
How many other .9.png's do you have in that drawable folder? I found that if I had too many in one of the sample apk's that it would not compile. I finally just started a new one, and it hasn't let me down.
I only add one extra 9png file into the folder along with the already existing files in the folder (its a sample fromthe 2.1 sdk)
That error usually means that you have more than two stretching points on either the top of left side of the .9.png borders. Anything over two seperate points will seriously cause errors and won't let you compile. Fix it. and it'll compile.
Because you are making an app its different if you have never used it before check out draw9patch.bat in the SDK tools im sure google android wiki has something on it.
Best way to mod .9.png's is to just use the orig image and copy and paste your new stuff over old. I have been working with alot of .9.png images and this is easiest way to get around problems.
If you continue to have issues try compiling what you have without your mods maybe its the project itself.

[Q] Confused former Windows Phone 6.5 user/themer

Hi Guys,
I'm coming from Windows Mobile 6.5 where theming was a bit different:
When I started with 6.5 I used to think the only way to change the look of my phone interface was to flash a custom rom, but then I realized I could theme individual components (6.5 theme, Taskbar, Icons, Start Menu, ect) and it turned out to be pretty easy.
With Android I'm begining to think the opposite exists, is it basically true that in order for me to change the colors of the taskbar, or menus, taskbar icons - I have to use a custom rom?
I have been reading over these threads for the past three days and I have learned a lot, but I'm still confused...
I used to do M2D themes and change the xml and such, but when I read the Android theming guides ALL of it seems foreign to me...does't seem like I can just swap out pngs for pngs I made in Photoshop Am I making this seem more difficult than it is?
Are there individual themes for my taskbar, dialer, ect (not roms)? And if so can a former Windows Phone user explain them in comparison to installing a cab?
I know I have a ton of questions so any help at all would be appreciated
Thanks
MEGA MAN
There are MANY apps out there that will allow you to make these changes. Do some searches on the market and you'll find them. Do some research into rooting your phone (at your own risk) which will allow even more options.
You do not have to use a custom ROM to theme your phone, but it makes it a lot easier overall. AFAIK, you still have to have your phone rooted to theme more than icons.
To theme images, it really is just swapping out your images for the images already there as long as they contain the same dimensions, format (pretty much always .png), and name.
The .xml files are easiest to edit if you have decompiled the apk with a tool call apktool, because then they are in readable format.
Apktool is also really great for getting .9.png's in decompiled format with the stock guidelines intact.
You can theme various different components with an app called Metamorph or Ninjamorph, otherwise, you're going to have all your different parts together.
I've been theming android for getting close to two years now, so if you would like more help, you can PM/email (david1667jones gmail) me for more specific answers.
megaman - ain't it a trip coming from WM to android? yeah...WM seems such a simpler way. especially CHT2...that is really the best modding system ever.
been experimenting for the past 2-3 weeks and have been successful. (even have a usable CM7 theme that i may post...)
so let's hash this out. maybe teach eacho other a thing or two. if i am being too basic, let me know.
apk - like a cab. tricky thing is that (i believe) if you edit an apk, you replace the entire apk. unlike a cab where you can replace 1 single file. there are theme programs (metamorph - haven't used it, ADW and others that allow replacement with a single file...but they take a little work. nothing easy like cabs for WM.)
to begin you need 7zip (or winrar i hear works.) this will allow you to open apks, replace files and restore them in seconds:
http://www.7-zip.org/
i assume your rom is rooted (i really don't understand the term, but it allows freedom to mod your phone. i am using an HD2 - WM phone - running nand android so by default my phone is rooted.)
let's explore - take any apk and open it with 7zip. you will see 3 files (this is off of memory as i am at work right now.) open them and look around. ((want to find your installed apks and back them up? search market for Astro. (settings> backup and save your apks to your sd card)))
under res you will see drawable folders - this is the jackpot. in there you will see your images. there is a lot of redundancy in apks. the trick is finding the right image. try changing some, etc. this is the most basic of theming.
before moving on to xmls, etc (which there are quite good guides for this) just try the above. when you replace the files move up the folder hierarchy and it will ask you something about saving/restoring - cilck yes. the apk is now modded.
install the apk and see the changes.
however, if you are editing the core apks - system and framework-res, we will need to talk about how to do that (i use clockworkmod flashing...easy to do.)
let me know if this helps.
Thank you guys so much for your knowledge!
I do have my phone rooted and I have bootloader installed
The one reason I thought that I had to download a "ROM" is because I keep reading about having to be deodexed in order to modify...and I was underthe impression that most custom roms provide this deodexing?
on to APK's...I do have 7Zip and I have opened some up and found where the graphics are...now I am actually extracting the apk so I can manually go through each folder and see whats there including graphics...there does seem to be another way of opening the APK with 7Zip and not actually extracting it, but I don't thing I can actually see the image previews this way. >>>so I extract, change my desired images, re-zip and change the file extention back to .apk - BUT then I read about signing APK's? ...and signing zips?
After some researching I found a thread in which someone posted something like they make a copy of there current ROM "theme?" and then copy it in zip form on to their PC where they goe through all of the desired APKs and then Zip it back together and install it from the screen that you get to after holding the power button and home (recovery screen maybe?) <<< Anyway is this possible? This seem most like what we did in windows phone...but again I think where I'm getting caught up is the signing aspect...I've seen auto signers, but I feel like the ones I've seen were only for XP and I have Windows 7.
Woo... ok wrote a lot there - if you have anytime to elaborate on anything, I'd be happy to hear.
...and jsmccabe - that HD2 is one awesome device...I remember everybody asking if Windows 7 would everbe available and now you guys are dual booting with WP7 and Android - AWESOME!!! (if I didnt have Verizon
megaman...sorry it took a bit. "real life" and all that...
megaman 2 said:
The one reason I thought that I had to download a "ROM" is because I keep reading about having to be deodexed in order to modify...and I was underthe impression that most custom roms provide this deodexing?
Click to expand...
Click to collapse
- not sure what deodexed means. is your rom cm7? if so, tmobile themes is an "easy" way to make a theme.
- are you theming to share or for yourself? if the latter just replace the the files in your rom and flashe the rom. if the former, what type of rom?
megaman 2 said:
on to APK's...I do have 7Zip and I have opened some up and found where the graphics are...now I am actually extracting the apk so I can manually go through each folder and see whats there including graphics...there does seem to be another way of opening the APK with 7Zip and not actually extracting it, but I don't thing I can actually see the image previews this way. >>>so I extract, change my desired images, re-zip and change the file extention back to .apk - BUT then I read about signing APK's? ...and signing zips?
Click to expand...
Click to collapse
- you can extract to make life easier. but when you are ready to make the changes just drag the new icons into the original apk. it will update it for you and you can install it and done.
megaman 2 said:
After some researching I found a thread in which someone posted something like they make a copy of there current ROM "theme?" and then copy it in zip form on to their PC where they goe through all of the desired APKs and then Zip it back together and install it from the screen that you get to after holding the power button and home (recovery screen maybe?) <<< Anyway is this possible? This seem most like what we did in windows phone...but again I think where I'm getting caught up is the signing aspect...I've seen auto signers, but I feel like the ones I've seen were only for XP and I have Windows 7.
Click to expand...
Click to collapse
CWM themes are pretty easy to do. i started with this, the problem is it replaces the entire apk to replace 1 image. which if you are modifying systemui or frameworks, may overwrite other things (colors that you didn't want to.) easiest thing to do....find an already established CWM theme and keeping the same structure, replace the images and flash via CWM.
let me know if you want more details...cheers and good luck!

[Q] Extended Power Menu

Hi All,
Can anyone advise whether the following should work with Doc's JS8 and CWM recovery?
http://forum.xda-developers.com/showthread.php?p=8674580#post8674580
Rather than follow all the instructions, I just used the powermenu_final.zip at the end of the post and tried to flash the zip but it just sits there when flashing.
I'm not sure if it's me or the zip. If I knew it would work, I have no problems if I'll have to do it manually, but if the zip file provided in the post doesn't work it doesn't instill a lot of confidence.
Essentially, I want to learn how to do it so I can create my own update.zip containing other things as well.
Ultimately, I'd like to use the UOT Kitchen to get myself a battery mod, then add the changes to make an extended menu, and then finally add a few wallpapers, apk's etc. Then package it all up as an update.zip and flash it all.
If anyone can recommend a good guide, or advise whether the above post *should* work on my Galaxy S it would be appreciated.
Thanks
gleff1 said:
Hi All,
Can anyone advise whether the following should work with Doc's JS8 and CWM recovery?
http://forum.xda-developers.com/showthread.php?p=8674580#post8674580
Rather than follow all the instructions, I just used the powermenu_final.zip at the end of the post and tried to flash the zip but it just sits there when flashing.
I'm not sure if it's me or the zip. If I knew it would work, I have no problems if I'll have to do it manually, but if the zip file provided in the post doesn't work it doesn't instill a lot of confidence.
Click to expand...
Click to collapse
Yes, if you follow the instructions this guide still works.
But for JS8 you have to change the ressource ids to some unused values.
The update file you tried doesn't work because JS8 uses other resource ids than the one the update was built for. I'm sure you'll understand this after decompiling the files.
gleff1, I have successfully made ​​the menu for JS* for this statement, but with minor amendments.
To create update.zip use it.
Try my update.zip, should work on all JS*:
MCOGW said:
Yes, if you follow the instructions this guide still works.
But for JS8 you have to change the ressource ids to some unused values.
The update file you tried doesn't work because JS8 uses other resource ids than the one the update was built for. I'm sure you'll understand this after decompiling the files.
Click to expand...
Click to collapse
Ok thanks.. I don't understand where to get the resource id's yet but i'll play around tomorrow night after work and decompile the files and see if it makes more sense then.
Incidently, do I just grab the files that need decompiling from the phone, or some other theme? Eg. Are they all in the system folder on the phone itself?
Lar3s said:
gleff1, I have successfully made ​​the menu for JS* for this statement, but with minor amendments.
To create update.zip use it.
Try my update.zip, should work on all JS*:
Click to expand...
Click to collapse
Awesome... thanks for that.. i'll have a look.
Edit: That worked great.. So that I can learn how to do it myself i'll decompile your working one and compare it to the guide. This should be a fun weekend learning this stuff.
Thanks heaps guys. Makes a lot of sense now. I'll have a play later on.
gleff1, use for jar apktool. To avoid typing commands manually, you can use ready-made set of scripts (author sk0t from 4pda.ru; inside the archive is a readme, though in Russian):

[Q] How to make Custom Rom ?

Did anyone has tried the dsixda Android Kitchen to make a custom rom for OB ? Is it working ?
http://forum.xda-developers.com/showthread.php?t=633246
or just give me a link to very helpful site about how to make custom rom for OB
For starters, yes it works. but nothing compares as to compiling and building from source (Linux).
What you need is a mere system dump or backup from CWM.
That backup will be saved in your CWM folder in SD
Grab the boot.img & system.ext3.tar
unpack the .tar with a zip/RAR propgram
grab a base upater script from the many ROMs around here
Now for a start:
your base ROM like Zeus etc.
Delete the system folder and boot.img from that zip.
Replace files.
Use dsixda kitchen via cygwin (windows)
Now do as you please... it can unpack boot.img and add features like init.d etc.
Adding apps:
Apps can be added together with som libs (system/lib). Example: Terminal Emulator. the lib is some "jackpal" or something. .
When you download an app, apk will be saved in data/app in your phone. The lib or added files will be saved in data/data/(app name folder)/lib. Grab the apk and insert in system/app (kitchen's working folder). Grab the lib and insert it in system/lib (kitchen's working folder).
gabwerkz said:
For starters, yes it works. but nothing compares as to compiling and building from source (Linux).
What you need is a mere system dump or backup from CWM.
That backup will be saved in your CWM folder in SD
Grab the boot.img & system.ext3.tar
unpack the .tar with a zip/RAR propgram
grab a base upater script from the many ROMs around here
Now for a start:
your base ROM like Zeus etc.
Delete the system folder and boot.img from that zip.
Replace files.
Use dsixda kitchen via cygwin (windows)
Now do as you please... it can unpack boot.img and add features like init.d etc.
Adding apps:
Apps can be added together with som libs (system/lib). Example: Terminal Emulator. the lib is some "jackpal" or something. .
When you download an app, apk will be saved in data/app in your phone. The lib or added files will be saved in data/data/(app name folder)/lib. Grab the apk and insert in system/app (kitchen's working folder). Grab the lib and insert it in system/lib (kitchen's working folder).
Click to expand...
Click to collapse
many thanks gabwerkz. I had been searching ebook The Complete Idiot's Guides to custom rom, but I think the book has not published yet.
I only once tried to cook with kitchen, but that's waaaaay back and there I simply had no clue, of what I am doing and those days, the cust ROM I made, didnt work, but I simply randomly applied mods/tweaks and also had no clue of how things like updater-script work, but now I do and maybe as soon as I got some time again (in about 2 months ) I'll give it another shot and also read a lot about deving on my own and all the stuff related to it. Then maybe I'll be able to help all the cookers here out in a better way, cause until now, I only got the basics
You can start with simply things, like extracting the files with a packer, remove LG bloatware, add files/patches, you can find in dev section, add apps you like and think others might like as well, change lockscreen, launcher, keyboard,...
Remember to always do this step by step and make a changelog for yourself, so you know, where you might have made a mistake (also important for others to be able to help you). Then repack your ROM, sign and test it, if it works properly, use kitchen, to zipaligne, deodex, change filesystem,... And as soon as you are satisfied, post it/PM the good ones in here, to test it and ask for opinions, what you might change next. Custom kernels are always cool, cause you can change way more, like governors, iosched,... But that will take more time to dev and a lot more time to test for errors
Hope this helps you out a bit
N00BY0815 said:
I only once tried to cook with kitchen, but that's waaaaay back and there I simply had no clue, of what I am doing and those days, the cust ROM I made, didnt work, but I simply randomly applied mods/tweaks and also had no clue of how things like updater-script work, but now I do and maybe as soon as I got some time again (in about 2 months ) I'll give it another shot and also read a lot about deving on my own and all the stuff related to it. Then maybe I'll be able to help all the cookers here out in a better way, cause until now, I only got the basics
You can start with simply things, like extracting the files with a packer, remove LG bloatware, add files/patches, you can find in dev section, add apps you like and think others might like as well, change lockscreen, launcher, keyboard,...
Remember to always do this step by step and make a changelog for yourself, so you know, where you might have made a mistake (also important for others to be able to help you). Then repack your ROM, sign and test it, if it works properly, use kitchen, to zipaligne, deodex, change filesystem,... And as soon as you are satisfied, post it/PM the good ones in here, to test it and ask for opinions, what you might change next. Custom kernels are always cool, cause you can change way more, like governors, iosched,... But that will take more time to dev and a lot more time to test for errors
Hope this helps you out a bit
Click to expand...
Click to collapse
Your post help me a lot... thanks... I will try what you told me todo...
And If your rom need a bootanimation just PM me right...

Categories

Resources