[GUIDE]How to make a custom rom?Custom ROMs explained[UPDATE:20-3-2012] - Galaxy Ace S5830 Android Development

Hey Guys,
I am going to explain some of the files in a custom rom,the small and easy to mod files because the aim is to educate newbies and NOT advanced devs.
Ok,So,I have seen a lot of questions being asked nowadays about making custom roms.This guide is NOT about building a custom rom but about editing and modding it.I am doing this guide taking CM7 as base,not stock,so there might be differences between the roms you choose to mod.Also,I am prone to mistakes here and there.If i made any,please comment about it and i will remove it.Also,please feel free to give your suggestions about making this guide better
What you would need:
Notepad++
WinRar or any other zip/rar manager like 7zip or WinZip
If you want go advanced,you would also need these things
Cygwin
Smali/Baksmali
APK Multi tool or anything like that,i dont care
And most importantly,a brain and eyes(So,Dont ask me stupid questions like,how de fuk du i xtarct? and then in brackets,sorry for my english)
GUIDE:
So,first up,download a rom of your choice(Dont forget to get the permissions for modding from the developer) and extract it.When you extract it,you will see 2 folders and 1 file,it varies.It depends on the contents of the rom.
The folders are:
1.META-INF
2.system
The file:
1.boot.img
So,
Open up system and the first folder you are going to see is 'apps'.
As you already see,this is the place where all the apps go,for the history.You might also see some .odex files below the apps.So,if you remove an app,you should delete the odex file too.If you want to add an app,just drag and drop Take care not to delete each and every app you find,because each of them has their own functions.Also,if you delete contact.apk and replace it with a better dialer like Exdialer,you wont be able to add or delete contacts.So,there are some files better left alone.
If you want to know how to merge them,then use google,there are a lot of tutorials on deodexing.If you want to edit an app,then use APK multi tool,again please use google,lots of tuts on this one too.
Also,you will find an app here and its a main one,systemui.apk By editing systemui.apk,you can get transparent status bars,transparent notification bars,centre the clock.Things like that.The idea with which you edit Systemui.apk and framework-res.apk,thats how your rom is going to look like.These files handle the visual things and they are awesome too.For some systemui mods,refer HERE
Now,some apk files are lib-dependent,meaning,they need certain lib files to work,a few examples are,Swype keyboard,now,swype wouldnt work if this lib file is not included in the rom,libswypecore.so,so if you remove swype,remove this lib file also,because its just a wastage of space and it doesnt do anything.Another example is DSP Manager in Froyo,in GB,it works native,no need to add any applications,but in Froyo,if you add DSP Manager,there are a few lib files that you should add to get them to work.
Next,the 'bin' folder,this guide is aimed at the noobs,so nothing about this,this is a bit advanced stuff,so sorry.
Next up,the 'etc' folder.There are a lot of things that go here.I wont be going to full details for the moment because i am having exams,so no time.However,i will be explaining the easy to explain files.
One thing you will notice is the 'init.d' folder.If you want to add any script like LagFree v2,just put the files of the init.d folder in the script's folder here,nothing else.You dont need to copy any other files like META-INF.
Another file,is CHANGELOG-CM,just as the name suggests its a file giving you changelogs
Another file is NOTICE.html..Its just a file showing copyrights and all that stuff.You wouldnt need to edit that,would you?
Will add more about the other files soon
Next,the 'fonts' folder..You guys need an explanation for that??
Next,'framework' folder.Here you will find framework-res.apk(Obviously,duh...).I wont tell about any other file because this is aimed at new users,not advanced guys.Framework-res is where all the icons in notification bar are.The battery icons,they are all in framework.Also,lockscreen icons
go here..Most of the icons.If i have to start on anything.It would take me weeks,theres so much to write about framework.Also take care not to mess up the framework.Because its like the skeleton(thats what i know ) of a rom.If a framework is incorrectly configured,the rom wont boot.So,keep that in your mind always when you edit framework.
Next,the 'libs' folder,This guide is aimed at newbies,so not touching this part.
And comes 'media'..Most probably you will find 2-3 folders here.Audio,bootanimation.zip and wallpapers.
If you want to change the default,its in build.prop,not here,i will explain that later.If you need to add some audio,its just drag and drop,nothing much,just put them in the right folders,like alarms,ringtones and notifications
If you need to add wallpapers,reszie the pictures to 640x480,thats the resolution that works for ace.Also resize it to 107x80 and save it as another pic with a _small at the end.For eg,the default file is defaultwallpaper.jpg,you make another pic with 107x80 called defaultwallper_small.jpg.
Then,theres the bootanimation.zip..However way you change this thing.Always name it bootanimation.If you want to know how to make a boot animation,then refer freeyourandroid.com
Next up is 'tts' folder..Sorry but i dont know much about this folder.I think this folder contains the languages for the tts app but i am not sure about it.Same goes for 'usr' and 'wifi' folders.But since this thread is aimed at newbies,i dont think there wouldnt a point in writing them up anyway
Next up is build.prop file.Open it with notepad++...build.prop file is pretty self explanatory.
Here you can change the most basic things like the android version that setting shows..Wondered how people are making 2.3.4 look like 4.0.3 in settings??Its build.prop.Also,you can change what 'About phone' shows here.
Other things,you can change things like,how long your wifi scans,how much battery your phone saves while in sleep,Dalvik VM heapsize and default ringtones.If you are wondering what # stands for,it signifies that,that particular tweak is not running,so you can take out the # if its a tweak you like.You could also use it say things like,Additional build properties.You could make it #AdditionalBuildProperties and go to the next line and give your tweaks there.Some build.prop tweaks can be found in slaid480's thread in Galaxy Ace S5830 titled "[MOD]Build.prop tweaks for SGA" or you can go to freeyourandroid.com and find some tweaks there,however the tweaks listed there are universal,so practise caution when playing with build.prop
Now to boot.img..Theres an awesome guide about this in freeyourandroid.com Please have a look at it,because there are lots to write about this one.This is where Cygwin comes in,for instructions on unpacking and repacking and commands and info about boot.img,referHERE and HERE.My summarized version,boot.img is where you can replace kernels.This is where you can make those low-level changes
Then,to META-INF folder.You would find lots of folders here but the file that you would edit consistently is update script.Find it and open it with Notepad++..Unless you edited xbin and bin files,this is not hard to do..Just change around ui_print to what you like.Dont touch anything else if you dont know what you are doing.If you DID edit xbin or bin files,you would need to touch advanced things like symlink tagged ones(I had to give them some sort of a tag)
Updater-Script References and notes:
Now,the updater-script is not something that you should mess around with,a single line of error in the script could get you in trouble.You might also have heard these words,Amend and Edify and wondered what they are,well Edify is the language with which Updater-script is written,while Amend is the language with which Update-Script is written.Now,As far as i know,Ace does NOT support Update script,it just supports Updater-script,so if you are working with kitchen,dont forget to swap the files in META-INF with the the updater-script provided by ketut.kumajaya in Blackhawk thread.So,you should learn to study updater-script of roms and patches before you mess around with them,especially patches here...Now,for example,I made a GPS patch that replaces hw folder in CyanogenMod with my patch.Now,i tell the updater script to delete the hw folder in lib and make another one and put my files in there,you,a normal user will flash it and it would work,but a rom maker without seeing that i have told the updater script to delete hw folder,adds my lib files to the existing lib files,which causes the rom not to boot.So,study the updater-script of patches and see what they do before you jump in and start doing things your own way and mess things up.I will write down a few updater-script commands here and what they do for your convenience now.Here you guys go with it:
mount-mounts a filesystem
is_mounted-checks if a filesystem is mounted
unmount-Unmounts a filesystem
format-format a filesystem (duh..)
delete-Deletes a single file
delete_recursive-Deletes a folder and all of its contents
show_progress-Display flash progress
package_extract_dir-Extract all the files present in a directory to a specified directory
package_extract_file-Extract single file from directory to specified target
file_getprop-dont know much about this one
symlink-Unlinks any existing symbolic links before creating the new symbolic links.
set_perm-Sets permissions for a file,note you dont write rw-r-r here.Its the numbers,for example,for root access,you write 777(right?),not anything else
set_perm_recursive-Sets permissions for a full directory,for example,if you specified a folder,permissions for the folder and all files in it will be set.
getprop-This function returns the value of the property specified. This is used to query platform information from the build.props file.
write_raw_image-Writes a raw image into a partition
apply_patch-Applies patches to a directory -_- (dont you guys understand it just by reading that? )
apply_patch_check-Checks if a file can be patched or if they have been patched
apply_patch_space-Checks if there is enough space to apply a patch
read_file-Reads contents of a file
sha1check-If only data is specified, then the function returns the sha1_hex string of the data. The optional parameters are used if you want to verify that the file you are checking for is one of a list of hashes. It reutrns the hash it matches, or returns nothing if it doesn't match any of the mentioned hashses.
ui_print-It outputs a message to the users while flashing.So,if you see something like 'This is so awesome',know that its not such a big deal and that its just a line of editing here
run_program-Runs a program
ifelse-This is the if-then construct of the Edify scripting language. The truecondition or falsecondition arguments can be a single edify command or a script block. Script blocks can be formed by enclosing the parameter with parenthesis, and seperating the commands with semicolons
abort-duh..it aborts script execution
assert-If condition evaluates to false, stops script execution, otherwise continues processing.
Thats it,dont worry after seeing all these commands.You wont see them all in most of the roms.Here is a list of commands that you usually see in a updater-script.
ui_print
mount
unmount
delete
delete_recursive
package_extract_directory
symlink
show_progress
set_perm
set_progress
set_perm_recursive
getprop
run_program
assert
Now on making it a flashable zip,archive them to a zip file.Get a signer here: http://forum.xda-developers.com/showpost.php?p=6050996&postcount=2
NOTE:Signing is not necessary
The instructions on using that are given with it.Just rename it back to the name you like after signing it.
Thanks to everyone.Especially,freeyourandroid,XDA and TeamCooper and all members of XDA developers and to me (well,you are the one who does that,remember that button Jk )
Hope this helped you guys..Again,this is a thread aimed at educating the new members,not advanced guys.Sorry if i missed anything or made a mistake..Please give me suggestions on this too.Will add more info to this thread when i have the time[/SIZE]

good guide

Looks good

Very helpful.

Fix those grammatical errors !
*grammar nazi alert*
Herpderp Adreno + Tegra.

gOOD guide overall but you shiould make it more advanced

EmoBoiix3 said:
Fix those grammatical errors !
*grammar nazi alert*
Herpderp Adreno + Tegra.
Click to expand...
Click to collapse
Aah....grammar hitler

slaid480 said:
gOOD guide overall but you shiould make it more advanced
Click to expand...
Click to collapse
Yep..I know that..I will work on it but i dont have much time now

This is a great guide , it'll help me a lot ^_^ thanks.

Great tut dude

Is an update needed??I dont think so because it didnt even stay on the front page for a day

Awesome guid please add some more advanced features and custom rom building guide also if u can. :thumbup:
Sent from my GT-S5830 using Tapatalk

The bad effect will be more and more new custom firmware which is actually just a re-branding

ketut.kumajaya said:
The bad effect will be more and more new custom firmware which is actually just a re-branding
Click to expand...
Click to collapse
What???I dont get you

mor_1228 said:
Awesome guid please add some more advanced features and custom rom building guide also if u can. :thumbup:
Sent from my GT-S5830 using Tapatalk
Click to expand...
Click to collapse
I will add them by tonight or something like that when i have time..Not much time now,stupid exams Oh,i hate them

Originally Posted by ketut.kumajaya
The bad effect will be more and more new custom firmware which is actually just a re-branding
Prawesome said:
What???I dont get you
Click to expand...
Click to collapse
Click to expand...
Click to collapse
i got what he is trying to say.
he is saying that due to rom building guides noobs will also learn how to build custom rom but they may not have that knowledge skills to make a distinguished ROMS they will be building common roms with little or no difference, difference will be only that different people will release rest things will be kind of same only no drastic changes.
hope i am right

mor_1228 said:
i got what he is trying to say.
he is saying that due to rom building guides noobs will also learn how to build custom rom but they may not have that knowledge skills to make a distinguished ROMS they will be building common roms with little or no difference, difference will be only that different people will release rest things will be kind of same only no drastic changes.
hope i am right
Click to expand...
Click to collapse
Maybe..But i am tired of questions on building custom roms..Recently,there were a lot of questions on building custom roms

Yeah.. i'm a newby become smarter... thx for share...
Sent from my GT-S5830 using xda premium

I will add more info about the boot.img and framework-res.apk tonight

Nice work, thank you
If you have time, can you please post a guide on how to sign APK files?
For example, if i want to edit an icon of an app, i change the icon in the .apk but then i have to sign it, how can i do it?
On the net i found lots of guides and programs but none of them worked for me...
Anyway good work

Related

Very Quick Question

If I take a ROM in .ZIP format and unzip it on my PC into a folder with the same name...
Then delete any .APKs of programs I have no use for (Twidroid, facebook, etc) and then replace the boot.img with a different kernel of my choice and different SuperUser.apk...
Can I then ZIP this primary folder and load it as a ROM onto my MT3G?
Forgive me if this sounds really stupid, but I have no idea.
Would it need to be "cooked" before I can load it??
When you cook you need to make sure the gloves are on and you have the oven's temp turned up real nicely to fry that thing
I guess you didnt search or something? I need you to confirm that you cant/can see this at the top left corner of screen:
xda-developers > Dream > Dream Android Development
Press Dream then head to Q&A section please.Wait a sec...Thats not a Dream..You belong here for asking q's about your phone:
http://forum.xda-developers.com/forumdisplay.php?f=480
Just do a search for signing tool and it shows up.
rbrainard said:
If I take a ROM in .ZIP format and unzip it on my PC into a folder with the same name...
Then delete any .APKs of programs I have no use for (Twidroid, facebook, etc) and then replace the boot.img with a different kernel of my choice and different SuperUser.apk...
Can I then ZIP this primary folder and load it as a ROM onto my MT3G?
Forgive me if this sounds really stupid, but I have no idea.
Would it need to be "cooked" before I can load it??
Click to expand...
Click to collapse
its more complicated than it looks...
First u will have to know if removing those .apk will not cause any trouble...
Second u will have to sign the apks u r going to add, and signed the zip too...
about changing the boot.img has been tried before in another thread...
but most important u will have to search, search and read, read...
going to try and find some thread for u, before the mods closed this...
Need to have it resigned...once a zip file is open it breaks the signature but I would aslo like to kno if this is possible
ilostchild said:
Need to have it resigned...once a zip file is open it breaks the signature but I would aslo like to kno if this is possible
Click to expand...
Click to collapse
here its a thread about resigned:
http://forum.xda-developers.com/showthread.php?t=473580
read it all, has interesting stuff, but keep searching...
actually i would like to try this too...
if u ask devs, unless they want to teach u, great...
Wow...
You can open zips (roms/updates) and browse them without the need to resign them. If you change any of the contents in a zip (rom/update) file, as in remove or add, then you have to resign. You do not have to resign the apks you add to the zip (rom/update) file.
To do what you want to do, refer to the link about signing zips that was posted above. Remove the APKs, sign the zip (rom/update) file, and apply the update to your phone.
bring in the wrecking crew!
anyone know how to run this on a mac?
Ha people had post, but the one that make the thread, its no where...
Sweet! Thanks folks.
The "Search" function is the most important in any forum, but it does the user no good if they have absolutely positively no idea what to search for... lol
My goal is to take Manup's Eclair_2.1-v1.5 and remove all the .APKs I don't have any use for... Swap the boot.img for the eclair one with the 10MB hack, replace the SpareParts.APK with one that contains "Keep home app in memory" option, etc, etc, etc.
rbrainard said:
If I take a ROM in .ZIP format and unzip it on my PC into a folder with the same name...
Then delete any .APKs of programs I have no use for (Twidroid, facebook, etc) and then replace the boot.img with a different kernel of my choice and different SuperUser.apk...
Can I then ZIP this primary folder and load it as a ROM onto my MT3G?
Forgive me if this sounds really stupid, but I have no idea.
Would it need to be "cooked" before I can load it??
Click to expand...
Click to collapse
You've just described in detail what about 90% of roms out there really are: open zip, add/remove files, ..., profit!!!
As mentioned correctly by Moonspoon, all you'd need afterwards is to sign your package (just to ensure that there's no problems with the signature, delete the three files inside /META-INF (leave the folders alone)).
Also, as mentioned by ginatojr (kind of...), you have to know which files you're removing, for example, removing TelephonyProvider.apk, well, that should be obvious. One that's not so obvious is gtalkservice.apk. When I first started, I removed it because I though it was part of Google Talk, when in fact it's more closely related to GoogleApps and SubscribedFeedsProvider.
The only times you want to deal with signatures is if your roms come from two different sources (if you're using an AOSP test-signed core and want to toss in some release-singed Google apps), but for the most part it's unnecessary and mostly discouraged as it's a different can of worms.
So, yeah, that's basically "Rom Cooking 101", where most other people releasing roms are at "Rom Cooking 102", there's really nothing to it.
rbrainard said:
Sweet! Thanks folks.
The "Search" function is the most important in any forum, but it does the user no good if they have absolutely positively no idea what to search for... lol
My goal is to take Manup's Eclair_2.1-v1.5 and remove all the .APKs I don't have any use for... Swap the boot.img for the eclair one with the 10MB hack, replace the SpareParts.APK with one that contains "Keep home app in memory" option, etc, etc, etc.
Click to expand...
Click to collapse
The keep in home might not work on 2.1 roms yet.
If this works out... My future plans would include doing this to streamline and modify any ROM of my choice as they are released.
I have absolutely no intention of modifying ROMs for redistribution.
This will be for my own personal needs alone.
Can anyone tell me where the .APK files of Market downloads are stored on the handset?
rbrainard said:
Can anyone tell me where the .APK files of Market downloads are stored on the handset?
Click to expand...
Click to collapse
NEVERMIND!
Found them in /SDCard/BackupRoot/app directory.

(Dev) Here goes nothing

This is my attempt to get some more creativity, innovation, and roms here on xda. alot of people here have incredible skills but they cant be harnessed because they dont know what to do. if you are an artist we need you make icon packs. you have made 30 roms but you cant sign them. blah blah.
so no one abuse this but i attached a toolkit to do anything and everything with android on windows. im pushing this to be used for creating themes. hopefully it can help. but i thought it would be nice if everyone had this and the opensource community could start to grow even more.
i like this idea because it can help fellow Devs and even the watchers. everyone can get involved and give something to the community.
And now i present the Avabox
Any questions post them up.
OUTLINE------------------------------------------------------------
unyaffs-you have the ability to take system.img and data.img from you nandroids and get specific items from them.
Autosign- sign anything and everything. name your zip update.zip and follow the readme. roms themes, apps, anything.
Baksmali- put in apk in the folder. read readme. edit any icons wallpapers, anything. close it up and enjoy.
Perlscripts- this opens the boot.img for you.
Read the readme on all of these programs.
So this is going to be a quick tutorial Im gonna put up a video soon on how i got this to work on my computer
First things first download Avabox and unzip it in your C folder (same place you put androidsdk).
then get the java runtime from here not to be confused with the java development kit but since your there might as well grab it as well.
Install the java runtime then reboot
then open up avabox and click on autosign and place the zip you want signed in that folder and name it update.zip (dont add the .zip part it should already be a zip file).
then open up command prompt and type:cd\
cd Avabox/auto-sign
java -jar signapk.jar testkey.x509.pem testkey.pk8 update.zip update_signed.zip
After that last enter give it a second and look in your avabox/update file and you'll notice a new file called update_signed.zip
I know that this is almost word for word from the read me but a few differences can go along way expect a video shortly..... well around wednesday or whenever i can get someone to help with this
porting
im interested in learning how to port and combine different aspects of themes and other mods. will this do it or is there other software i need. I can do the work if shown the way. I read all the post everday with peopl;e asking for this and that and i do it myself. If shown I would help with requests as much as possible. HELP PLEASE
Thank you Avalaunch!!
so with this software, can i take a signed theme mod (like launcher or taskbar) and it will grab the images for me to edit, and then repack and sign to a flashable zip?
Everyone that knows how to use bak/smali, I have a question.
The modifications I made to the extracted pngs aren't getting transferred back to the original apk when I close it back up. Any Ideas? I'm getting really close to a breakthrough for 2.1. Any help would be appreciated
regaw_leinad said:
Everyone that knows how to use bak/smali, I have a question.
The modifications I made to the extracted pngs aren't getting transferred back to the original apk when I close it back up. Any Ideas? I'm getting really close to a breakthrough for 2.1. Any help would be appreciated
Click to expand...
Click to collapse
hm ill have to check into it. it should be making a new classes.dex too. i never really used it on edits.
Avalaunchmods said:
hm ill have to check into it. it should be making a new classes.dex too. i never really used it on edits.
Click to expand...
Click to collapse
It changes the classes.dex and resigns it it looks like, but doesn't copy the mods of the pngs to the apk.
regaw_leinad said:
Everyone that knows how to use bak/smali, I have a question.
The modifications I made to the extracted pngs aren't getting transferred back to the original apk when I close it back up. Any Ideas? I'm getting really close to a breakthrough for 2.1. Any help would be appreciated
Click to expand...
Click to collapse
What do you mean? Baksmali and Smali are for decompiling classes.dex and opening it up for the .smali files that are inside. Smali takes that output and recompiles it back into classes.dex for your .apk or .jar file.
You need to update the baksmali and smali .jar's. You have older versions and that will cause issues with certain .jar and .apk's when decompiling. baksmali-1.2.1.jar and smali-1.2.1.jar are the latest versions and will not require the BOOTCLASS PATH to be included...
Does the autosign work windows 7 (64 bit)? I've heard issues with other autosigns on 7. If it doesn't, no biggie I got xp in a VM... lol
obannvi said:
What do you mean? Baksmali and Smali are for decompiling classes.dex and opening it up for the .smali files that are inside. Smali takes that output and recompiles it back into classes.dex for your .apk or .jar file.
Click to expand...
Click to collapse
Yeah I get it now, after playing with it for a while.
Avalaunch, you should change the first post.
Baksmali- put in apk in the folder. read readme. edit any icons wallpapers, anything. close it up and enjoy.
Click to expand...
Click to collapse
that description is a little confusing to a person that NEVER used smali/baksmali before. It makes it seem like after you edit the unzipped files, you could just run smali and it will put al the changes in the new apk. I figured out that's not how it works lol I feel pretty stupid now looking back at my last question haha
regaw_leinad said:
Yeah I get it now, after playing with it for a while.
Avalaunch, you should change the first post.
that description is a little confusing to a person that NEVER used smali/baksmali before. It makes it seem like after you edit the unzipped files, you could just run smali and it will put al the changes in the new apk. I figured out that's not how it works lol I feel pretty stupid now looking back at my last question haha
Click to expand...
Click to collapse
What im trying to figure out is why would you even need to use baksmali/smali to edit .png's inside an .apk. All that needs to be done is opening of the .apk with 7zip, modify whats in /res/drawable etc then close...No need to sign .apks or anything. If anything, the script needs to contain something to extract /res/ * from the .apk to edit.
obannvi said:
What im trying to figure out is why would you even need to use baksmali/smali to edit .png's inside an .apk. All that needs to be done is opening of the .apk with 7zip, modify whats in /res/drawable etc then close...No need to sign .apks or anything. If anything, the script needs to contain something to extract /res/ * from the .apk to edit.
Click to expand...
Click to collapse
I'm actually doing more than that. I am changing the code to look for instead of <name of file>.jpg to <name of file>.png
While also putting the new png in the apk. Think that's possible? I changed all of the locations where that file comes up in the smali code.
regaw_leinad said:
I'm actually doing more than that. I am changing the code to look for instead of <name of file>.jpg to <name of file>.png
While also putting the new png in the apk. Think that's possible? I changed all of the locations where that file comes up in the smali code.
Click to expand...
Click to collapse
I gotcha. So you're looking in blah.smali for any reference to .jpgs and changing that reference to look for .png instead??
obannvi said:
I gotcha. So you're looking in blah.smali for any reference to .jpgs and changing that reference to look for .png instead??
Click to expand...
Click to collapse
yeah, not working too well atm, but working on it.
I think this is what I've been looking for. Downloading now.
Just noticed that ActivePerl was for 64bit. I am downloading 32bit as I have only have 32bit Vista Pro installed and not the 64bit.
regaw_leinad said:
Yeah I get it now, after playing with it for a while.
Avalaunch, you should change the first post.
that description is a little confusing to a person that NEVER used smali/baksmali before. It makes it seem like after you edit the unzipped files, you could just run smali and it will put al the changes in the new apk. I figured out that's not how it works lol I feel pretty stupid now looking back at my last question haha
Click to expand...
Click to collapse
i guess i need to explain more. i use baksmali to make apks easier to search through. for me at least. instead of changing the type and everything i just put it in the folder and baksmali then do changes and create a new archive. sign and change .apk. if you smali it back to apk then it wont save edits. sorry about that anyways has this helped people so far? i love showing that windows can be a dev platform
&RoidRage said:
I think this is what I've been looking for. Downloading now.
Just noticed that ActivePerl was for 64bit. I am downloading 32bit as I have only have 32bit Vista Pro installed and not the 64bit.
Click to expand...
Click to collapse
yes just google active perl i use win 7 64bit and when this toolbox was made, it was only made for certain people who had 64bit.
Sorry for the n00b question, but I have searched and haven't had much luck. Hopefully, this is the best place for this question. I just started editing .png's and updating some apk's files to customize some things on my phone for looks. However, I am really interested in modifying the taskbar and notification screen, but I have no clue where to start. Is there a guide somewhere I could follow to learn how to change them? What programs, if any additional ones will I need etc..?
Thanks for your help!
Figured it out on my own. framework.apk and resources.apk

[Q] Help understanding to make Themes

ok so i've read several, several threads on making themes, metamorph files, and what not and just wanted to ask a couple of questions since i'm going to try to start my own theme for my fascinate.
i know i need to be in the framework-res.apk and twframework-res.apk files. Is the twframwork-res.apk only needed if i'm themeing for tw or can i just work in the framework-res.apk? also i've read somewhere not to mess with the .9.png files is this true here or is it ok to change these? also i'm not 100% on how to zip for a clockwork flash. do i just do a normal .zip file or is there something else thats has to be done to be flashable thru clockwork. o and is there anyhting else in the drawable folder i shouldnt touch? thanks for the help in advance
I am a little curious myself, but I haven't taken the time to look into it. You might check out this wonderful pdf:
http://tinyurl.com/2dnt4lv
I hope you get a more proper answer. Bump.
Swyped w/ XDA App. System: http://tinyurl.com/26tmcr9
Best way to learn how to build something is to take it apart. There are many valuable resources on line about android themeing. Knowledge of performing xml edits for font color and graphic placement. And using 7zip to be able to open an apk using the open archive feature and being able to extract and add image files from the drawable-hdpi folder. Make a back up of you phone and utilize some reverse engineering and experiment with some image replacement and give it a flash. Coming from windows mobile and no android knowledge I had things figured with about 3 hours of reading and experimenting.
good day.
You will need both framework files if you intend on getting it fully themed. It all depends on what you want to change. You can mess with the .9's, assuming you know how to do it properly. IE: modify your .9, edit your .9 in draw9patch, then compile in eclipse.
To sign a zip ---> java -jar signapk.jar testkey.x509.pem testkey.pk8 zip-name.zip new-zip-name.zip.zip
ty for the pdf that explains a lot in simple terms, and maybe I'll dive in on my eris first just in case lol, and thanks for the zip signing
Sent from my SCH-I500 using XDA App
Also look up apk manager in search (don't have the link handy)
on the .9.png files do I just open them in gimp/photoshop and then open it again in draw9patch to resave it? lol lil confused on these particular files
Sent from my SCH-I500 using XDA App

How to Edit XML Files on Your Device (AIDE/Axel)

Here is a method for editing xml files directly on from your phone (as well as a fully functional Eclipse compatible IDE). I'm going to sleep so I'll post a reply I made in another thread first, and clean up in the morning. Have fun..G'night!
-------------------------------------------------------------------------------------------
Quote:
Originally Posted by Toni5830
You can extract xml but you can't see them (only strange symbols) and you can't edit them from phone.. you must use PC and decompile them.. no other possibility
Inviato con Tapatalk 2 dal telefono di casa
-------------------------------------------------------------------------------------------
No, you can edit them on your phone. Axel is one of the apps to use. The second is an IDE called AIDE which is compatible with Eclipse. You can develop, program and publish complete apps from your phone. I figured out how to edit compiled xml the other day. Ninjamorph is also useful because it unpacks the archives into a project which happens to be near where your AIDE projects are.
Begin by opening ninjamorph and choosing the apk to work on and create a project (can do this manually but keep a back up of the apk). Next, open AIDE and create a new project. As an example I'll be editing the lg_allapps_button_text.xml file in LGHome.apk (LG's launcher on G2, so files may differ for you). Choose the HelloWorld setup as that's the less,cluttered one. After creating the project, open up a file manager (you can do this from within AIDE as well) and create the same directory structure for your xml file (probably doesn't matter if a ../res/color xml file is in ../main..but it's good practice. The xml I'm editing is in /res/color, so I'll go into the project directory and create a ../res/color folder.
Now open Axel up and find the xml in the ninjamorph project that you are editing. Again in my case it'll be in /res/color. Go ahead and open it with Axel. Don't bother editing it here, we're going to just go into settings and "save as" (into our AIDE project directory) ../res/color/lg_allapps_button_text.xml. This adds it into our AIDE project and we can now go back into AIDE. In the oberflow action, choose "Goto Files" or whatever it's named (also an icon at the top for this action). It'll open a pane at the bottom with your project files. At this time you'll probably notice AIDE throwing a lot of errors (errors in your code, not app errors lol).
We have to fix every one of them before finish, so might as well start now before editing. Conversely, you could do this in Axel first once you know what kind of errors to expect and fix. In my case, I see two errors because the file is really small. Once clicking on the xml I want to edit in the files pane, I can see that it's telling me string values aren't allowed in the "color' attribute. The color is black but when Axel decompiled it, it changed it from it's ARGB form. I see this -
Code:
#xml namespace blah blah...
.....
....... android:color="1F000008/0xFF000000"
Of course there is more, I just highlighted the attribute I need to fix. You're going to need to learn how attributes need to be formatted or learn and keep a reference handy. Google has nice guides online for building android apps. In this case we change it to:
Code:
...
.... android:color="#FF000000"
Technically yes it's still a string, and yes the wrong format was hexadecimal (sort of), but now we have one less error. On large xmls, this gets annoying but you'll get fast at it. So, I've fixed,myerrors, so now for simplicity I'll just change the color on one of the attributes..to red ("#FFFF0000"). Now that edits are done and errors done, go back in the ooverflow action and scro,down and either click "Run" or "More" and then "Rebuild Project". We aren't worried about any other file, we just want our xml recompiled. Once it's done, if you want you can install your fancy Hello World app (or Tetris game app), lol but it's just as well if you choose not to.
Next, go back into your file manager and find your way back into your AIDE project directory. Locate the bin folder (where your compiled project will be) and navigate to your xml. Again, in my case, I'll be going to /res/color. Make sure you find the compiled version (the binary one with all the cool symbols). Copy this back into the same structure inside the ninjamorph project folder. If you aren't using ninjamorph and manually doing this then make sure you have a backup apk handy and akip the ninjamorph stuff.
Opem Ninjamorph back up and choose to complete your project. Once it's done repackaging it'll ask you if you want to resign the apk
Follow Steven's directions and dont sign it if its a system apk. Next he'll ask about zipaligning (i think?). I don't choose this option at all. If my mods work, then I'll redo the project and choose that option. Problem is, sometimes it can cause issues and you don't want to add more variables in until you know that all,is working or you'll be asking yourself "wonder if my edits were bad,or the zipalignment".
Ninjamorph will create a backup of the apk for you, and now you'll be given the option of installing the apk. You should know what you're doing already but...if using TWRP you can go ahead and replace the modded apk and reboot. Worst that'll happen is boot loops or force closes and you can manually go into recovery and use TWRP's file manager to copy your backup back (may need to mount /system first, and may need to chmod as well. Then try again. If you boot up and all is well, congrats! If using CWM, make sure you have a recovery plan before making the switch.
I have no clue if,there's any easier way. I'm still working on it. Granted, kf you're just going to edit a color like in my example it'd be MUCH easier just using a hex editor. AIDE is a pretty damn slick app as it also supports native mode C/C++ for developing codecs, drivers,,etc. For $8 you can purchase full version with support for larger projects and github and a few other things.
This method should work on any device that can run all those apps. I'm using a LG G2. I'm not the,developer of any of tbose apps so don't come to me if they aren't working: )
Reserved
MidnightHarvester said:
Reserved
Click to expand...
Click to collapse
Thanks sir really appreciated your work
Also please continue to post apk editing posts

[guide]how to build/modify roms for samsung devices [7.0/6.0.1/maybe more]

Firstly, by no means, I am a great developer or an expert. I have been developing ROMS for Samsung Galaxy Note 5 lately. I was also a noob before making all this. But by reading various guides on XDA, learning from many many great developers/contributors on our Note 5 Forums and talking with various friends which I made on XDA, I know quite a bit about ROMS and MODDING in general. So, here I would like to share all which I have learnt so far, and will be updating this guide regularly.
WARNING!​I am not all responsible for what you do to your device, whether you blow it up, or you got late to reach your office, coz alarm never sounded, or your girl friend dumps you for not picking her phone(boy friend never do that).. Neither me nor XDA is responsible for that.
CREDITS​
My brother, my teacher, my great friend, @andyaguilar94, who was the first I contacted ever via a PM and he was so kind to teach me stuffs and helped me learn whatever I have learnt today.... Thanks a lot bro...
@CrsMthw and @Androidwizzard, for always helping me solving my issues with the ROM and being so so so and so humble to listen to all my crap and being a constant support to me...
@karan2012, @pelpa87, @Ather, @diegonnec for being my great friends, helping me out in various things, pointing out my silly mistakes and being there for me anytime I needed them...
@ASSAYYED and @zxz0O0 for their Awesome tools (Kitchen and SamFirm)
If I forgot to mention anyone, I would love to add them to this list...
PRE-REQUISITES BEFORE GOING FURTHER​
TWRP or any other Recovery installed on a rooted Samsung device
NotePad++
WinRAR or 7-ZIP
A Good knowledge of Windows Explorer
A Samsung Device to test on
A bit of patience and a lot of time
Before beginning, I would like to tell you guys that this is not a guide to PORT some other device's ROM to your own device. This is just a guide to modify your own device's latest firmware available and making your own ROMS... Secondly, this should work on most Samsung Devices and most of the Android versions including Marshmallow (6.0.1) and Nougat (7.0) and could work on other versions as well
CONTENTS OF THE GUIDE​
Okay, now coming back to guide, this guide will be divided in 5 sections:-
Creating a very basic ROM using Kitchen
Adding Basic Mods to the ROM (using CSC and Kitchen)
Learning about updater-script syntax and adding external features to the ROM
Learning about adding AROMA and about aroma-config syntax
Last but not the least, some tips and tricks to make your ROM even awesome
CREATING A VERY BASIC ROM USING KITCHEN​
Okay so, there are two ways of developing a ROM:-
1)Without a kitchen
2)With a kitchen (RECOMMENDED)
I will cover the method using a kitchen as it is much more efficient and time saving. Futhermore, Without a kitchen method only works for already available flashable ROMS, whereas a kitchen allows making a ROM directly from the firmware zip file.
INSTALLING AND KNOWING ABOUT ASSAYYED KITCHEN
Okay so, kitchens are basically designed to make the life of ROM Developers a lot simplers. All the functions that a kitchen offers, can actually be accomplished using File Explorer as well. But, it would require whole lot of efforts and time. So, therefore, most of the devs out there, use one of many amazing kitchens available. For this guide, we will be using ASSAYYED KITCHEN (I know, that its development is stopped, but it has a great lot of features that are available in an easy to understand way...)
So, first things first, lets download and install ASSAYYED KITCHEN
Step 1:- Download the ASSAYYED KITCHEN from this official thread, by clicking here.
Step 2:- Once downloaded, then copy the 7zip file to whichever directory you want to install this kitchen on your PC.
Step 3:- Then extract the zip file using 7zip of WinRAR.
Step 4:- If you didnt change the name of the zip file, you should see a folder named "ASSAYYED_KITCHEN_V1.82_STABLE", once extraction is completed.
Step 5:- Inside this folder, you should see a folder named "TOOLS" and an exe file named "ASSAYYED". Run this exe file. Once it is loaded, you should see a black screen with a prethora of options.
Step 6:- Now go back to the ASSAYYED Directory, where you had the "TOOLS" and this exe file, and you will be surprised to see three new folders:- "PLACE", "READY" and "WORK".
Okay so, we are done setting up the kitchen, now before we begin our actual ROM Development/Modification, let me explain you what are these folders and what do they do.
"PLACE" folder contains the base ROM zip files or your firmware zip files. This folder essentially contains the base ROM/FIRMWARE, that you are going to work upon. You will need to put the firmware zip (which I will tell you where to get) in this folder. This firmware will act as the base, on which you will make modifications and make your own ROM
"READY" folder will contain your ROM zip files. This essentially has your ROM zips that you will make and flash on your device
"WORK" folder contains the ROM files. As the name suggests, this folder is the one, we will be working on. This contains the entire ROM files (which I will explain later)
"TOOLS" folder is nothing we have to worry about for now. It essentially contains some important files and applications we might need.
As you must have seen, the kitchen has various options, and I can't explain all of them in one go, so I will explain them as we proceed through the guide.
So, finally we are done with the kitchen and stuffs, now lets download the firmware for your latest device. Well, let me share with you, how I download firmware files...
Firstly, download SamFirm Tool, by clicking here and selecting the latest zip from Post #1. Again, this is a depreciated tool, but it is important for downloading firmwares at high speed, because otherwise, if you download it from any website, they might charge you, or make the zip file available at slower speeds.
Secondly, head to this website, and in the dropdown menu, select your device and check (dont download) for the latest firmware available for your Model Number and note the "Model" and "Region".
USING SAMFIRMTOOL TO DOWNLOAD FIRMWARE
Step 1:- Once downloaded, extract the SamFirm_v0.3.1.zip file (I told you to download above) in your desired directory.
Step 2:- In the extracted folder (which should be "SamFirm_v0.3.1"), you should see a few files, but dont touch any of them, just launch the "SamFirm.exe".
Step 3:- A new window will open and in that window, you should see two columns namely, "Firmware Info" and "Download".
Step 4:- Put the "Model" and "Region" (which I told you to make a note of) in their respective sections inside "Firmware Info". Tick on "Auto"(If it is unchecked)
Step 5:- Click on "Check Update". After this, it will process about the latest firmware and will eventually fill the details in the "Download" column.
Step 6:- After this, you know the obvious step, click on "Download". Now sit back and relax, till the firmware is downloaded
Step 7:- Once the firmware is downloaded, you should click on "Decrypt".
Step 8:- After this, get to the "SamFirm_v0.3.1" directory (which contained the "SamFirm.exe"), and you should see a zip file.
Step 9:- Copy and paste this zip file in "PLACE" folder of ASSAYYED kitchen (that we talked about earlier).
Now finally, we have our firmware and kitchen in place, Now lets begin ROM DEVELOPMENT
CREATING YOUR OWN VERY FIRST BOOTABLE ROM
Step 1:- Launch "ASSAYYED.exe" from your kitchen directory.
Step 2:- As you can see, from various options, we need to begin with the very first option that is, "START CREATING PROJECT". In ASSAYYED, we select options, by typing the number next to the option we want, and pressing Enter. So, for example, we need to select "START CREATING PROJECT", we know the number corresponding to it is "1", so we press 1 and then ENTER.
Step 3:- After this, it basically asks Where to Get the Firmware, now, we know it is in "PLACE" folder and we see that the corresponding to "PLACE_FOLDER" is default. Now, I would like you to remember that specifically for this guide, wherever you see the word "default" in the kitchen, you just need to press Enter keeping it blank. So, I hope you got this.
Step 4:- Now the kitchen will search in the "PLACE" folder for the necessary zip. Select the required firmware by pressing the number corresponding to it and then enter. For example, for your very first project, it will be "1", then enter.
Step 5:- Now type the NAME of your Project. You can keep it anything or even leave it blank by pressing enter. Now sit back, relax, take a break and let the kitchen do its work.
Step 6:- Once Extraction is complete, you should see something like "PRESS ENTER TO CONTINUE". So Press Enter and now minimise the kitchen and head to the "WORK" Folder.
Now, explanation time , once you open the "WORK" folder, you should be greeted with 2 folders and a file.
First would be a "META-INF" folder. This is the directory which TWRP or any other recovery looks for when you intend to flash anything. This folder is a MUST, without which no matter how good a ROM is, you will never be able to flash it using a recovery...
Next would be a "system" folder. This is the directory which contains the main ROM, this will be the folder where we will be making small edits in various files to get various mods. Essentially, you can consider this folder as the full ROM itself.
Lastly, there would a file by the name of "boot" or "boot.img". This file is essentially the stock kernel of your ROM. This is also an essential part of your ROM zip and you must tamper with this file unless you know what you are doing
Now navigate inside the system folder. Here you will see loads of subfolders.
Let me explain you about the contents of "system" folder:
"app" folder, as the name suggests, contains various apps and services which will run on your ROM. If you navigate to this app folder, you will see another a huge list of subfolders. These subfolders contains apks for the apps.
"cameradata" folder contains various files which are essential for the camera to work.
"csc" folder is a folder which would be gem for modders. Most of the mods that you want in the ROM could be just be added with a single line, by modifying a file or two in this folder.
"fonts" contains the various fonts which will be used in the ROM.
"framework" folder is a very essential part of the ROM. It includes various jars and a few apks which are very essential for a ROM to function well.
"lib" folder contains various lib files for the ROM. And one thing to keep in mind would be to NEVER tamper with "lib64" folder, because, if you do so, your ROM might never boot, however "lib" folder can be modified to some extent like deknoxing (which I will tell you about in future posts)
"media" folder contains audio files including ringtones, notification tones, alarm tones and other System sounds
"priv-app" folder contains another set of "privilaged apps". Privilaged, because, they require some special permissions to work
"build.prop" is the most important file in your ROM. Without this file, your ROM will NEVER-EVER boot.
Step 7:- Lets first start by changing your ROM NAME. Inside the system folder, head to build.prop file and open it with NotePad++. (A tip, we usually refer adresses instead of putting them in words like I just did, so from now on, I will say, for example, head to system/build.prop)
Step 8:- Find this "ro.build.display.id" in build.prop (It should be in first few lines). Then after "=", there will be a string of alpha-numeric characters. For eg, in my case, it is "N920CXXU3CQD1". You might be having something different depending on your device. You can change this string to anything you want, for example in my N-FUEL Rom, I have put it as "N-FUEL-XL1-N920CXXU3CQD1". Hope, you got the idea.
Step 9:- Now its time to flash your ROM. But hey, before flashing, you need a ROM zip, right. So head to the ASSAYYED kitchen and Look for "BUILD ROM FOR FLASHING"(Hint:- It is the 7th option). So as you know, we will type "7", then press Enter.
Step 10:- Now since, we want a zip, and the number corresponding to a "ZIP" is "3". So type 3 and then enter. After this, it will ask you to review updater-script (I will tell you about updater-script and its syntax later in the guide), for now, leave it "N0", that is "default" (You know what to do when you see default). After this, it might ask you to zipalign apks. You can select this as "YES".
Step 11:- Then, you should always keep the compress level to "5"(which is "default", as you can see). Then you will see that it is making the zip file. Then it will ask you to name your ROM zip. Once done
Step 12:- Once completed, it will ask you to sign the zip, it is optional, however, I never signed my ROM zips though.
Step 13:- Okay so, finally!! You have gone through the tough journey and are now on the verge of testing your own ROM. So, go ahead and go to the "READY" directory. You will see your very first build there.
Step 14:- Now go ahead and put this zip in your Internal Storage and go to your recovery. First backup your current ROM or data. Then wipe system, cache, dalvik and data from your Recovery and finally FLASH YOUR ROM!!!
In the next post, I will be talking about Odexed and Deodexed ROMS, Debloating stuffs and few other things... so stay tuned
Hey guys, now, coming back to the guide, I want to tell you that the sole purpose of modifying/developing a custom ROM is to remove the amazing loads of BLOAT, that Samsung has to offer us. If you downloaded the firmware, that I told you about in the first post, you must have noted the huge size of the official firmware (In my case, it was around 1.9 GB!!). On the other hand, if you see around, most of the ROMS are much less in size than the official firmware. So, let me make an equation, that you can remember for life long, till you are developing a ROM
CUSTOM ROM = OFFICIAL FIRMWARE - BLOAT​
LETS LEARN ABOUT BLOAT
So keeping this mind, the first thing you should do, while developing a ROM, is to remove this BLOAT. Now, BLOAT, you can consider it to be extra apps that you see on your device, which you NEVER-EVER use, and they just sit there on your device, taking up all the space that you need and using up your battery by keeping their background services active all the time. So, let's first recognize, what is this BLOAT.
You can consider all the Microsoft Apps (Word, Excel, PowerPoint, Skype etc etc), at least, they were a Bloat for our NOTE 5 device. Don't get me wrong, they are amazing applications, but on PC. I never used them on my Device. Furthermore, you can consider a few of Google apps as BLOAT as well. For example. Play Music, you are already getting a music app from Samsung, so why keep two? Like this, many of Samsung apps like Samsung Pay (which you probably can't use as you rooted your device) and many others. Hope you got the idea.
Now, since you recognized the BLOAT, the next step would be to know, where is this. Now, I told you above that the BLOAT is essentially the apps in the ROM. So, from Post #1, you must be knowing that apps are located in "system/app" and system/priv-app. But remember one thing, ALL THE APPS ARE NOT BLOAT. You can head to this directory and look for various folders (These folders contains the apk files for the apps, as I told you earlier), but DON'T delete anything now.
Now you know what is BLOAT and where it is, now you need to understand, how to remove this BLOAT. So, there are two ways to do this, and in actual ROM Development, I am sure, you will use both the methods.
So here are the two methods:-
1)Using a kitchen
2)Using File Explorer
Using a File Explorer is as simple as going to "system/app" (or "system/priv-app") and deleting the respective folder, but,
YOU SHOULD KNOW WHAT YOU ARE DOING... YOU SHOULD NEVER DELETE AN APK, UNLESS YOU KNOW IT IS NOT REQUIRED BY THE ANDROID SYSTEM TO RUN
REMOVING BLOAT USING KITCHEN
I consider this to be the safest method and you would also know it, just stick with me and follow the steps...
Step 1:- Launch ASSAYYED Kitchen and look for the option "DEBLOATING THE ROM". So, in order to select it, you know what to do, Press "11" and enter.
So now, explanation time.
Now, in ASSAYYED, there is a method by which the kitchen "DEBLOATS" apps from your ROM. It does it by knowing the EXACT NAME OF THE APK stored in a TEXT FILE. These text files are located in "TOOLS/txt_files"(in your kitchen directory)
I would like you to open "kushan_debloat_list" in this directory (that is "TOOLS/txt_files"). Once you open this file, you will see a huge load to names of files with an extension ".apk". So, a kitchen uses this type of files with apk names, then it searches the full ROM for the apks and delete those whose names match with those in the list. So I hope you got the idea. The kitchen has some pre-loaded debloat list, which we can use for now. However, you can create your own ones, or download a "SAFE" debloat list for your specific device, and use that. Just put, your own text file in "TOOLS/txt_files", and you will be good to go, now lets move to Step 2.
Step2:- Okay so, now we need to select out Debloat Txt file from the list. So, we will SELECT "CHOOSE_LIST" from ASSAYYED Menu.
Step 3:- Now you will see the list of available Debloat List (PRE-LOADED ONES). For now, select "ASSAYYED KITCHEN LIST". Now, sit back and relax, until the Kitchen DEBLOATS the ROM.
Step 4:- Once complete, Press Enter. and now navigate to your WORK Folder. In this, you should see a new folder namely "BLOAT". Now, I told you a lie earlier (Sorry for that). The kitchen doesnt delete the apks. It just separates the BLOAT from your ROM.
Once you open this BLOAT folder, you should see some subfolders, and you can easily guess what they contain.
Now, in order to make your ROM smaller in size, you need to remove this BLOAT folder. I would recommend moving this folder to a new directory for now, instead of fully deleting it.
Okay, so now your ROM is DEBLOATED!!
CONGRATULATIONS!!
Now, you can BUILD the ROM for flashing, like I taught you in Post #1 and flash it, you will see many apps will be removed from your app drawer, once the ROM is booted. So, now ENJOY YOUR DEBLOATED ROM
So, you have learned about Debloating your ROM, now let me tell you somethings about ODEXED AND DEODEXED ROMS
ODEXED VS DEODEXED
Well, it is essentially the apps that are ODEXED or DEODEXED and not the ROM in general.
Let's first learn about what is an ODEXED app. Well, ODEXED apps, basically are pre-optimized apps, they don't need to be optimized on every reboot, or after wiping cache or even after clean ROM install. Pre-optimized apps are also more stable as they won't get any chance of error while optimizing. When you pre-optimize an app, it's optimization details stored in a separate folder called "odex". So system accesses that and knows how an app works before opening the app or while booting the ROM. Therefore, on a fresh install, it is always noted that ODEXED ROMS boot a lot faster than DEODEXED ROMS.
On the other hand, DEODEXED apps are not pre-optimized. Once you deodex an app, the information stored in the odex folder is removed and the system has to optimize an app every time the ROM boots. This is the reason why a DEODEXED ROM boots slower in comparison with an ODEXED ROM.
But hey, that doesn't mean that ODEXED ROMS are better than DEODEXED ROMS. If you want a whole lot of MODS in your ROM, it is must that you DEODEX it. without DEODEXING an app, you cant make much modifications, and if you did, it will result in Force Closes and a whole lot of errors. I always prefer to DEODEX my ROMS. Inface, both my ROMS (N-FUEL-V4 and N-FUEL-XL1) are DEODEXED. The choice is upto you, whether you want faster boot-up times and all that speed or you want amazing MODS in your ROM.
So, I hope, you got to know a bit about ODEXED and DEODEXED ROMS. One thing, I would like to tell you is that the firmware, you downloaded, will always be ODEXED, as Samsung always keeps their firmware ODEXED for faster boot-up times and stability. So, we need to DEODEX it (if you want to have a DEODEXED Rom)
If you want to know more about ODEXED and DEODEXED, you can click here and read from this amazing guide:good: Now let me tell you, how to DEODEX a ROM
DEODEXING THE ROM USING KITCHEN
Step 1:- Launch ASSAYYED kitchen and search for "DEODEXING PROJECT". Then go ahead and select it.
Step 2:- Select Yes, if it asks for confirmation. Now sit back and relax, and let the kitchen do its work.
Pretty simple eh So you have DEODEXED your ROM. Now, for this last section of this post, I will tell you about DEKNOXING the ROM, which is essential to do, and you will know why in the next section.
LEARNING ABOUT KNOX
The newer Samsung firmwares (maybe after 5.1.1) come with a secured BOOTLOADER. Basically, if we root our device or try to tamper with the official firmware, there is a Knox warranty which gets void. And once it gets void, there is no way (at least that's what people say) to get it back.
This KNOX warranty ensures that your device is running official firmware with no modifications. Therefore, once you root your device, KNOX warranty gets voided and as a result, you pretty much can't use official firmware on your device and if you did, the system will show high battery usage or other such effects. You can learn more about this from here.
Now since you know the adverse affects of Knox, it is better to remove it from your ROM.
DEKNOXING A ROM
Step 1:- Launch ASSAYYED kitchen and select "DEKNOXING THE ROM". Let it do its work and Press Enter when completed.
But hey, that's not enough. We need to follow some additional steps to fully DEKNOX the ROM.
Step 2:- Navigate to "system/app" inside the "WORK" folder, look for any folder containing the word "Knox" and delete them.
Step 3:- Now navigate to "system/lib", and search for "libknox" and delete the files that show up (around 5 or 6 files should be there)
Remember to delete the above file from "lib" and NOT from "lib64"
Step 4:- Open the build.prop file. (It is in system folder inside WORK)
Step 5:- In the build.prop file, search for "ro.config.knox". This value should be equal to something (in my case it was v30). Change this something to 0, so that the full line becomes "ro.config.knox=0".
Step 6:- Now search for "ro.config.tima". This value should be equal to 1. Change it to 0, so that the full line becomes "ro.config.tima=0".
So that's it, you finally have DEBLOATED, DEODEXED AND DEKNOXED ROM!!
You can now go ahead and BUILD THE ROM FOR FLASHING. Then once the ROM boots, enjoy your hardwork
Now, this is it... We have fully completed the first part of the GUIDE.... that is, CREATING A VERY BASIC ROM USING KITCHEN. In the next POST, we will continue to the next part of the guide... so till then, Stay Tuned
ADDING BASIC MODS TO THE ROM​
Okay so now, let me tell you how to make your ROM, a lot more interesting and enjoyable to use. Now, the next main purpose of building a custom ROM is to add what is not there in the STOCK ROM, and that is MODS. You can add huge loads of MODS, which are already present in STOCK ROM but are disabled by Samsung. Many mods, for example, adding DATA USAGE in Notification Panel or disabling SMS TO MMS CONVERSION are as simple as adding a single line in a file, however, other MODS, like enabling VIRTUAL LOCK BUTTON in Status Bar requires few and very easy modding after decompiling apks, on the other hand, coloring stuffs in the SystemUI, requires some good modding skills and experience in decompiling stuffs.
Now, in this section, we will be discussing on adding basic mods, that is single line MODS, that I talked about earlier. So, first lets go through the easy stuffs, that is adding mods to build.prop.
ADDING MODS TO BUILD.PROP
Adding MODS to build.prop is actually very easy, and kitchen does all the stuffs. So follow the steps below and you will be good to go
Step1:- Launch "ASSAYYED KITCHEN" and search for "ADDING BUILD.PROP TWEAKS" and select it.
Step 2:- On asking for confirmation, just select "YES".
Step 3:-Now, wait for a short time and once done Press ENTER, and now your ROM is much more smooth and fast. You can head to your build.prop (its in WORK/system) and look for those mods.
Now these are some amazing mods, you can play with some values (but be sure of what you are doing)
So, you've learnt on adding build.prop mods to your ROM. However, we are not limited to this, there are many other MODS to help you enable several things. Go ahead and read on XDA, and you will be surprised to know how many things, you can get by just changing some values or adding some lines in build.prop. Not only from XDA, but from other ROMS (but give appropriate credits to respect the efforts of the developer, who found it)
Now comes the tough (well not tough but overwhelming) part of this guide, that is adding CSC Mods.
WHAT IS CSC?
The Customer Service Code (CSC) plays an important role in the operation of your Samsung mobile device. The CSC code ensures that your mobile device complies with the standards for your country, and your cell phone operator. Therefore, if we can change/add a few lines in our CSC code, we can actually get features which Samsung disables due to the standards for your country. Hope you get it. Now the main task is to find those lines, through which we can enable these features.
So, we first locate , where to add/modify these lines. Now, navigate to your "WORK/system/csc". Here you will see many files and folders(maybe). Now, it is in this folder, that we make changes and mainly in the "others.xml" file. Now, open this file WITH NOTEPAD++ and you should see a lot of lines of codes which includes some value between <CscFeature...> </CscFeature...> or something like this.
HOW TO ADD CSC MODS
So by now, you know that what is CSC, and where to we add CSC Mods. Now lets learn how to add these MODS.
Well, remember a main rule here and that is COPY AND PASTE. We basically copy a few lines from some other country's others.xml (for your particular device) to your own others.xml.
Well, you can also copy these lines from some other Developer's work, but it is "MANDATORY" to give appropriate credits to the respective developer.
Here, I am listing some (not all xD) of the CSC MODS/lines that I used in my ROM:-
ENABLE CAMERA SHUTTER SOUND TOGGLE IN CAMERA SETTINGS:-
Code:
<CscFeature_Camera_ShutterSoundMenu>TRUE</CscFeature_Camera_ShutterSoundMenu>
ENABLE REALTIME NETWORK SPEED TOGGLE IN SETTINGS:-
Code:
<CscFeature_Setting_SupportRealTimeNetworkSpeed>TRUE</CscFeature_Setting_SupportRealTimeNetworkSpeed>
ENABLE NATIVE CALL RECORDING:-
Code:
<CscFeature_VoiceCall_ConfigRecording>RecordingAllowed</CscFeature_VoiceCall_ConfigRecording>
DISABLE SMS TO MMS CONVERSION:-
Code:
<CscFeature_Message_DisableConvertingEffectBetweenSMSMMS>TRUE</CscFeature_Message_DisableConvertingEffectBetweenSMSMMS>
<CscFeature_Message_DisableSmsToMmsConversionByTextInput>TRUE</CscFeature_Message_DisableSmsToMmsConversionByTextInput>
ENABLE WHITE PAGES (YOU NEED THE REQUIRED APK WITH THIS LINE):-
Code:
<CscFeature_Common_ConfigSvcProviderForUnknownNumber>whitepages,whitepages,whitepages</CscFeature_Common_ConfigSvcProviderForUnknownNumber>
ENABLE THE NFC ICON IN STATUSBAR:-
Code:
<CscFeature_NFC_StatusBarIconType>DEFAULT</CscFeature_NFC_StatusBarIconType>
ENABLE DATA USAGE IN NOTIFICATION PANEL:-
Code:
<CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>TRUE</CscFeature_SystemUI_SupportDataUsageViewOnQuickPanel>
Here, I have mentioned a few of many CSC Mods available for your devices. It is important to note that the above given codes are just to give you an idea. However, it is not necessary that all of the above codes will work with all of the Samsung Devices out there. If your device supports it then it will enable these MODS and if it does not then there will be no effect on the ROM. This is the beauty of CSC Mods, that if they are not compatible with your device, it will not affect your ROM/device in anyway. So, keep on adding MODS by reading, learning, copying and then pasting xD from other places.
Now after this, in the next section, we will discuss about updater-script and its syntax which will help you add various zip files directly to your ROM, so stay tuned for next upcoming posts, as they will be one of the most interesting parts of this guide
LEARNING ABOUT UPDATER-SCRIPT SYNTAX AND ADDING EXTERNAL FEATURES TO THE ROM​
Now comes the most interesting part of making ROMS (at least, according to me), and that is updater-script. Now, I would like you to navigate to "WORK/META-INF/com/google/android" and there you should see two files, namely, "updater-script" and "update-binary". Now, I will explain you first, What is updater-script, what is its essence and how is it so beneficial and interesting in ROM Development.
LEARNING ALL ABOUT UPDATER-SCRIPT (PART 1)
So, first of all, what the heck is this updater-script. It is basically the file, which instructs TWRP (or any other recovery) what to do with the zip (your ROM or any other flashable zip). Without this, you cant flash anything on your device (well, this is a lie). But, in flashing ROM, this is very important. So, now lets learn about the updater-script syntax
Well, before this, I need to tell you something and that is, how a recovery actually flashes a zip file (This is what I assumed). So basically, when we flash a file, the recovery looks for update-binary inside "META-INF/com/google/android" in the zip file. This update-binary, then tells the recovery, whether the zip has to be installed with a STANDALONE INSTALLER or AROMA INSTALLER. If the recovery founds out that the zip has to be installed by a standalone installer, it then goes to the updater-script, which HAS to be in the same directory as update-binary and says, Hey dude, can you tell me, what I have to do with this zip file.
Hence, the updater-script basically instructs the recovery about what to do with the zip. So, having know about updater-script and its essence, lets now discuss about the syntax or the language in which we can write the updater-script.
NOTE:- THIS IS NOT AN UPDATER-SCRIPT GUIDE, SO I WILL ONLY LET YOU KNOW OF THE IMPORTANT KEYWORDS OR OTHER SUCH STUFFS REGARDING ROM DEVELOPMENT. HOWEVER, THIS IS WHAT I HAVE LEARNT AND SO FAR, IT IS MORE THAN ENOUGH. MOREOVER, IT IS ESSENTIAL, THAT YOU PAY FULL ATTENTION TO THE UPCOMING SECTION. LASTLY, IT WILL BE GOOD, IF YOU HAVE SOME PROGRAMMING BACKGROUND, BUT IF YOU ARE NOT, I WILL TRY TO BE AS SIMPLE AND STRAIGHTFORWARD AS POSSIBLE
LEARNING ABOUT UPDATER-SCRIPT SYNTAX
So, for this, first open the updater-script with Notepad++, and you will be astonished to see a huge loads of lines. You would be like, what the heck does this mean. I am gonna explain you most (if not all) of the stuffs here.
1) ui_print("");
So, we first begin with ui_print. So, what this does is that, anything you put inside the double quotes (" "), it will print it out directly into the installer screen. (For my programming dudes if you learned about C or C++, it is like cout<<" ")
Now, lets me explain this better with an example, here is a piece of code and its output
Code:
ui_print("Hello, I am learning about ROM Building/Modification");
And its output in the recovery:
Code:
Hello, I am learning about ROM Building/Modification
Hope you got the idea, now let's go to next one.
2) run_program("/sbin/busybox","mount","/system");
This is basically a modified command. The original command (run_program()) is used to run many in-built programs available in Recovery. You will explore many versions of this command as you head forward in ROM Development. Now, what this specific command does is that, it mounts the "system" partition of the device.
Now, a few of you may ask, why do we require mounting. Basically, without mounting a particular partition, we cannot modify (Add files or remove them) the partition altogether. So, I hope that now you understand, why mounting is so important.
In ROM building, we usually need to mount system, data, cache, and dalvik. So, you will always see the following set of code in the beginning of any updater-script of a ROM.
Code:
run_program("/sbin/busybox","mount","/system");
run_program("/sbin/busybox","mount","/data");
run_program("/sbin/busybox","mount","/cache");
run_program("/sbin/busybox","mount","/preload");
3) delete("/file_path");
As the name suggests, it deletes a file located on your device. You need to specify the exact file directory in double quotes inside the parenthesis.
For example:-
Code:
delete("/system/priv-app/SystemUI/SystemUI.apk");
Code:
The above line (when running in a recovery) will delete the SystemUI.apk
4) delete_recursive("/directory);
As the name suggests, this command deletes a directory or even format a partition. It differs from the delete(); command in its working. delete_recursive() deletes a directory while delete() command deletes a file. (Too many deletes in a line)
For example:-
Code:
delete_recursive("/system/priv-app/SystemUI");
Code:
Note that in the above command, the Recovery will delete the SystemUI folder as well its contents.
Another use of this command is in formatting the partitions. As you know, flashing a ROM basically means, we need to extract the contents of the system folder in your zip file to the system partition of your device. So, whenever we flash a new ROM, it is always advised to wipe cache, dalvik and system.
Code:
delete_recursive("/system");
delete_recursive("/cache");
delete_recursive("/data/dalvik-cache");
Code:
The above code will firmat the necessary partitions
4) package_extract_dir("zip_directory","/directory_on_phone");
This is a very simple and an important command. What it, essentially does is that, it extracts a folder in your zip file to another folder on your device. Let me explain you, with an example:-
Code:
package_extract_dir("system","/system");
{Notice in the [B]/[/B] sign in the second parameter, and this is absent in the first parameter}
Code:
What the above command essentially does is that it extracts the [B]system[/B] folder in your ROM zip to the [B]system[/B] directory of your device.
Let's understand this with a few more examples:-
Code:
package_extract_dir("system/app","/system/app");
Code:
The above command will extract the app folder in the system inside your ROM zip to the app folder in the system directory of your device.
Code:
package_extract_dir("MODS/SystemUI","/system/app/SystemUI");
Code:
Do it urself
Code:
package_extract_dir("MODS/SecSettings2","/system/priv-app/SecSettings2");
Code:
Do it urself
5) symlink("file_name1", "file_name2");
This is a piece of code, which you will never be needing! But I am explaining this here, because, a big amount of updater-script. So, we won't go, into much detail of this command, just an overview. Now, this command basically creates a symbolic link between two files. A symbolic link is where a file has one main name, but there is one extra entry in the filename table that refers any accesses back to the main name.
Code:
symlink("/system/lib/libQjpeg.so", "/system/priv-app/SelectiveFocusViewer/lib/arm/libQjpeg.so");
Code:
This command created a symbolic link between [B]"/system/lib/libQjpeg.so"[/B] and [B]"/system/priv-app/SelectiveFocusViewer/lib/arm/libQjpeg.so"[/B]
6) set_perm(uid, gid, permissions, "file_name_with_adress");
This is quite a useful command, as it helps giving necessary permissions to various files in android. Now, basically, permissions are required for a particular file, which might require some special privilege, in order for it to complete an action. For example, Android cannot allow any file on the system to format the device, formatting can only take place if a file has necessary permissions from Android itself. So, I hope, you got the point why are permissions so important in Android.
Now let's understand the syntax of the above command, which will help give permissions to various Android Files
Code:
set_perm(uid, gid, permissions, "file_name_with_adress");
Now, this statement itself has many parameters as you can see. Now, I will limit myself to only explain you the things, which is necessary for ROM development. Now the "UID" and "GID" are UserID and GroupID. (They are a little tough to explain and beyond the domain of this guide, so I will just give a brief description). They are essentially an important part of Android Permissions, and they are usually integers. Don't worry, we will look in the following example about how this works.
Secondly, permissions are like rw-r-r or rwx-rw-rw. Now, if you have been using Linux for a while, you know what these means. Lets understand this, by taking rwx-rw-rw as an example:-
Now the first section, i.e., "rwx" is the permission set given to the "Owner" of the file, the second section i.e., "rw" is the permission set given to the "Group", and the third section, "rw" is the permission given to "Global". They might seem a bit overwhelming, but bear with me, these have very little role, as far as, ROM development goes.
Now coming back to the command, the permission, there is used in an Integer form. Now, I am putting out a link here, if you want to know, how these permissions are converted to integers... (https://unix.stackexchange.com/a/39712).
Essentially, you will only need two permissions, 0644 and 0755. Out of these, 0644 will always be given to an apk, while 0755 will always be given to a folder. (0644 -> rw-r-r and 0755 -> rwx-rx-rx)
Code:
set_perm(0, 0, 0777, "/tmp/wipe.sh");
Code:
Now, the above command essentially gives the permission [B]"rwx-rwx-rwx"[/B] to the file "/tmp/wipe.sh".
7) set_perm_recursive(UID, GID, perm_directory, perm_files, "directory_name");
Now, this is very similar to set_perm(), but the only difference is that this gives permission to an entire directory and its contents. Let's look at an example...
Code:
set_perm_recursive(1000, 1000, 0775, 0644, "/system/framework");
Code:
This command gives "/system/framework" directory 0775 permissions and all its contents, 0644 permissions. (0775 -> rwx-rwx-rx).
So guys, in this post, I have tried to cover most of the essential Edify Scripting command, you will ever need in your ROM Development journey. I will be talking about a few more commands after we talk about aroma-config in the next post. I am posting out a link, which will help you find more such commands:- https://forum.xda-developers.com/wiki/Edify_script_language.
Now, we are done with Updater Script commands (Part 1). In the upcoming post, we will talk about Aroma-Config and after that, we will look at Updater Script Commands (Part 2). So stay tuned and see you guys in the next post.
one more
last one
actually one more
Great aman!!! It looks very nice!! Tonight ill be reading it!!!
congratulations....great thread...keep it high
You don't have to thanks to me bro, I'm really happy to see you over here, teaching to the rest
Congratulations bro, a lot, you will be great
Great thread man !!
congrats
This is the true meaning of:
Sharing is Caring
[emoji106] [emoji122]
Sent from my SM-N920C using Tapatalk
Wonderful .. amazing discribtion .. you made all of us developers :good::good::good:
Thanks everyone for reading the guide and giving the feedbacks.
I just updated the guide. Now, it includes Deknoxing, Debloating and Deodexing a ROM, and also some good information about each of them. So you can now move further in your ROM
Great work @AndroidSword all the best for future progress on this thread :good:
tnx very good guide simple and clear keep up good work
Awesome! greatly appreciated for making this guide. Im gonna dive into the deep now
hi in ASSAYYED_KITCHEN_V1.82_STABLE when remove bloat the kitchen just make a folder in WORK\BLOAT not change the name of app
waiting for part2 tnx
Eveything I've been doing for months manually with Rom Raider, Step Flashing, Etc. all here, its a f*&%&ing miracle. Hvaent flashed te rom yet but it's doing what I did. Knox removal could be a little more involved but I already know where all that crap is. If this gets my SE into Perm mode I'm gonna dance a jig, Thanks for the tutorial. And thanks to the Devs for the awesome crazy work put into this beautiful machine.
When I edit the build.prop with c++ note do I save it as a "properties" file? I'm assuming cause mine was fudged from accidentally making it a .txt using reg notepad a few weeks back. Dunno how my ROM was working but there's 4-5 other encrypted style build.prop files in there. I'll post example. "build.propwjO0d4" it's written in alien lingo like alot of the sec files are. I'm assuming I only need one I'm thinking copypasta my og buildprop info into one of these and renaming?
Guys, next section of the guide is there in Post#3, so go ahead and do MODS to your ROM as per your requirements​

Categories

Resources