欢迎Hermes爱好者s署名转载本文,转载请遵循署名-非商业性使用-相同方式共享 2.5协议,注明出自http://www.thinkagain.cn 

You can copy, distribute this article, but dont forget to point a link to my site:http://www.thinkagain.cn.

English user please scrolls down for english explanation.
=====================================================

授之以之: 

系列5. 编辑Preconfig.txt,xml(provxml)配置文件

位于My_ROM_Kitchen\OEM\OEMOPERATORS目录下的Preconfig.txt文件是用来配置Windows mobile 6.0第一次运行时加载的软件或其它设定等。该文件属性默认是设置为只读,编辑它之前请将只读属性去掉。

Dopod官方版WM6.0 ROM的Preconfig.txt内容如下: 

LOCK:Enabled
EXEC:\Windows\SetAcousticParam.exe
EXEC:\Windows\SetHSDPA.exe /Enable
EXEC:\Windows\cusTSK.exe \Windows\Dopod_Black.tsk
CAB: \Windows\P_DisconnectButton_3s.sa.CAB
CAB: \Windows\P_Sound_Dopod_WWE_0713.CAB
CAB: \Windows\mHub_playerMiddleLayer_2.CAB
XML: \Windows\D_Hutchison6.xml
XML: \Windows\HWL_Authority5.cer.xml
XML: \Windows\HWL_Authority6.cer.xml
XML: \Windows\P_Button5_VCommand.xml
XML: \Windows\P_Other_Conn_Settings.xml
XML: \Windows\PP_Emergency_112_911_999_000.xml
XML: \Windows\PP_GenericUI.xml
Hide:Enabled
EXEC:\Extended_ROM\autorun.exe
LOCK:Disabled
RST: Reset

 

该文件,将按顺序,先运行SetAcousticParam.exe等3个exe文件,然后安装3个Cab,接着再加载7个xml文件中的设定(主要为注册表信息或数字签名),最后在执行Extended_ROM里面的autorun.exe来安装Extended_ROM里面的软件。除了LOCK,Hide外,可以看到命令都是以EXEC,CAB或XML开头,其中: 

EXEC:用来运行exe可执行文件。EXEC:后面是exe文件的路径和运行参数。

CAB:安装Cab文件。

XML:加载xml。 

RST:重启PPC。

EXEC:\Extended_ROM\autorun.exe,是用来执行Extended_ROM里面的autorun.exe文件,如果将这行命令删掉,系统将不会安装Extended_ROM里面的软件。CAB: \Windows\P_Sound_Dopod_WWE_0713.CAB将会安装Dopod的几个铃声,P_Sound_Dopod_WWE_0713.CAB位于OEMOPERATORS目录下,你可以将该命令和Cab文件删掉节约2.1MbROM空间。EXEC:\Windows\cusTSK.exe \Windows\Dopod_Black.tsk将会默认主题(Windows Default)改为Windows目录下的Dopod_Black.tsk。你也可以将Dopod_Black.tsk改成其它主题。

知道Preconfig.txt的结构后,通过增减命令可以达到定制的目的。下面是我制作的My ROM kitchen for SoftBank里面的Preconfig.txt文件的内容。 

LOCK:Enabled
EXEC:\Windows\SetAcousticParam.exe
EXEC:\Windows\SetHSDPA.exe /Enable
EXEC:\Windows\cusTSK.exe \Windows\Htc_New_Default.tsk
CAB: \Windows\P_DisconnectButton_3s.sa.CAB
XML: \Windows\D_Hutchison6.xml
XML: \Windows\HWL_Authority5.cer.xml
XML: \Windows\HWL_Authority6.cer.xml
XML: \Windows\P_Button5_VCommand.xml
XML: \Windows\SecurityOff.xml
CAB: \Windows\ConnSBM.CAB
EXEC:\Windows\WIFIwake.exe
CAB: \Windows\MMSLite.bld275.CAB
XML: \Windows\Settings.xml
HIDE:Enabled
LOCK:Disabled
RST: Reset

 

除保留执行exe和加载xml外,将Dopod铃声的安装包删掉,自行添加了Softbank的网络连接设置、MMS等。下面3行命令是用来采用itamae的方法设定SoftBank的网络连接。 

XML: \Windows\SecurityOff.xml
CAB: \Windows\ConnSBM.CAB
EXEC:\Windows\WIFIwake.exe

 

CAB: \Windows\MMSLite.bld275.CAB用来安装MMSLiteb275for X01HT作为系统MMS收发软件,替代系统自带的Arcsoft MMS。唯一不足的是并需安装EUDC.ttf来显示emoji,而且还无法显示彩色emoji。 

XML: \Windows\Settings.xml是用来加载一些自定义的设定,如电源管理,优化系统,修正USB同步问题等。

下面来介绍下xml文件格式,provxml的格式和xml基本一样。2者均用来加载一些系统设置或者数字签名等。对于provxml和xml的区别,我还不大懂,似乎是provxml的内容是一定会被系统自动加载,而xml需Preconfig.txt里的命令加载。Dopod官方ROM的OEMOPERATORS里面有2个provxml文件,mxipupdate_zzPIED_101.provxml和mxipupdate_zzPIED_102.provxml(几个签名证书)。101.provxml里面设定了系统初次运行时,将调用Preautorun.exe(OEMOPERATORS目录下)运行Preconfig.txt内命令。有些非官方ROM里面的不是Preautorun和preconfig而是autorun.exe和config.txt,那么config.txt就是命令配置文件。

图1是Setting.xml的部分内容,内含4个优化电源管理注册表项。  

xml

Fig.1 XML文件-优化电源管理

  

和OEM Package中的option.xml不一样,系统设定用的xml必须嵌套在<wap-provisioningdoc></wap-provisioningdoc>和<characteristic></characteristic>内。在<!–和–>内的都是注释语句。characteristic的type=”Registry”说明这是个注册表表项,type也可以是注册表的键名,如图1中的”HKLM\Comm\AsyncMac1\Parms”,或者是数字签名证书等。

如将3G网络名称前缀从UMTS(默认)改为3G的相关<characteristic>代码见图2。

xml

Fig.2 XML文件-改网络名称前缀

 

如图3是添加My SoftBank for X SeriesGoogleThinkAgain到收藏夹里面。Url指定网址,Icon指定网站的图标。 

xml

Fig.3 XML文件-添加网址到收藏夹

  

Setting.xml可以在文末下载,你可通过参照它,自行增加一些系统优化的注册表。

从介绍如何分解和合成RUU_signed.nbh开始,到分解OS,建立ROM kitchen,制作OEM Package和编辑Preconfig和xml配置文件,相信至此,Fans应该都已经制作了自己的ROM Kitchen了,当然除了自己制作OEM Package外,也可以在网上找现成的OEM Package直接使用。下次将谈一些定制ROM kitchen时的一些常见错误和解决方法。

软件下载(Tool downloads) 

Setting.xml

Download settings.xml
xml- File
13. Aug 2007 (1073Hits)

  

 

===============English explanation==============

  

Lesson 5. Edit preconfig, xml (provxml) file

The Preconfig.txt under My_ROM_Kitchen\OEM\OEMOPERATORS is used to config the loading application or settings in first running of windows mobile 6.0. It is a hiden file, you have to change its hiden attribute before editing.

The contents of preconfig.txt in Dopod official WM6.0 ROM are:

LOCK:Enabled
EXEC:\Windows\SetAcousticParam.exe
EXEC:\Windows\SetHSDPA.exe /Enable
EXEC:\Windows\cusTSK.exe \Windows\Dopod_Black.tsk
CAB: \Windows\P_DisconnectButton_3s.sa.CAB
CAB: \Windows\P_Sound_Dopod_WWE_0713.CAB
CAB: \Windows\mHub_playerMiddleLayer_2.CAB
XML: \Windows\D_Hutchison6.xml
XML: \Windows\HWL_Authority5.cer.xml
XML: \Windows\HWL_Authority6.cer.xml
XML: \Windows\P_Button5_VCommand.xml
XML: \Windows\P_Other_Conn_Settings.xml
XML: \Windows\PP_Emergency_112_911_999_000.xml
XML: \Windows\PP_GenericUI.xml
Hide:Enabled
EXEC:\Extended_ROM\autorun.exe
LOCK:Disabled
RST: Reset 

 

The WM6.0 will orderly execute each command line in preconfig.txt. Firstly, run SetAcousticParam.exe, SetHSDPA.exe and cusTSK.exe, then install 3 cabs,  load 7 xml files(most of them are registry entries or ceritfications), finally execute autorun.exe in Extended_ROM. Most commands start with EXEC, CAB or XML.

EXEC: execute exe file.  following EXEC are the path of exe file and command parameters. 

CAB: install cab.

XML: load XML.

RST: reboot PPC. 

EXEC:\Extended_ROM\autorun.exe is used to invoke autorun.exe to install the applications in Extended_ROM. If this command line is deleted, system will not install any applications in Extended_ROM.

CAB: \Windows\P_Sound_Dopod_WWE_0713.CAB will install Dopod ringstones. P_Sound_Dopod_WWE_0713.CAB is located in OEMOPERATORS folder, you can delete this command line and cab file to release about 2.1Mb ROM space. EXEC:\Windows\cusTSK.exe \Windows\Dopod_Black.tsk will use cusTSK.exe to change OS theme to Dopod_Black.tsk. You also can modify Dopod_Black.tsk to other theme.

Now we know the structure of Preconfig.txt, we can customize it by revising the command line. The following are the Preconfig.txt contents in my customized ROM kitchen for Softbank. 

LOCK:Enabled
EXEC:\Windows\SetAcousticParam.exe
EXEC:\Windows\SetHSDPA.exe /Enable
EXEC:\Windows\cusTSK.exe \Windows\Htc_New_Default.tsk
CAB: \Windows\P_DisconnectButton_3s.sa.CAB
XML: \Windows\D_Hutchison6.xml
XML: \Windows\HWL_Authority5.cer.xml
XML: \Windows\HWL_Authority6.cer.xml
XML: \Windows\P_Button5_VCommand.xml
XML: \Windows\SecurityOff.xml
CAB: \Windows\ConnSBM.CAB
EXEC:\Windows\WIFIwake.exe
CAB: \Windows\MMSLite.bld275.CAB
XML: \Windows\Settings.xml
HIDE:Enabled
LOCK:Disabled
RST: Reset

 

Except to keep running exe and loading xml, I deleted Dopod cab, added the command of softbank MMS and internet setting. The following 3 lines are used to set internet connection of softbank based on itamae’ AP. 

XML: \Windows\SecurityOff.xml
CAB: \Windows\ConnSBM.CAB
EXEC:\Windows\WIFIwake.exe

 

CAB: \Windows\MMSLite.bld275.CAB is used to install MMSLiteb275for X01HT as MMS application instead of Arcsoft MMS. The only lack is it has to use EUDC.ttf to display emoji, but EUDC.ttf can not support  color emoji.  

XML: \Windows\Settings.xml is used to load some customized configuration, such as power management, fixed USB synchronization.

There are 2 provxml files (mxipupdate_zzPIED_101.provxml and mxipupdate_zzPIED_102.provxml)in OEMOPERATORS. In 101.provxml, it sets that OS will run preautorun.ex and load preconfig.txt. 102.provxml contains several certifications. I dont know the exact difference between xml and provxml. Both of them are used to load some system configurations or certifications. I thought that the provxml will automatically loaded by OS, while xml can only be loaded by Preconfig.txt. Some inofficial ROM has config.txt as configuration file not Preconfig.txt.

Fig.1 is partial content of Setting.xml, it contains the 4 registry entries related to power management. 

The format of xml in OEMOPERATORS is different with the option.xml in OEM Package. It is embeded in <wap-provisioningdoc></wap-provisioningdoc> and <characteristic></characteristic>. The comments is bracket in <!– and –>. The type of character is “Registry” indicates that it is a registry entry. The type can be key name of registry, like:”HKLM\Comm\AsyncMac1\Parms” in Fig.1, or be certifications.

The xml code of changing prefix of network name from UMTS(default in Dopod official ROM) to 3G are shown in Fig.2.

Fig.3 shows the code of adding My SoftBank for X Series,Google and  

ThinkAgain(My Blog) to favorites. URL is the site url. Icon is the site icon which is located in \Windows.

You can consult the Setting.xml download link above, add some system tune registry entries.

OK, this is today’s content. Next we will talk about the frequent errors and solutions in customizing ROM.  

Feed Me


转载文章请注明转载自:ThinkAgain - Let's Blog!

引用地址:http://www.thinkagain.cn/archives/450.html