PPCGeeks

PPCGeeks (http://forum.ppcgeeks.com/index.php)
-   HTC Touch Pro 2 (http://forum.ppcgeeks.com/forumdisplay.php?f=97)
-   -   Learn UC / XDA_UC / Registry / XML Provisioning / CAB Editing {2010-12-15} (http://forum.ppcgeeks.com/showthread.php?t=113189)

NinjaDuck 03-06-2010 11:51 AM

Learn UC / XDA_UC / Registry / XML Provisioning / CAB Editing {2010-12-15}
 
2 Attachment(s)
This is in response to a request by Neudof to help him get started using UC.

Disclaimer: There are many tools and methods for using UC and this is just my way. I welcome ideas and in no way consider what I do the best or only way.


What the hell is UC anyway?

UC is an application that silently install .cab, .xml, .mscr, and copies over files to your phone based on the instructions found in a file at the root of your storage card called SDconfig.txt.

The idea behind it is to be able to customize your phone settings and application the way you want it immediately after a new ROM flash without having to spend hours getting it back to the way you like it. For me, I have it down to simply waiting for my sync with exchange to complete after I flash and I am back where I left it.

PART 1
I use a tool called SDConfigGen to generate the config.txt file for me.

Read this thread: CLICK HERE

Unzip SDConfigGen.0.6.zip on your computer and you will have a directory structure created that looks like this:

http://forum.ppcgeeks.com/attachment...1&d=1267890144





Simple steps:
  1. Place your cabs in the cab folder - you can organize in to subfolders.
    • ** Make sure the cabs do not have prompts or you will have to customize them (I have done many) or write a MortScript to click the buttons for you (More on this later)
  2. Place any files you want copied to your device in the Files folder recreating the target tree structure on your device.
    • If you want to put files in the windows folder, create a subfolder called Windows and drop the files in there.
  3. Place any MortScripts you have in the Scripts folder.
  4. Drop Reg files or PROVISIONING XML documents in the Settings folder.
  5. Do not put anything in the Sys folder. This is where SDConfigGen will convert all your REG files and file copy requests to XML PROVISIONING files. This folder gets cleared out each time.
  6. Run SDConfigGen.exe found in the root folder.
  7. Copy the Config.txt file (generated when you run SDConfigGen.exe ) and the entire SDConfig folder that is to the root of your storage card.
  8. Flash a ROM that supports UC and watch the magic.
I will expand with more details on each section in later posts.

Converting from UC to XDA_UC

Many ROMS now support XDA_UC and some have stopped supporting UC. All of the topics I cover in this thread are totally applicable still.

Scroll down to post #6 to learn about the basics of XDA_UC and converting to it.

NinjaDuck 03-06-2010 11:52 AM

Sharing how I do UC (User Customization) - Handling Cabs with Prompts
 
Handling Cabs with Prompts

With the process I use, there are two ways to handle cabs with prompts:

Option #1

Create a MortScript file with the exact same name as the CAB file except with a MSCR suffix. The MortScript file must be put in the same folder as the CAB.


Example:
  • Opera Mobile.cab
  • Opera Mobile.mscr
MortScripts are just text files and not very hard to learn.

Here is an example of a script that would handle the prompts in Opera Mobile's installer:
Code:

windowTitle = "Opera Mobile Installer"
WaitFor(windowTitle, 120)
SendOK(windowTitle)

Opera Mobile Installer is the caption on the message box. It is that easy. Don't be scared.

Option #2

Cabs that prompt the user have a setup.dll enabled that executes some custom code after the install completes. In many cases, these can be disabled without a problem by editing the _SETUP.XML file in the cab and setting the following paramater to 0:
Code:

<parm name="SetupDLL" value="0" />
Be careful because some cabs actually do work during this phase. An example is Opera. It sets all the registry entries necessary to use it as the default browser. Editing the cabs takes a bit more work.

You can extract the cab I made for Opera to examine what I did HERE.

I will provide detail instructions for editing cabs in a later post. The intent of this section was to introduce you to your options so you can make a choice to stop learning here and use MortScript, or continue on in your quest for knowledge.

NinjaDuck 03-06-2010 11:53 AM

Sharing how I do UC (User Customization) - Exporting your Registry
 
3 Attachment(s)
Exporting your registry to the Settings Folder

This is probably the most important section for minimizing the amount of time you have to spend setting up your device after you flash.

Tools

First thing you need is some tools to browse and export registry keys.

My two recommendation (there are many others) are:Since Total Commander is free, I will use it for demonstration purposes.
  1. Select \\Plugins --> registry
  2. Navigate to the appropriate key
    • HKEY_LOCAL_MACHINE\SOFTWARE\HTC\Manila\Home is for example where the shortcuts on the Manila home screen are stored. Exporting this entire key will restore your shortcuts.
  3. Press and hold on the key and select Copy/Move http://forum.ppcgeeks.com/attachment...1&d=1267929910
  4. Save the file to your storage card.
  5. Copy to your computer in the Settings folder.
    • Edit as needed - I recommend reviewing it to make sure you only carry forward what you need and avoid problems.
    • Rename if you like
    • You can also arrange settings in sub-folders.
Here are some keys you might be interested in:
  • HKEY_CURRENT_USER\Software\HTC\Manila
  • HKEY_LOCAL_MACHINE\SOFTWARE\HTC\Manila\Configurati on
  • HKEY_LOCAL_MACHINE\SOFTWARE\HTC\Manila\Home
  • HKEY_CURRENT_USER\Software\ageye\G-Alarm
  • HKEY_LOCAL_MACHINE\Software\HTC\HTCAnimation
  • HKEY_LOCAL_MACHINE\Ident
  • HKEY_LOCAL_MACHINE\SOFTWARE\KeyboardConfig\Keys
  • HKEY_CURRENT_USER\ControlPanel\Notifications
  • HKEY_CURRENT_USER\Software\Microsoft\Inbox\Setting s
  • HKEY_CURRENT_USER\Software\HTC\BootLauncher\Servic es
  • HKEY_CURRENT_USER\ControlPanel\Owner
  • HKEY_LOCAL_MACHINE\SOFTWARE\HTC\PHONE
  • HKEY_LOCAL_MACHINE\Software\HTC\QuickGPS
  • HKEY_CURRENT_USER\Software\HTC\TaskManager
  • HKEY_CURRENT_USER\Software\Microsoft\Today
  • HKEY_LOCAL_MACHINE\Software\Microsoft\Voice Command\Extensions
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Splash Scree

NinjaDuck 03-06-2010 11:53 AM

Sharing how I do UC (User Customization) - PROVISIONING XML
 
Provisioning XML
Provisioning XML documents are simply a set of instructions based in an XML document that tells your phone what to do. This is actually the same structure used in CAB installation files.

Provinsioning XML 101 - Learn XML



First a couple of pieces of information for those who are completely new to this.
  • XML is simply a text file - don't be afraid
  • XML is a structured hierarchical documents consisting of opening and closing tags.
  • XML must be well formed - for every opening tag you need a closing tag.
Code:

<XML>
 <ELEMENT>
 </ELEMENT>
</XML>

  • Elements refer to the tags with <> around them and a preceding / before the element name is used to close the tag.
  • An element can self terminate by having a trailing / implying there is no data.
Code:

<XML>
 <ELEMENT/>
</XML>

  • Comments can be made in XML as follows:
Code:

<XML>
 <!-- EXAMPLE OF AN ELEMENT WITH AN OPEN AND CLOSE -->
 <ELEMENT></ELEMENT>
 <!-- EXAMPLE OF AN ELEMENT THAT SELF TERMINATES -->
 <ELEMENT/>
</XML>

  • Attributes can be contained in an Element and would look like this:
Code:

<XML>
 <ELEMENT SAMPLE="See what I am saying"></ELEMENT>
</XML>

Provinsioning XML 102 - wap-provisioningdoc

A wap-provisioningdoc is an xml document that opens with the <wap-provisioningdoc> tag and contains elements with the charachteristics you want to set.


Some charachteristics you might be interested in:
  • Bluetooth
  • Clock
  • DeviceEncryption
  • Email2
  • FileOperation
  • FileSystem
  • Home
  • Registry
  • Sounds
  • SpeedDial
  • Sync
  • WI-FI
Since recreating MSDN is a bit out of scope, here is a reference:
http://msdn.microsoft.com/en-us/library/bb737536.aspx

Provinsioning XML 200 - Common examples

ActiveSync (exchange) - These are the settings I use, your settings may be different.
Code:

<wap-provisioningdoc>
  <characteristic type="Sync">
  <characteristic type="Connection">
  <parm name="Server" value="{your domain}"/>
  <parm name="AllowSSLOption" value="1"/>
  <parm name="User" value="{your username}"/>
  <parm name="Domain" value="{your domain}"/>
  <parm name="Password" value="{your password}"/>
  <parm name="SavePassword" value="1"/>
  </characteristic>
  <characteristic type="Settings">
  <parm name="PeakStartTime" value="0800"/>
  <parm name="PeakEndTime" value="1800"/>
  <parm name="PeakFrequency" value="-1"/>
  <parm name="BodyTruncation" value="-1"/>
  <parm name="SyncWhenRoaming" value="1"/>
  <parm name="MIMETruncation" value="51200"/>
    <characteristic type="PeakDays">
                            <parm name="Sun" value="0"/>
                            <parm name="Mon" value="1"/>
                            <parm name="Tue" value="1"/>
                            <parm name="Wed" value="1"/>
                            <parm name="Thr" value="1"/>
                            <parm name="Fri" value="1"/>
                            <parm name="Sat" value="0"/>
                          </characteristic>
  </characteristic>
  <characteristic type="Mail">
  <parm name="Enabled" value="1"/>
  <parm name="MailBodyTruncation" value="-1"/>
  <parm name="MailFileAttachments" value="-1"/>
  </characteristic>
  <characteristic type="Calendar">
  <parm name="Enabled" value="1"/>
  </characteristic>
  <characteristic type="Contacts">
  <parm name="Enabled" value="1"/>
  </characteristic>
      <characteristic type="Tasks">
          <parm name="Enabled" value="0"/>
      </characteristic>
  </characteristic>
</wap-provisioningdoc>

ActiveSync (gmail) - These are the settings I use, your settings
Code:

<wap-provisioningdoc>
  <characteristic type="Sync">
  <characteristic type="Connection">
  <parm name="Server" value="m.google.com"/>
  <parm name="AllowSSLOption" value="1"/>
  <parm name="User" value="{email address}"/>
  <parm name="Password" value="{password}"/>
  <parm name="SavePassword" value="1"/>
  </characteristic>
  <characteristic type="Settings">
  <parm name="PeakStartTime" value="0800"/>
  <parm name="PeakEndTime" value="1800"/>
  <parm name="PeakFrequency" value="-1"/>
  <parm name="BodyTruncation" value="-1"/>
  <parm name="SyncWhenRoaming" value="1"/>
  <parm name="MIMETruncation" value="51200"/>
    <characteristic type="PeakDays">
                            <parm name="Sun" value="0"/>
                            <parm name="Mon" value="1"/>
                            <parm name="Tue" value="1"/>
                            <parm name="Wed" value="1"/>
                            <parm name="Thr" value="1"/>
                            <parm name="Fri" value="1"/>
                            <parm name="Sat" value="0"/>
                          </characteristic>
  </characteristic>
  <characteristic type="Mail">
  <parm name="Enabled" value="1"/>
  <parm name="MailBodyTruncation" value="-1"/>
  <parm name="MailFileAttachments" value="-1"/>
  </characteristic>
  <characteristic type="Calendar">
  <parm name="Enabled" value="1"/>
  </characteristic>
  <characteristic type="Contacts">
  <parm name="Enabled" value="1"/>
  </characteristic>
      <characteristic type="Tasks">
          <parm name="Enabled" value="0"/>
      </characteristic>
  </characteristic>
</wap-provisioningdoc>

IMAP4 - same disclaimer
Code:

<wap-provisioningdoc>
  <characteristic type="EMAIL2">
  <characteristic type="{bef6bd14-cdcf-403f-a7a7-f4aa9055bdf8}">
  <parm name="SERVICENAME" value="{Name the service}" />
  <parm name="SERVICETYPE" value="IMAP4" />
  <parm name="INSERVER" value="imap.gmail.com" />
  <parm name="OUTSERVER" value="smtp.gmail.com" />
  <parm name="NAME" value="{Your Name}" />
  <parm name="REPLYADDR" value="{your email}" />
  <parm name="AUTHNAME" value="{Your username/email account}" />
  <parm name="AUTHSECRET" value="{your password}" />
  <parm name="DOMAIN" value="" />
  <parm name="AUTHREQUIRED" value="1" />
  <parm name="LINGER" value="0" />
  <parm name="RETRIEVE" value="-1" />
  <parm name="KEEPMAX" value="0" />
  <parm name="DWNDAY" value="3" />
                        <parm name="SMTPALTENABLED" value="0" />
                      <parm name="SMTPALTAUTHNAME" value="" />
                      <parm name="SMTPALTPASSWORD" value="" />
                        <parm name="SMTPALTDOMAIN" value="" />
                          <characteristic type="TAGPROPS">
      <parm name="8128000B" value="1"/>
      <parm name="812C000B" value="1"/>         
    </characteristic>
  </characteristic>
  </characteristic>
</wap-provisioningdoc>

POP3 - The example used here is for checking hotmail using POP3 (your settings may be different)
Code:

<wap-provisioningdoc>
  <characteristic type="EMAIL2">
        <characteristic type="{618a7a2b-d44e-4069-9df0-c7aa69038a37}">
            <parm name="SERVICENAME" value="Hotmail" />
            <parm name="SERVICETYPE" value="POP3" />
            <parm name="INSERVER" value="pop3.live.com" />
            <parm name="OUTSERVER" value="smtp.live.com" />
            <parm name="NAME" value="My Name" />
            <parm name="REPLYADDR" value="" />
            <parm name="AUTHNAME" value="{your account}@hotmail.com" />
            <parm name="AUTHSECRET" value="{your passowrd}" />
            <parm name="DOMAIN" value="" />
            <parm name="AUTHREQUIRED" value="1" />
            <parm name="LINGER" value="120" />
            <parm name="RETRIEVE" value="-1" />
            <parm name="KEEPMAX" value="-1" />
            <parm name="DWNDAY" value="3" />
                        <parm name="SMTPALTENABLED" value="0" />
                        <parm name="SMTPALTAUTHNAME" value="" />
                        <parm name="SMTPALTPASSWORD" value="" />
                        <parm name="SMTPALTDOMAIN" value="" />
                          <characteristic type="TAGPROPS">
                <parm name="8128000B" value="0"/>
                <parm name="812C000B" value="0"/>         
              </characteristic>
        </characteristic>
  </characteristic>
</wap-provisioningdoc>

WI-FI - Other authentication methods exist that you may need to set based on your router - see MSDN link above
Code:

<wap-provisioningdoc>
    <characteristic type="Wi-Fi">
        <characteristic type="access-point">
            <characteristic type="{YOUR SID}">
                <parm name="NetworkKey" value="{YOUR KEY}"/>
                <parm name="Authentication" value="0"/>
                <parm name="Encryption" value="0"/>
                <parm name="KeyIndex" value="1"/>
                <parm name="KeyProvided" value="0"/>
        </characteristic>
        </characteristic>
    </characteristic>
</wap-provisioningdoc>

CLOCK
Code:

<wap-provisioningdoc>
  <characteristic type="clock">
      <!-- COMMENT - EASTERN US - SEE MSDN -->
      <parm name="TimeZone" value="35"/>
  </characteristic>
</wap-provisioningdoc>

FAVORITES
Code:

<wap-provisioningdoc>
<characteristic type="BrowserFavorite">
  <characteristic type="PPC Geeks">
    <parm name="URL" value="http://m.ppcgeeks.com/"/>
    <parm name="Order" value="0"/>
  </characteristic>
</wap-provisioningdoc>

** Just save these to a text file in your settings folder with an XML file extension.

NinjaDuck 03-06-2010 11:54 AM

Sharing how I do UC (User Customization) - Removing the thi
 
Advanced Customizations - Removing the things I don't use...


For me, removing stuff from a ROM falls in to only a couple of categories:
  • Shortcuts I will never use
  • Hiding features to optimize the device to how I use it
  • Disabling Service / Devices to save memory and battery life
  • Got other suggestions, I am all ears...
Removing / Moving Shortuts
One could argue that you should just figure out how to remove the application, but as long as it is not memory resident, who cares...
I am demonstrating this with XML since the poll shows more interest for this. This can also easily be done with a MortScript.

In example #1, I will show how to remove a shortcut you do not want:

Code:

<wap-provisioningdoc>
<characteristic type="FileOperation">
<!-- DELETE A SHORTCUT YOU DO NOT NEED -->
<characteristic type="%CE11%\7-Zip.lnk" translation="install">
<characteristic type="Delete">
<parm name="ForceDelete"/>
</characteristic>
</characteristic>
</characteristic>
</wap-provisioningdoc>

In example #2, I will show you how to move links from one folder to another (reorganize)

Code:

<wap-provisioningdoc>
  <characteristic type="FileOperation">
    <characteristic type="%CE11%\Other" translation="install">
      <!-- MAKE THE DIRECTORY IF IT DOES NOT EXIST -->
      <characteristic type="MakeDir" />
      <!-- FIRST PICK THE DESTINATION -->
      <characteristic type="Resco Update.lnk" translation="filesystem">
        <characteristic type="Move">
          <parm name="Source" value="%CE11%\Resco Update.lnk" translation="install"/>
          <parm name="RemoveAttributes" value="HRS" />
        </characteristic>
      </characteristic>
    </characteristic>
  </characteristic>
</wap-provisioningdoc>

**I tend to use MortScript for this because you can easily test if the file exists and avoid errors

Hiding Manila Tabs

Easy Easy REG file for this one. Just set the last number to 2 in order to hide a tab:
Code:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\HTC\Manila]
"Manila://album.page.hidden"=dword:00000000
"Manila://calendar.page.hidden"=dword:00000000
"Manila://docexplorer.page.hidden"=dword:00000002
"Manila://email.page.hidden"=dword:00000002
"Manila://footprints.page.hidden"=dword:00000002
"Manila://home.page.hidden"=dword:00000000
"Manila://inforwidget.page.hidden"=dword:00000002
"Manila://reader.page.hidden"=dword:00000002
"Manila://internet.page.hidden"=dword:00000002
"Manila://messaging.page.hidden"=dword:00000000
"Manila://music.page.hidden"=dword:00000000
"Manila://people.page.hidden"=dword:00000000
"Manila://settings.page.hidden"=dword:00000000
"Manila://twitter.page.hidden"=dword:00000002
"Manila://weather.page.hidden"=dword:00000000

Removing a File / Folder Sample
Code:

<characteristic type="FileOperation">
 <characteristic type="%CE2%\NinjaDuck" translation="install">
  <characteristic type="%CE2%\NinjaDuck\Entropy.txt" translation="install">
  <characteristic type="Delete">
    <parm name="ForceDelete"/>
  </characteristic>
  </characteristic>
  <characteristic type="%CE2%\NinjaDuck" translation="install">
  <characteristic type="RemoveDir" />
  </characteristic>
 </characteristic>
</characteristic>

Disabling Services and Devices

Coming soon....

NinjaDuck 03-06-2010 09:01 PM

Converting UC to XDA_UC
 
1 Attachment(s)
Using XDA_UC

Q: What is the difference between UC and XDA_UC?

A: Not much really. You can do many of the same things except XDA_UC is script based and uses a flattened structure for XML, REG, MSCR, and CAB files. It does other things as well and applications can vary. I am just going to cover the basics here. FYI - UC does not support REG, so this is a clear advantage.

Getting Started with XDA_UC
  • Create a folder on your storage card called XDA_UC
  • Dump your XML, REG, MSCR, and CAB files in it and you are ready to go.
  • Pretty easy right?
The best place to find out what other things XDA_UC does is here: Converting from UC to XDA_UC

You could just dump your files in the directory and go. Me personally, I like to keep my files organized on my computer the I used to do it for UC.

For that reason, I created the attached old school CMD file to create the XDA_UC folder on my computer so I can just copy it to my phone.
  • Unzip the file to your SdConfig folder right below the "Storage Card" folder.
  • Edit the file to represent your folder structure.
  • Run the CMD and it will delete and recreate the XDA_UC folder for you (Warning - it will delete any files you put directly in the XDA_UC folder).
Please ask questions and I will try to add content to the post.

NinjaDuck 03-06-2010 10:55 PM

Some additional information you might fined helpful
 
Some additional information you might fined helpful

There are variables to use for folder paths

%CE1% \Program Files
%CE2% \Windows
%CE4% \Windows\StartUp
%CE5% \My Documents
%CE6% \Program Files\Accessories
%CE7% \Program Files\Communication
%CE8% \Program Files\Games
%CE11% \Windows\Start Menu\Programs
%CE12% \Windows\Start Menu\Programs\Accessories
%CE13% \Windows\Start Menu\Programs\Communications
%CE14% \Windows\Start Menu\Programs\Games
%CE15% \Windows\Fonts
%CE17% \Windows\Start Menu

Learn how to create or repack cab files without buying a program

I was going to write this, but there already is a great thread that talks about how to build cabs (old school style).

Check out this thread (and give thanks!):

neudof 03-07-2010 01:22 PM

Re: Learn how to use UC (User Customization)
 
This is AWESOME!
Thank you for creating this for all of us UC n00bs!!
This is exactly what I was looking for!
:)

Whotahn 03-09-2010 10:59 AM

Re: Learn how to use UC (User Customization)
 
Quote:

Originally Posted by neudof (Post 1612916)
This is AWESOME!
Thank you for creating this for all of us UC n00bs!!
This is exactly what I was looking for!
:)

NICE WORK!!! Oddly enough I have sahimied, I have PIM, I have SPB, I have XDA_UC, and Ziggy back up before......but never have I taken the time to learn UC. Now I am going to, you have done a great job at putting this together for peeps to understand. Looking forward to more info! kudos!c:headbang:

briggs 03-09-2010 11:20 AM

Re: Learn UC / Registry / XML Provisioning / CAB Editing {2010-03-08}
 
sticky this


All times are GMT -4. The time now is 02:39 AM.

Powered by vBulletin® ©2000 - 2024, Jelsoft Enterprises Ltd.
©2012 - PPCGeeks.com


Content Relevant URLs by vBSEO 3.6.0