[Desire Android Development] foobar66:
There is info about this here and there ... but I figured maybe useful to put it in a small tutorial.

After a factory reset, your HTC Desire will read various files in /system/customize/ and walk you through the initial setup screens.

The process can be customized and simplified. I will explain here how to create a setup using a minimal set of files (2 XML files needed).

FIRST ... make a backup of /system/customize with ADB (I am on Linux so my commands will show Linux bash shell style). You will need a little bit of Linux skill:

On your PC do:

> mkdir customize

> cd customize

> adb pull /system/customize

Now you can create a "minimalistic" set of startup resources by removing some files from your phone:

> adb shell

> mount -o remount,rw /dev/block/mtdblock3 on /system

> cd /system/customize

Now you can remove:

> rm 1_00_sample.xml

> rm cid_map.xml

> rm COMMON.xml

> rm default.xml

> rm mccmnc.xml

> rm mns_map.xml

Now go to:

> cd /system/customize/CID

and remove ALL files EXCEPT "default.xml" ... and:

> cd /system/customize/MNS

and again, remove ALL files EXCEPT "default.xml"

Go back to the PC. From the backup that you made at the very beginning, you can edit the XML files in CID and MNS directories.

Some examples of edits ... there are many more but you just have to peek around the XML.

In CID/default.xml:

<category name="system">

<module name="locale">

<function>

<set name="single">

<item name="total_list">nl_BE;en_BE;fr_BE;</item>

<item type="boolean" name="nl_BE">yes</item>

<item type="boolean" name="en_BE">yes</item>

<item type="boolean" name="fr_BE">yes</item>

This will - at startup - allow you to only select 3 languages (Dutch, English, French).

Then in MNS/default.xml:

<module name="defaultLocale">

<function>

<set name="single">

<item name="auto_detect">false</item>

<item name="defeault">nl_BE</item>

</set>

</function>

with this, you can change the default locale.

In CID/default.xml, you can customize the screens that you walk through at the initial setup of the phone:

<module name="OOBE">

<function name="Block_No_SIM">

<set name="single">

<item name="Default" type="boolean">no</item>

</set>

</function>

<function name="Step_Config">

<set name="single">

<item name="Set_Language" type="boolean">yes</item>

<item name="SIP_Tutorial" type="boolean">no</item>

<item name="Wi-Fi" type="boolean">yes</item>

<item name="Data_Sync" type="boolean">yes</item>

<item name="Account_Setup" type="boolean">yes</item>

<item name="Social_Network_Setup" type="boolean">no</item>

<item name="Tutorial" type="boolean">no</item>

</set>

</function>

<function name="Data_Sync_Config">

<set name="single">

<item name="Default" type="boolean">yes</item>

</set>

</function>

<function name="Account_Config">

<set name="single">

<item name="GMail" type="boolean">yes</item>

<item name="Other_Mail" type="boolean">yes</item>

</set>

</function>

<function name="Social_Network_Config">

<set name="single">

<item name="Facebook" type="boolean">no</item>

<item name="Flickr" type="boolean">no</item>

<item name="Twitter" type="boolean">no</item>

<item name="Plurk" type="boolean">no</item>

</set>

</function>

<function name="Default_Home_Config">

<set name="single">

<item name="Set_HTC_Home" type="boolean">yes</item>

</set>

</function>

</module>

<module name="Footprints">

<function name="settings">

<set name="settings">

<item name="retrieve_address">true</item>

<item name="show_location_disasble_alert">true</item>

<item name="show_connection_failed_alert">true</item>

<item name="serial_number">0</item>

<item name="list_sort">create_time desc</item>

<item name="camera_white_balance">0</item>

<item name="camera_brightness">5</item>

</set>

</function>

</module>

In MNS/default.xml, you can customize standard browser pages (they will be there even after factory reset):

<module name="Browser">

<function name="bookmark">

<set name="plenty">

<!--%%File%%-->

<item name="title">De Standaard</item>

<item name="url">http://m.standaard.be</item>

</set>

And in MNS/default.xml, you can also choose your default browser start page:

<function name="homepage">

<set name="single" max="15">

<item name="url">http://m.standaard.be</item>

</set>

</function>

Many more customizations are possible.

After having modified the default.xml files in CID and MNS, put them back to your phone (example below for CID directory, do the same for MNS directory):

> adb push default.xml /system/customize/CID/

> adb shell

# cd /system/customize/CID/

# busybox chown 0.0 default.xml

# busybox chmod 644 default.xml

After that, do a factory reset ... your phone will startup using the files CID/default.xml and MNS/default.xml to make the initial setup.

Attached are my own CID/default.xml and MNS/default.xml files, just for reference. I have put as a zip file.

Note: I have tested this on Froyo Sense and Froyo Sense HD ROMS ... don't know about AOSP ROMs.