So, I stayed up till 6AM MST as promised.
I wasn’t successful in creating that dream backup application this time around, but as Buckminster Fuller once said: “There is no such thing as a failed experiment, only experiments with unexpected outcomes”.
So what happened? I made some assumptions that weren’t in fact true. This left me poking, prodding, and fighting Windows Phone’s OMA Client Provisioning layer all night. (I totally get why the XDA Developers folks keep playing with this stuff now.)
Here are some technical notes in no real order:
My ARM7i compiled DLLs worked nicely. Hurray for miracles.
Using Samsung’s LaunchExe function was pretty simple, for bouncing out of Least Privileged Chamber (LPC).
Rapiconfig.exe, the configuration tool that executes provisioning XML, blows. By blows, I mean it’s poorly written and requires certain stars and planets to be aligned in a particular manner to work correctly. For example, I wasted hours trying to feed it valid XML to later learn from XDA’s Heathcliff74 that provisioning XML must be in Unicode (UTF-16). Never mind the actual encoding specified in the XML header or using a proper damn XML parser. Also, the attribute and element values are all case-sensitive. God only knows what would happen if you introduce a single blank line.
According to MSDN/Technet documentation for both WM6 and Windows Embedded Compact 7 – of which Windows Phone is supposedly built upon – the provisioning magic on the phone supports a parameter name of "SelfRegister”. This was supposed to tell the OS that I want to (COM) register my library. This should have then triggered a call into DllRegisterServer, executing my code. I tried this with both TCB signed and unsigned code to no avail. Maybe I screwed something up here? I suspect this is broken for valid security reasons.
My phone is very unstable. At times, simple things like COM registration were failing with security errors. And at one time I was able to deploy XAPs with my phone locked. Scary. Reboots fixed all these issues temporarily.