ROMs For Dummies: Part Four
From AllShadow.com Wiki
Contents |
Introduction
Welcome to ROMS For Dummies Part 4. This section will deal with how to customize the ROM image to your needs by adding registry edits, provisioning files, and by adding 3rd party software into the ROM image.
Tools you need
PackagesCreator5.4 – Creates the OEM packages for both software and registry edits.
Creating Registry Edits
Registry edits are some of the most important parts to a custom ROM image as they give that extra level to go beyond in order to get away from the annoyances in a stock carrier ROM image. This example will demonstrate how to make the ROM start off with a application unlock in order to install unsigned CAB installations.
Creating the structure
Start off by creating a new folder in the OEM package that will have a meaningful name for what you are creating. For this example, call it “Application Unlock”. Now open up PackagesCreator5.4 and click on “Open Package”. In the dialog window, select the Application Unlock folder that you just created and click OK. Click on “complete package” and then on “Build Package”. When you’re done, the Application Unlock folder you should look like this:"
You will notice that this folder now has two files, a .DSM file and a .RGU file. You should also see that they have this same very long file name called a Globally Universal ID or GUID for short. This will allow the ROM build software to distinguish this bit of software from the others. The file you will need to add registry edits to is the .RGU file.
Editing the .RGU file
Open up the .RGU file. You should see a popup saying that Windows doesn’t know how to open the file. Click on the option that allows for you to browse for a program and then select Notepad.exe from the “Browse” dialog. On opening the file you should see that the first line says REGEDIT4. This line must always be the first line a .RGU registry file and should be followed by 1-2 blank lines below it. After that, we’ll need to add the Application Unlock keys and values. Here are the general rules for adding a registry edit:
Keys are navigated to like the following:
[HKEY_LOCAL_MACHINE\Key 1\Sub-Key1]
String values are edited/added in the following way:
“Name of Value”=“String value”
Directories in string names are have additional requirements. When there is a slash denoting a sub-folder, you must place two backslashes preceding the initial directory and any other directories that follow:
“Name of Value”=”\\Windows\\Directory 1\\Sub-Directory 1”
Decimals or hex values are handles in similarly:
“Name of Value”=dword: 1
Other types of values such as multi-strings are possible but are rarely used and go beyond the basics. To look those up, you will need to look in Microsoft’s MSDN Documentation at http://msdn.microsoft.com
For the example, look up the values you want to add or change. By looking up online, you can find that the registry settings for an app unlock call for the values “00001001”, 00001005”, “00001017”, “0000101a”, and “0000101b” in the HKEY_LOCAL_MACHINE\Security\Policies\Policies key to be changed.
To do so, add the following to the registry file:
[HKEY_LOCAL_MACHINE\Security\Policies\Policies]
"00001001"=dword:1
"00001005"=dword:40
"00001017"=dword:144
"0000101a"=dword:1
"0000101b"=dword:1
After the last line, press enter twice to leave two more blank lines at the end of the file. This allows the program that compiles the registry edits to find the end of the file. If you want to add more registry edits, you can either add on to this file or make a new package. Always remember to have REGEDIT4 and a blank line at the start of a file and two blank lines at the end of the file.
Adding Provisioning XML
Provisioning XML or ProvXML for short is a system based on the eXtended Markup Language (XML). It allows for system changes to be quickly added on into a document. The best part about ProvXML is that it allows for registry settings and file system changes to be made upon a hard-reset or soft-reset, depending on the file.
Setting up the package
A package that contains ProvXML is set up the exact same way that a registry OEM package is created. Refer to that section in order to do so.
Creating the ProvXML file
This sample will show you how to add your name into the About page that shows the Windows Mobile Version. For example, it might show “Build 5.2.0 (20757) by ND4SPD”. Open up Notepad to start off a ProvXML file. Every ProvXML file starts with the line <wap-provisioningdoc> and ends with </wap-provisioningdoc>.
Add this to your notepad file so that it looks like the following:
<wap-provisioningdoc>
</wap-provisioningdoc>
All registry and file settings are kept in between <characteristic> and </characteristic> blocks.
The file should now look like this:
<wap-provisioningdoc>
<characteristic type =”Registry”>
</characteristic>
</wap-provisioningdoc>
Inside of a registry or file system characteristic, another characteristic is nested that has the parameters of the characteristic. Each parameter is started off with a <parm />
The file should now look like this:
<wap-provisioningdoc>
<characteristic type=”Registry”>
<characteristic type = “HKLM\SOFTWARE\Microsoft\Shell\DeviceBeta” translation=”filesystem”>
<parm name=”About” datatype=”string” value=” by ND4SPD” />
</characteristic>
</characteristic>
</wap-provisioningdoc>
To understand the file, each characteristic for a registry edit has a “type” that shows the location in navigation to a specific key in registry. The parameter’s “name” property indicates the value to edit and the datatype property indicates whether the data is a string, a decimal, a multi-string, a hex value, etc. The “value” is the actual value of the parameter.
Further ProvXML editing documentation can be found at: http://msdn.microsoft.com/en-us/library/aa458983.aspx
Saving the file
There are two types of provisioning xml files that you can save the file as. Saving as a “mxip_<package name>_<version>.provxml” or “mxipupdate_<package name>_<version>.provxml” file. The first one will write the registry settings on a cold boot or hard reset. The latter will write registry or file system entries on every warm-boot or reset. For this file, save it as the first type with the name, “mxip_ROMVERSION_100.provxml”. When saving the file, remember to set files of type as “All Files” and ensure the encoding is “Unicode”. If it is not a Unicode ProvXML file, it will not work. When you’re done, make sure that it is not saved as a .txt file. If it is, rename the extension to .provxml.
Adding 3rd Party Software
To add third party software, you need to ensure the following things: You must either have a cab of the software or you must have all of the files and the registry settings to go along with the file. Open up PacakgesCreator5.4 to create the package.
For a .CAB file:
Open PackagesCreator 5.4 and then click on Open Cab File. Select the CAB file you want and then click ok. Another program will open. Look for the icon that says extract all files and click it. Allow it to save to the selected directory (which will probably be you local drive) and then close out of the program. When you get back to the package creator, look for the .lnk shortcut file in the initflashfiles box at the top. Select the file and then click “Default” and then “Ok”. This will create a shortcut on the start menu. Click complete package and then build package. Make sure the copy the OEM package that was created into your OEM folder.
For files:
Follow the steps that were listed above for creating an OEM package for an RGU file. Copy all of the files into that new package and then add registry edits into the RGU file as mentioned above.
Summary
By this point, you should be able to customize the ROM image to your needs. Remember that there is a space limitation on the Shadow and you'll need to add programs sparingly unless you are removing most of T-Mobile's applications. You should be able to create registry entries, provisioning xml, and create pacakages from software.
Get ready for rebuilding the ROM...:D
On to the Next Part
If you are done with Part 4, click here for Part 5 of 5: Rebuilding and Flashing your ROM.
Or if you are looking for other parts, Part 1 of 5: Answering basic questions, Part 2 of 5: Choosing your source and Extraction or Part 3 of 5: Understanding the ROM and Fixing the OEM mess




