Tuesday 9 June 2015

Basic Understanding of Android Rom

Basic Understanding of Android Rom





In this tutorial we will discuss about the android rom which we usually flash on our device.We will discuss all the files and folders which is necessary 

for android device.

So lets get started.


Android rom is the operating system which runs on the android device.It is stored in the "Read only memory" portion of hardware.
All android devices came with stock rom installed by manufacturer.And the manufacturer has also put certain restriction in it.So if you get root access
then you can easily change the android rom and that will completely change the look and feel of the software.

Well android is open source software so any developer can modify the stock rom to make their own unique versions.
Developers of custom ROMs are able to strip out all the garbage that manufacturers throw in, 
optimize the software, unlock some of the built-in features, and make an even better version of the Android software.
That kind of roms are called Custom roms.

An ideal rom should contain
1. boot.img
2. System Partition
3. META-INF

1. boot.img


Boot image file is a kernel of android system.
boot.img contains the kernel and ramdisk, critical files necessary to load the device before the filesystem can be mounted
The boot image consist of "zimage" and ramdisk.

Now what the heck is zimage and ramdisk
zimage:   When you compile a kernel from the source code provided by the developer the zimage is formed.

ramdisk:  ramdisk.img is a small partition image that is mounted read-only by the kernel at boot time. 
It only contains /init and a few config files. It is used to start init which will mount the rest of the system images properly and run the init procedure.

2. System partition

System folder is very important folder in android rom.It includes the whole android operating system.
An ideal system folder should contains all these folders.

app
bin 
etc
fonts
framework
lib 
media
usr
xbin
build.prop

app folder


This app folder contians preinstalled apps in your android devices.Some are necessary for android system to run and function properly and some are
bloatware which are not necessary for system and cannot be uninstalled.
Like for example SystemUI.apk contains whole functioning and running of taskbar.If you dont include this app then their will be no status bar on your
android rom.

bin folder 


This folder contains all the binary executables which is necessary and important for android system to run and function properly.
It may include how the system handles process and other advanced stuff. So please refrain from modifying any files in this folder.
So you must add all the necessary binary execulables in your android rom.

etc folder


This folder contains lot of miscellaneous files which are very important for the system.
Their is one folder named init.d which contains all the script to run when your device boot up.So you can
command the system to carry out any function using these scripts.

fonts folder


This folder contains .ttf files.These ttf files are for the font style and font size of the system.
This folder contains all the system fonts. Clockopia.ttf is the font used to display on the lockscreen.
You can delete the fonts, but make sure you have at-least one.
You can also add fonts to this folder and they will be available in the ‘Select Font’ option in the Settings.apk.
When replacing fonts, take care that the new font has the exact name as the old one, otherwise the new font won’t work.

framework folder


This folder is almost same for all the android system.So you can get it from any android rom but make sure it is of same android version of which you are
making.
All the files in this folder are necessary for the system to boot,
The only thing which can be modified is framework-res.apk.You can decompile the apk file and change the battery icons and
status bar icons, lockscreen icons, etc.But be cautious if you modify it incorrectly your system wont boot.

lib folder


The lib folder is used for shared library files that executables make use of.This folder contains all the library (.so files) which are used by
applications to function.All the installed applications use these files to run.
If any application doesnt find its favorable library file to run and function it will automatically create its own.

media folder


This folder contains bootanimation of the device.Bootanimation is series of images which is animated and played at the the time of start up and
power off.
This folder also contains all the media used in the Android system, complete from the starting boot animation to the shutdown animation.
The common contents of this folder is notifications and ringtones etc... which is used by the android system.

usr folder


The usr folder contains some miscellaneous but very important stuff.
It may contain anything and everything needed by the Android operating system. For instance, this folder contains all the key-mapping.
If such files are messed with, your device will be non-functional although it will boot.

xbin folder


This folder also contains binary executables like bin folder.This is also important folder to run android system.
When you root your phone the binaries necessary for root access is saved in this folder.
And even you can install busybox in this folder.

build.prop


This is very important file for android system.It tells the system which version of android yoiu are having.
Which baseband version you are having and it also contains name and model number of a device.
You can modify this file but take care,if you modify it incorrectly your phone will not boot.

Other things,you can change things like,how long should be 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, the particular line is commented out, and the system does not read it.

3. META-INF


This folder contains two important files named "updater-script" and "update-binary"
This updater-script is written for flashing android rom.It tells the device that what it has to do with the system given in the zip file.
updater-script has bunch of commands which remove the existing android system and flash the new system from the zip file.
And update-binary is necessary for system which translate the code of updater-script to machine language and gives it to the machine.

You can find both the files here
META-INF/com/google/android/updater-script
META-INF/com/google/android/update-binary

And the rest of the files named
MANIFEST.MF
CERT.SF
CERT.RSA

these files are created due to signing of the zip.we dont have to bother about them.


No comments:

Post a Comment