[XPERIA X1 ROM Development] gtrab:
.

TUTORIAL:

HOW I COOK ROMs for the XPERIA X1

A complete, step by step GUIDE

[01 DEC 09]: SEX1 R5 pure ROM KITCHEN UP FOR DOWNLOAD at the ROM thread​

PS1 My ROMs are NOT intentionally protected: feel free to dump and use any components you please

PS2 Don't be shy: ASK !! but don't be dumb: SEARCH !! :p

INTRODUCTION​

Glad to see everybody is trying to cook these days: we are all here to learn and share

Following xda-devs spirit, I am writting this little guide to help those who could be intrested in cooking their own ROMs

Don't be shy: If I did it, YES YOU CAN do it too !!

Let's get real: NO COOKED ROM WILL 100% FULLFILL YOUR NEEDS/EXPECTATIONS BECAUSE WE ARE ALL DIFFERENT

Let's get real again: THE ONLY WAY TO STOP COMPLAINTING ABOUT "this" OR "that", FLAMING A CHEFF'S TREAD, IS BY DISCOVERING HOW HARD AND COMPLICATED THE PROCESS IS, but don't dismay: this thread is meant to guide you step by step into the cooking world

I have been reading and learning a lot, trying to build something that would suite MY OWN NEEDS, I have been using my ROMs for quite a while and I am happy and satisfied: I show off my phone and I can proudly say "I did it myself" :cool:

So I invite all of you to give it a try too: it's worth the experience ;)

But first, may I invite you to take a look at some works:

Link to latest SEX1 R5 -release 5- ROM thread (kitchen and complete cooking log at post 3)

Link to DEUTSCH SEX1 ROM + KUCHEN thread

Link to LATIN SEX1 ROM + COCINA thread

Link to SEX1 R4 public beta testing thread

Link to SEX1 R3 -release 3- PURE, BareBone & XPERT ROMs thread

Link to SEX1 R3 public beta testing thread

Link to SEX1 release 1a ROM thread

STEP 1: BASIC REGISTRY SKILLS​

Every good cooker/cheff needs basic REGISTRY skills

As a good reading/searching-needed noob, I have compiled some knowledge and here are my 2 cents:

BASICS

1- Registry keys can be generated (created) or changed with a RGU file (unicode format) or XML/PROVXML file (UTF-8 format)

Both can be edited with notepad, but make sure you choose the right format when saving

(use "save as": it will let you choose format)

Differences

:

- UTF-8 for XML or unicode for RGU

- dword values must be hexadecimal in RGUs and decimal in XMLs

- RGUs store registry keys only, XMLs store registry keys, file operations, etc

2- A PROVXML file is a glorified XML: it loads automatically when cold-booting the device (hard reset or first boot), which means all of it's instructions, file operations & registry keys will be auto-executed and will override similar instruction from RGUs

In the other hand, XMLs have to be invoked ("runned") during customization (usually from OEM\Operatorpkg\config*.txt)

ORDER OF IMPORTANCE

1- When cooking the ROM, all RGU files are compiled and gathered to create the main, barebone system registry (see Jack's comment some posts down)

2- After flashing the phone, when the ROM is loaded for the first time (when it takes forever to boot = "cold boot", same as after a hard-reset), all commands inside all PROVXMLs are auto-executed, overriding corresponding registry keys from REG/RGU files

3- After the "set date" and "align" screen, the auto-customization process starts:

Anything inside "config.txt" will be autoexecuted (apply themes, install CABs, run XMLs...)

Here is where I execute my customization XMLs and any required OEM customization XML

Here is an example "config.txt":

LOCK:Enabled
CAB: \WINDOWS\ActiveX_Deployment_signed.CAB
CAB: \WINDOWS\WM6.1_PPC_dawn_Opera_15969_signed.cab
CAB: \WINDOWS\gtrab_SEX1_Customization.CAB
XML: \WINDOWS\SEX1_fileoperations.xml
XML: \WINDOWS\My_panelconfig.xml
TSK: \WINDOWS\Naked_chiks.TSK
LOCK:Disabled
RST: Reset

- As a side note, "config.txt" usually goes inside OEM\OperatorPkg, and runcc.lua governs which files are auto-launched

- I put most of the big CABs inside OEM\PACKAGES, eg. PACKAGE_Kovsky_ActiveX_Deployment

- I put the small or orphan CABs into OEM\OperatorPkg, together with my XML files, to keep them handy and keep them in mind at a glance towards the customization files

Conclusion: Better put all of your important registry tweaks in XML or PROVXML files instead of searching for a specific registry key inside more than one hundred RGUs, anyway they will be overrided by any XML or PROVXML instruction pointing to that same registry key

COOKING IMPLICATIONS

1- If required, each OEM or SYS PACKAGE has its own RGU file and/or PROVXML files

Some PACKAGES don't need registry settings, so they don't have an RGU inside

2- The RGU name must be THE SAME as the PACKAGE identifier DSM file

3- Only ONE RGU file is allowed per PACKAGE, but each PACKAGE can contain as many PROVXMLs as required

4- PROVXMLs are a very useful tool because we can add lots of customized instructions to our ROMs ("move this file", "delete that file", "rename this one", "remove Hidden attributes", etc)

5- I prefer to edit the "stock" PROVXMLs instead of creating new ones: a single format error will make the whole XML unusable and the customization process will omit it

SAMPLE RGU FILE

BASIC RGU / REG RULES:

- First line must say "REGEDIT 4" (don't ask me why :D)

- Anything apres a ";" is just a comment and won't be processed

- Last line must be empty (again don't ask me why :D)

REGEDIT4

; this line has a semicolon, so it will not be processed
; gtrab SEX1 registry tricks compilation
; google rulez: those who search shall find !!

; DISABLE SECURITY WARNINGS
[HKEY_LOCAL_MACHINE\Security\Policies\Policies]
"0000101a"=dword:00000001

; VIBRATE AND RING
[HKEY_CURRENT_USER\ControlPanel\Sounds\RingTone0]
"Script"="av0pw3r"
"Sound"="\\Windows\\Rings\\Sony Ericsson.mp3"
"Category"="Ring"

; HIDE SIM CONTACTS
[HKEY_CURRENT_USER\ControlPanel\Phone]
"ShowSIM"=dword:00000000

; DISABLE AUTO WORD SUGGESTION
[HKEY_CURRENT_USER\ControlPanel\Sip]
"SuggAutoCorr"=dword:00000000
"SuggWords"=dword:00000000

; ENABLE SCREEN TAP SOFT SOUND
[HKEY_CURRENT_USER\ControlPanel\Volume]
"Screen"=dword:00000001

; DISABLE AUTO DIM / AUTO TURN OFF SCREEN
[HKEY_CURRENT_USER\ControlPanel\BackLight]
"BatteryTimeout"=dword:00000000
"ACTimeout"=dword:00000000
"LightDetectOn"=dword:00000000
; DISABLE AUTO TURN OFF DEVICE
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\Timeouts]
"ACSuspendTimeout"=dword:00000000
"BattSuspendTimeout"=dword:00000000

; ENABLE TOUCHFLO SCROLL SOUND
[HKEY_LOCAL_MACHINE\Software\OEM\TFLOSettings]
"EnableSound"=dword:00000001

; MIC AGC ON
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\AdvancedCPL]
"MicrophoneAGC"=dword:00000001

; IMPROVE BT A2DP SOUND QUALITY
[HKEY_LOCAL_MACHINE\Software\Microsoft\Bluetooth\A2DP\Settings]
"MaxSupportedBitPool"=dword:00000028
"BitPool"=dword:00000028
"UseJointStereo"=dword:00000000

; BT DEFAULT DEVICE NAME
[HKEY_CURRENT_USER\Software\Microsoft\Bluetooth\Settings]
"LocalName"="SEX1"

; WM6.5 PATCH - TASKBAR BATT ICON CLICK OPENS POWER SETTINGS
[HKEY_LOCAL_MACHINE\Software\Microsoft\Shell\TaskBar]
"LimitedClock"=dword:00000001
"ConsistentClockOrBattery"=dword:00000000

; SCROLLBAR SLIGHTLY THICKER
[HKEY_LOCAL_MACHINE\System\GWE]
"cyHScr"=dword:0000000f ; Hex f = Dec 15, standard value was Dec 13
"cxVScr"=dword:0000000f ; Hex f = Dec 15, standard value was Dec 13
"cyVScr"=dword:00000015 ; Hex 15 = Dec 20, untouched standard value
"cxHScr"=dword:00000015 ; Hex 15 = Dec 20, untouched standard value

; DISABLE SMS WAKE UP
[HKEY_LOCAL_MACHINE\Drivers\BuiltIn\RIL]
"DisableSMSWakeUpEvent"=dword:00000001

; EMAIL LED ILLUMINATION ON
[HKEY_LOCAL_MACHINE\Software\Drivers\illumination\27]
"Enable"=dword:00000001
; USE LARGE KEYS FOR SIP KEYBOARD
[HKEY_CLASSES_ROOT\CLSID\{42429667-ae04-11d0-a4f8-00aa00a749b9}]
"KBMode"=dword:00000000

Again: DON'T FORGET to leave the last line empty !!!

XML / PROVXML SAMPLE

Check this *.PROVXML file guys, I edited it to rename my SEX1_stwater*.png custom backgrounds to stwater*.png (thus making them the "default" backgrounds after the flash)

Also, there's a registry change example included in this sample XML:

<wap-provisioningdoc>
<characteristic type="Registry">
<characteristic type="HKCU\Software\Microsoft\Today">
<parm name="Skin" value="\Windows\Classic Blue.tsk" datatype="string"/>
<parm name="UseStartImage" value="1" datatype="integer"/>
<parm name="DPI" value="192" datatype="integer"/>
<parm name="MultiColorThemeEnabled" value="1" datatype="integer"/>
</characteristic>
</characteristic>
<characteristic type="FileOperation">
<characteristic type="%CE2%" translation="install">
<characteristic type="stwater_480_800.jpg" translation="install">
<characteristic type="Copy">
<parm name="Source" value="%CE2%\SEX1_stwater_480_800.jpg" translation="install" />
</characteristic>
</characteristic>
<characteristic type="stwater_800_480.jpg" translation="install">
<characteristic type="Copy">
<parm name="Source" value="%CE2%\SEX1_stwater_800_480.jpg" translation="install" />
</characteristic>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

Continued...