[Sony Xperia Miro, Tipo (Dual), J, E] kurotsugi:
Let's customize our ROM.

This thread's goal is to make you understand better about your ROM, how to maintain it, and how to modify it to satisfy your desire. this thread is based of this thread http://xdaforums.com/showthread.php?t=1590330 which I've write several months ago. however, our system is a lil bit different with the one in SGY. this thread will contain more specific information about ICS based rom especially the xperia phones.

I'll made this thread into several section. the first section will explain about the file structure in our system. the second one will tell you about app/system modification, and the thirdth one is about tweaking.

1. KNOW BETTER ABOUT YOUR SYSTEM

1.1 SYSTEM STRUCTURE

first of all, when I said "system" here, what I mean is all the stuff under your system partition. if you're browsing with your file explorer, it's all the files inside /system folder. please don't mix it with a complete android system. if you open your /system folder, you'll find these folders.

1. app : contain all the system's app and the odex file of system app

2. bin : contain the command and bin files for the rom

3. vendor: specified vendor system. you have your specific vendor's app, libs, and config files here.

4. etc : additional setting and files for the rom.

5. font : the fonts

6. framework : system's framework files and the odex file for framework

7. lib : drivers, modules, kernel related files for the rom

8. media : media files-ringtones, notification, bootanimation.

9. sd : folder created by a2sd darktremor. (only modified rom have it)

10. usr : files needed for keyboard, bluetooth, etc.

11. xbin : additional command and bin files (busybox is usually installed here)

12. build.prop file : contain your system default prop

13. ts.conf : a configuration file for your system. you'd better stay away from it.

1.2 DEODEX VS ODEX

Most of custom rom available is deodexed rom while our stock rom is half deodexed rom. I'll try to explain it in most simple way. First of all, we should understand that mostly every app in android consist of three part, *apk files, *dex/odex files, and lib files.

ODEXED rom means that *dex file needed to run the app is extracted from the apk file and placed in same folder with the apk files (/system/app). the positive side, it consume less internal memory and a execute faster. the negative side, it makes the app uncostumizable (cannot apply custom themes) and need more space in system partition.

DEODEXED rom means that *dex file needed to run the app is extracted from the apk file and placed in /data/dalvik-cache. the positive side, the app can be themed (full customizable) and consume less system partition. we could put more app in /system/app in deodexed rom. the negative side, it consume a lot of internal memory. please be cautious with the internal memory space if you use deodexed rom. (NOTE: if you start from stock rom, you may use dsixdia to convert odexed to deodexed rom).

2. APP/SYSTEM MODIFICATION

basicly, you modify your system in two ways. push a file to add/replace file into your system and modify your files with file explorer. it can be done in several ways. if you want to modify your system, you should remember these stuff:

1. file compatibilty : if you push a file, especially some apps, you should make sure that file is compatible with your system. some app require different framework, additional libs, and some other dependencies. make sure you already had all of them in your system.

2. correct file permission: some file don't need special permission. however, some other file require special permission like execution.

3. system free memory : you have limited system partition size. you can't put everything inside it. please be aware with the system partition size and the free memory.

4. always backup before doing everything.

2.1 ADD MORE APP INTO YOUR SYSTEM

it can be done in two ways. the first one, you can add that app into /system/app. the second one, you can add that app into /system/vendor/app. both of them works on xperia's phone. most of the files inside inside /system/vendor work just like in /system. so, if you have an apk in /system/vendor/app, it's not different with having that apk in /system/app. nevertheless, all file in /system/vendor is more prioritizied than the one in /system. it means, if you have two file with same name, the one in /system/vendor will be used instead of the one in /system.

2.2 CREATE THEME FOR YOR OWN ROM

simple theming stuff could be done by replacing the pic files inside the apk, especially framework-res.apk in /system/framework. a hardcore theming need apk modification. this thread doesn't recover about this stuff since it's too long. please search it by yourself if you interested about it. for a basic theme, you need to modify systemUI.apk and framework-res.apk. the systemUI.apk contain your statusbar. the framework-res.apk contain your system interface.

3. TWEAK UP YOUR ROM

there are a lot of tweak. I'll divide it into two categories. scripts and props. scripts, is a tweak run by specified script. this tweak only work if you have a rom with init.d support or you're using script manager app. most of these stuff can be found in /system/etc/init.d/.

props, is a file contain your system properties. the famous one your build.prop inside /system. aside of it you actually have default.prop but this file is stored in your ramdisk and can't be modified without kernel modification. you have a lot of method to modify your prop stuff.

1. modify your build.prop file. you can put your own prop or modify the prop value inside this file. seems easy, but this is the most risky one. you can brick your device easily if you're not carefull when modifying it. I don't recommend it for new android user.

2. create a file "local.prop" in /data. the less risky method. it works just like when you modify your build.prop directly. however, it's less risky since if you got bootloop, you only need to delete it and your device will revived. I always prefer this method for my rom modification

3. create script in init.d. the basic form will be

#!/system/bin/sh
# the custom prop
setprop <prop key><space><prop value>

for an instance, if you have a prop in your build.prop "dalvik.vm.heapsize=128m" you can type "setprop dalvik.vm.heapsize 128m" in your script. this trick is usefull if you're a rom modificator and want to install something which require specific prop. in this way, you don't need to know anything inside build.prop/local.prop. you can make an universal mod which can be installed on a lot of device. bravia engine mod works fine with this method.