[Q] Editing zip before flashing a ROM - HTC Desire S

I know I have done this before and this is a noob question, but lately I've been having trouble with this.
If I make changes to the zip file of a ROM (eg replace a few existing files, and remove some unwanted system APKs, but not add anything new), do I need to sign the zip before flashing or just flash straight after editing? Also what's the best tool to use to replace the files within the zip? I trust WinRAR will do the trick...

djsubtronic said:
I know I have done this before and this is a noob question, but lately I've been having trouble with this.
If I make changes to the zip file of a ROM (eg replace a few existing files, and remove some unwanted system APKs, but not add anything new), do I need to sign the zip before flashing or just flash straight after editing? Also what's the best tool to use to replace the files within the zip? I trust WinRAR will do the trick...
Click to expand...
Click to collapse
I've never added anything (yet!), just deleted un-wanted APK's and altered some system files (ie build,prop etc). I've never signed anything and I used IZArc although only as that's what's installed on my XP system.
This is something that I too would like to do more so that I can further personalize and tweak some of these already great ROMS, so I'm also curious for some pointers from more the experienced.

Check the portal, there's an app to create flashable zips there.
PS - POST QUESTIONS IN THE GENERAL SECTION !!!!!!!!

You can set a flag in recovery to check for signatures or not. When it is not set you can flash any zip file
Sent from my HTC Desire S using XDA App

jorgen2009 said:
You can set a flag in recovery to check for signatures or not. When it is not set you can flash any zip file
Sent from my HTC Desire S using XDA App
Click to expand...
Click to collapse
I tried this once, and then I flashed the zip. It was a CM7 zip which would normally take at least 20-30 seconds to complete, but this modified zip flashed in less than ten seconds. It said successfully flashed but when I rebooted nothing had actually happened. Hence I was wondering what went wrong?

Related

Question about modifying signed Rom zip files

Can I modify an existing one by simply dropping in updated bootscreen files, rosie.apk, etc.. and signing the existing rom zip?
Any good guides on how to do one if not, and/or how to use Flipz kitchen tool to create a rom?
Ceger
I am pretty sure if you sign the file and you modify it after that you will have to resign it. At least thats how it goes for other things that are similar that I deal with.
Kcarpenter said:
I am pretty sure if you sign the file and you modify it after that you will have to resign it. At least thats how it goes for other things that are similar that I deal with.
Click to expand...
Click to collapse
I understand that, just wondering if I can add new files and they will move or does some master script need to be updated to know to move the files. In other words, is it done by directory or by file?
For example, if I add some apps to /data/app in the zip will they be there on the phone when I install the ROM zip, etc.. More specifically, I have added an alternate boot sequence. The rom does not have a boot1.gif. If I add the new sequence with XML, will the boot1.gif be installed as well or do I need to update something that directs the install of the ROM to move that file or is it automatic as the folder is moved over?
Ceger
Ceger said:
I understand that, just wondering if I can add new files and they will move or does some master script need to be updated to know to move the files. In other words, is it done by directory or by file?
For example, if I add some apps to /data/app in the zip will they be there on the phone when I install the ROM zip, etc.. More specifically, I have added an alternate boot sequence. The rom does not have a boot1.gif. If I add the new sequence with XML, will the boot1.gif be installed as well or do I need to update something that directs the install of the ROM to move that file or is it automatic as the folder is moved over?
Ceger
Click to expand...
Click to collapse
I have found that the easiest thing to do is just put the files that you want to use to replace the old ones into a signed zip and then flash just those files I have tried altering a rom file with no success
wtphoto said:
I have found that the easiest thing to do is just put the files that you want to use to replace the old ones into a signed zip and then flash just those files I have tried altering a rom file with no success
Click to expand...
Click to collapse
Oh well, was trying to have a one step zip. I guess I can make at least have a 2 step process which is better than 4-5.
Thanks,
Ceger
Yes you can modify just about anything in the rom and flash your zip as long as it is signed and the update script is correct. I always make all my changes to a rom before flashing it so i do not have to flash several different things etc.
The update script is located in RomName\META-INF\com\google\android\
Lets look at a very simple update script to show you what i mean.
In this update script it is to write something to /system
example:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
We see here that whatever is in the system folder within the signed zip will be written to the phone
in this case i am writing /system/app/mobiledefense.apk
That will be the only file written to the phone and will be written to /system/app
The update script is not specific to every file so you can have 1 thing in the system folder or 100 and it will write everything in there.
One thing that many people mess up on is not using a update-script file when they sign a .zip file. The recovery has to know what to flash or it will not flash anything.
So the answer is yes you can change many things and then flash the signed update.zip file.
Not everything can be done this way but most things will work.
But for example changing the boot sceen can be done even if the file names are different as long as the folder structure stays the same and the .XML file is the correct one for the boot screen. I opened the .zip of a rom deleted everything out of the boot screen folder and dropped in all the files from the nexus one hero hybrid boot screen re signed the zip and everything flashed perfect. I changed many other things as well in the .zip like rosie.apk, sound files, lockscreen files, busybox files, added apps to /system/app and just resigned the zip and everything flashed the way i wanted it to and works perfect.
The way to correctly zip a file is to extract the zip modify what you want then select everything inside the zip right after you open the folder and the highlight everything select add to archive and then zip it up now sign that .zip
so say you extract the ROM and it is named Rom123 now you will have a folder named Rom123 open that folder and select everything file or folder in there and then hit add to archive that will make another zip right there called Rom123.zip pull that zip out to the desktop and sign that zip file and thats it.
I Know that is confusing as it is late as hell and i am tired but wanted to answer this real quick.
zippy-man said:
Yes you can modify just about anything in the rom and flash your zip as long as it is signed and the update script is correct. I always make all my changes to a rom before flashing it so i do not have to flash several different things etc.
The update script is located in RomName\META-INF\com\google\android\
Lets look at a very simple update script to show you what i mean.
In this update script it is to write something to /system
example:
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
show_progress 0.1 10
We see here that whatever is in the system folder within the signed zip will be written to the phone
in this case i am writing /system/app/mobiledefense.apk
That will be the only file written to the phone and will be written to /system/app
The update script is not specific to every file so you can have 1 thing in the system folder or 100 and it will write everything in there.
One thing that many people mess up on is not using a update-script file when they sign a .zip file. The recovery has to know what to flash or it will not flash anything.
So the answer is yes you can change many things and then flash the signed update.zip file.
Not everything can be done this way but most things will work.
But for example changing the boot sceen can be done even if the file names are different as long as the folder structure stays the same and the .XML file is the correct one for the boot screen. I opened the .zip of a rom deleted everything out of the boot screen folder and dropped in all the files from the nexus one hero hybrid boot screen re signed the zip and everything flashed perfect. I changed many other things as well in the .zip like rosie.apk, sound files, lockscreen files, busybox files, added apps to /system/app and just resigned the zip and everything flashed the way i wanted it to and works perfect.
The way to correctly zip a file is to extract the zip modify what you want then select everything inside the zip right after you open the folder and the highlight everything select add to archive and then zip it up now sign that .zip
so say you extract the ROM and it is named Rom123 now you will have a folder named Rom123 open that folder and select everything file or folder in there and then hit add to archive that will make another zip right there called Rom123.zip pull that zip out to the desktop and sign that zip file and thats it.
I Know that is confusing as it is late as hell and i am tired but wanted to answer this real quick.
Click to expand...
Click to collapse
Perfect, just what I was looking for.
Thank you, just made my day!
Ceger

Theming files?

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

Custom clockworkmod compatible update.zip

Hello, I would like to create my own update.zip that would be compatible with clockwork mod. I have several files in several locations that I manually copy over after new installs like multicolored bash nano iwconfig iwlist etc. And I think it would be much easier to create a installable package for that, I also delete a number of built I. Apps like tweeter amazon etc. And I have seen the scripts inside oyhers update.zip's that I could add the bash commands to remove those things as well.unfortunately I know nothing about what clockworkmod wants and I see binarys inside these zips dont know if those are customized for each zip or the same in all of them, I dont know what files or information is absolutely required. The best possible solution is if I had a blank update.zip that held all of the required files settings and all I needed to do was add my files and asd a few lines to a preexisting script to remove sum stock apps.thinking back I might have seen a file containing all the files names and md5 chucksums for each as well which if necessary I can do. Is there something like this available for download sumwhere? If not ajy resources to learn the required information and find the required binarys.thank you in advance.
Sent from my Droid using Tapatalk
Hi,
I've been trying to learn the same thing. I'm curious if you found anything useful since posting this.
Of course, if I find anything, i'll post back here too.
Thanks.
Same problem here
Good to hear someone with same problems. I want to create a generic ROM for myself and I want to use ClockworkMod to help flash it instead of using fastboot.
Well, I have found no documentation about what ClockworkMod may need for a zip file.
But I guess it could be possible to just replace them with your own by downloading an existing zip file created by someone else.
I'll try it to see if that works or not. Of course, a documentation would be better.
I regularly flash a new CM7 Nightly as they are released and I have to manually modify some things each time a new rom is flashed. I change screen density and add a notification ringtone that CM7 does not have. I wanted to automate that. Since I have to reflash the Google Apps each time anyway, I thought why not modify the gapps zip to include my changes. After searching the web I found a little info about how to do it. I just modify the zip on my computer using WinRar, copy the file to my device and re-sign the package using signapktic which is free on the market. Then flash using CWM. It worked great. No more manual adjustments. There are some instructions here which helped me:
http://forum.cyanogenmod.com/topic/15030-moving-apps-to-system/
I been getting into the kitchen
http://forum.xda-developers.com/showthread.php?t=633246
So far i`ve managed to integrate a few apps , ringtone should be easy
next the fonts from utmost rom
thanks to the kitchen, Im now running at script kiddie level

Signed my ROM - still getting E:sig errors in CWM.

As the subject line states: I've signed (successfully?) my custom ROM zip file using various programs/methods. Each of them claims a successful signed zip at the end. However, when I try applying my ROM via CWM, I get the standard E:sig verification failed error msg. (Of course, disabling the verification check in CWM allows my ROM to be installed, error-free).
Yes, I've been through all the signing tutorials (that I could find) on this board. A couple were quite useful, but all they did was confirm I was doing the procedure correctly.
Here's a bit of background on my ROM:
It's actually a collection of 4 types of APKs:
some stock, Sense stuff... presumably signed by HTC
some 3rd party (Market) APKs... presumably signed by the appropriate author
some of my own APKs (signed by me, with my own SSL key)
some of my own APKs (not signed at all)
I've also gone in and modified some existing stock HTC APKs.
I tell you this info because I think this is where the problem might be.
Is it possible to sign a ROM file only at the ZIP level (and thereby encompass all the APKs within it)?
If not, do I have to go inside the ROM and sign each APK individually? Do I need to sign them all, or only those that have changed? And which key do I sign it with? (mine? generic test?) Is there ever a scenario where I have to remove/replace an existing signature from an APK with my own signature? Do I need to remove any existing META-INF folders before attempting to sign anything?
These are the questions to which I could find no answers.
Any help would be greatly appreciated.
Thanks,
- Anthony
Tigger31337 said:
As the subject line states: I've signed (successfully?) my custom ROM zip file using various programs/methods. Each of them claims a successful signed zip at the end. However, when I try applying my ROM via CWM, I get the standard E:sig verification failed error msg. (Of course, disabling the verification check in CWM allows my ROM to be installed, error-free).
Yes, I've been through all the signing tutorials (that I could find) on this board. A couple were quite useful, but all they did was confirm I was doing the procedure correctly.
Here's a bit of background on my ROM:
It's actually a collection of 4 types of APKs:
some stock, Sense stuff... presumably signed by HTC
some 3rd party (Market) APKs... presumably signed by the appropriate author
some of my own APKs (signed by me, with my own SSL key)
some of my own APKs (not signed at all)
I've also gone in and modified some existing stock HTC APKs.
I tell you this info because I think this is where the problem might be.
Is it possible to sign a ROM file only at the ZIP level (and thereby encompass all the APKs within it)?
If not, do I have to go inside the ROM and sign each APK individually? Do I need to sign them all, or only those that have changed? And which key do I sign it with? (mine? generic test?) Is there ever a scenario where I have to remove/replace an existing signature from an APK with my own signature? Do I need to remove any existing META-INF folders before attempting to sign anything?
These are the questions to which I could find no answers.
Any help would be greatly appreciated.
Thanks,
- Anthony
Click to expand...
Click to collapse
Here is something that works if you decompile and recompile a apk take the res folder out the part you tweaked and throw it in one that wasn't tweaked or extracted and the Sig will be good.
Sent from my PG86100 using xda premium
reaper24 said:
Here is something that works if you decompile and recompile a apk take the res folder out the part you tweaked and throw it in one that wasn't tweaked or extracted and the Sig will be good.
Sent from my PG86100 using xda premium
Click to expand...
Click to collapse
Okay, so you're saying that signing at the level of the ROM ZIP simply isn't enough. (I wish the guides would say that).
You're saying, I will need to preserve the sigs on the original APKs? I get that. But now that raises more questions:
- when you say "decompile" an APK, I assume this is a simple unzip/extract? That's all I've been doing so far (I use 7-Zip).
- Say I now have an extracted APK (assume it was an HTC stock), I can inject my modified files. Piece of cake. I now have an HTC APK with my own data in there. But what about all the other APKs that make up my entire ROM? Do they ALL have to been signed the same way? (In this example, do they ALL have to be HTC signed?) I'm guessing NO, because there are apps in the data/apps directory from the Market, with their own vendor sigs. I can't see why I would have to re-sign those APKs using the HTC sig.
- So, we're back to my original question: can't you sign a ROM at the ZIP level, or do I have to go back into each individual APK inside that ROM and re-sign them all? Why would the original signature work, but not my own? I have generated my own SSL keys, so in theory I should be able to unzip a APK, tweak it, and re-sign it as my own.
Why does my ROM keep failing the signature test in CWM? I am looking for the necessary and sufficient conditions to allow my ROM (any ZIP file, really) to pass the signature verification check.
No one on this board has been able to answer that, so far.
Thanks so much,
- Anthony

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

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

Categories

Resources