Undocumented Capabilities in WMAppManifest.xml WP7

Search This thread

athompson

Senior Member
Oct 19, 2010
112
2
Looking around the IMGFS, I found some undocumented capabilities that can be used in building an app (in addition to the standard ones mentioned in the WMAppManifest.xml file).

These are the extra ones I found, in case anyone is interested (from BasePolicy.xml):
ID_CAP_RINGTONE_ADD:Allows ringtone-marketplace applications to read/write into the Ringtones directory
ID_CAP_MEDIALIB:Access to the media library - read, play-back, etc.
ID_CAP_INTEROPSERVICES:Temporary Interop Service Capability.. To be removed by feature team
ID_CAP_SIM:provides access to SIM manager API
ID_CAP_SMS:provides access to SMS API
ID_CAP_WAP:provides access to WAP API
ID_CAP_IDENTITY_USER:Allow an application to use a phone.info.dll to retrieve user properties
ID_CAP_TESTPUBLIC1:Small public test capability
ID_CAP_LOADUNSIGNEDMANAGEDDLL:Capability to load unsigned managed dll into chamber's process space
ID_CAP_LOADUNSIGNEDNATIVEDLL:Capability to load unsigned native dll into chamber's process space
ID_CAP_DEBUG:Allow an application to run in debugging enviorment.

---Edit---
I've tested each of these individually, and some work, and others don't.

ID_CAP_INTEROPSERVICES works
ID_CAP_RINGTONE_ADD works
ID_CAP_MEDIALIB works
ID_CAP_IDENTITY_USER works
ID_CAP_TESTPUBLIC1 works

ID_CAP_SIM ID doesn't work
CAP_SMS doesn't work
ID_CAP_WAP doesn't work
ID_CAP_LOADUNSIGNEDNATIVEDLL doesn't work
ID_CAP_LOADUNSIGNEDMANAGEDDLL doesn't work.

Note that even for the ones that work, Microsoft may still reject them in the app store.

I tested these by entering them in the WMAppManifest.xml in the XAP, and loading them on a windows phone device. This guy suggests that if it loads on the device, you have the permission: http://www.drdobbs.com/windows/227701092 and I think he's right. If you don't have permission, it doesn't actually load, and in every case, if it loaded it ran.
 
Last edited:

vladimir2989

Senior Member
Jun 17, 2007
459
13
31
London
ID_CAP_RINGTONE_ADD - So i guess with next update we will get Custom ringtones that can b installed from an app

off topic can some one create utility that will do something about tuch sensetive buttons, when using camera if u tuch any of then by accident it exit camera, so u have to hold phone very carefully.
also, app to lock screen rotation would be nice.... any of thous features undocumented anywhere :)

P.S sorry for unrelated message
 

athompson

Senior Member
Oct 19, 2010
112
2
I think the ID_CAP_RINGTONE_ADD feature will only be enabled for the carriers (who knows what Microsoft really has in mind, though). The Windows Phone has done a good job (or lousy job, compared to what I desire) managing permissions so they can choose what capability to give whom.

Disabling other buttons shouldn't be hard if you can get to the native API. So once the phone is jailbroken......
 

naplesbill

Senior Member
Jun 13, 2008
938
81
Actually, Microsofts own Q&A on Windows Phone 7 states to look in the Marketplace for additional ringtones. Here is an excerpt and a link:

To find a ringtone in Marketplace
1
On Start, tap the arrow to go to the App list, then tap Marketplace .

2
Press the Search button.

3
Do one of the following:


To browse a variety of ringtones, type ringtones, then tap Enter .

To look for a more particular type of ringtone, type something more specific, like Halloween ringtones.
Tip
To hear what a ringtone or alert sounds like, tap Play .

Note
Marketplace may not be available in your country or region.

http://www.microsoft.com/windowsphone/en-us/howto/wp7/start/ringtones-and-sounds.aspx
 

athompson

Senior Member
Oct 19, 2010
112
2
Actually, Microsofts own Q&A on Windows Phone 7 states to look in the Marketplace for additional ringtones. Here is an excerpt and a link:



http://www.microsoft.com/windowsphone/en-us/howto/wp7/start/ringtones-and-sounds.aspx
To me that excerpt looks like you can download ringtones from the store, not that you can create an app to download ringtones. It would appear that Microsoft has an internal application that can add ringtones (which makes sense). These permissions are enforced by the OS, not the app store (maybe the app store does too). So if they want to be able to install ringtones, they need to give their own app permission to do so.
 

amir_rafie

Senior Member
Dec 8, 2008
137
10
www.handheldusers.com
Looking around the IMGFS, I found some undocumented capabilities that can be used in building an app (in addition to the standard ones mentioned in the WMAppManifest.xml file).

These are the extra ones I found, in case anyone is interested (from BasePolicy.xml):
ID_CAP_RINGTONE_ADD:Allows ringtone-marketplace applications to read/write into the Ringtones directory
ID_CAP_MEDIALIB:Access to the media library - read, play-back, etc.
ID_CAP_INTEROPSERVICES:Temporary Interop Service Capability.. To be removed by feature team
ID_CAP_SIM:provides access to SIM manager API
ID_CAP_SMS:provides access to SMS API
ID_CAP_WAP:provides access to WAP API
ID_CAP_IDENTITY_USER:Allow an application to use a phone.info.dll to retrieve user properties
ID_CAP_TESTPUBLIC1:Small public test capability
ID_CAP_LOADUNSIGNEDMANAGEDDLL:Capability to load unsigned managed dll into chamber's process space
ID_CAP_LOADUNSIGNEDNATIVEDLL:Capability to load unsigned native dll into chamber's process space
ID_CAP_DEBUG:Allow an application to run in debugging enviorment.

Visual Studio won't let you add all of them directly, but uncompress your .xap in the build directory, and add it manually.

If anyone is thinking of doing this, the phone rejected my attempts to do so. I tried to give myself ID_CAP_LOADUNSIGNEDNATIVEDLL, but it wouldn't even load on the phone. Oh well.

But if someone use these things in an application , I think microsoft doesn`t approve it in the market place!
 

athompson

Senior Member
Oct 19, 2010
112
2
But if someone use these things in an application , I think microsoft doesn`t approve it in the market place!

Ya, not only that, they probably automatically check to make sure you don't try to use them. The phone automatically checks, too.

The main reason I put them here is because I couldn't find them documented anywhere on the web, and I thought it would be good to save someone the time if they started down the same path I did.
 
Last edited:

indiekiduk

Senior Member
Jul 8, 2005
472
4
hopefully once there is a jailbreak that turns of security/cert checking we can add these capabilities to our apps. Im particularly interested in the p/invoke capability.
 

indiekiduk

Senior Member
Jul 8, 2005
472
4
So I set up VS 2010 and tried debugging an app that had a simple DLLImport in it and ID_CAP_INTEROPSERVICES in the manifest, however it still crashed with a MethodAccessException. It was def a valid dll and method name because I took it from one of the DLLImports in the system.location .net dll decompiled with Reflector.
 

athompson

Senior Member
Oct 19, 2010
112
2
So I set up VS 2010 and tried debugging an app that had a simple DLLImport in it and ID_CAP_INTEROPSERVICES in the manifest, however it still crashed with a MethodAccessException. It was def a valid dll and method name because I took it from one of the DLLImports in the system.location .net dll decompiled with Reflector.

Interesting. If your app installed, it means you were able to get the ID_CAP_INTEROPSERVICES permission, because if the phone rejects your permission, it rejects it at install time. Maybe the DLL path was wrong, like you need to do ..\DLLNAME.dll or something.
 

walshieau

Senior Member
Nov 7, 2006
1,503
16
So I set up VS 2010 and tried debugging an app that had a simple DLLImport in it and ID_CAP_INTEROPSERVICES in the manifest, however it still crashed with a MethodAccessException. It was def a valid dll and method name because I took it from one of the DLLImports in the system.location .net dll decompiled with Reflector.

Try a relative URI path. ./DLLName.dll
 

hounsell

Senior Member
Dec 25, 2009
104
27
Sleaford, UK
On the subject of Native Applications on Windows Phone 7:

A few days ago, an Application called "Network Profile" appeared in the Samsung Zone of my Omnia 7's Marketplace.

This app is the first external app that uses native code - The Marketplace says that it "Requires access to your interop services", and on opening the XAP on my PC, I found it to contain three native COM DLLs, alongside two .NET DLLs and a further native DLL with MUIs that appear to only serve to hold resources.

I'm not sure whether this can be linked to here, so I'm going to describe the interesting parts.

It has not one, but three XMLs - the typical WMAppManifest.xml (pastebin.com/uEJWdTuA), a WMAppPRHeader.xml (pastebin.com/AVcv7JUX) which seems to have something to do with PlayReady DRM, and most interestingly WMInteropManifest.xml (pastebin.com/NCVKP6kM).

There is also the AppManifest.xaml (pastebin.com/rRrB090h).

The NetworkProfile.dll has a number of COM Imports like so:
Code:
 [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("F1113B13-AAB8-45E9-91A5-CBE568C29612")]
    internal interface INwProfInterface

The Constructor for the class containing all the COM Interfaces:

Code:
    ComBridge.RegisterComDll("NwProfDLL.dll", new Guid("4A2580BA-11A3-49AB-AC98-C30B5E72D381"));
    this.NwInterface = (INwProfInterface) new CNwProfClass();
    ComBridge.RegisterComDll("SecVersion.dll", new Guid("DFE52822-B526-4913-807A-D2AABC7BF911"));
    this.SecVerInterface = (ISecVersionInterface) new SecVersionClass();
    ComBridge.RegisterComDll("COMRilClient.dll", new Guid("A18F6B1A-924E-4787-AA82-19F98B49CF5D"));
    this.SecRILControlInterface = (ISecRilControl) new COSecRilControl();

Happy to answer any questions, and if allowed, either guide people to getting it themselves, or providing a download link to the XAP.
 

athompson

Senior Member
Oct 19, 2010
112
2
Sweet, good find! I downloaded that app. How did you get it off your phone? If you have a download link to the XAP no one will complain, either. :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Right, now that I can do links, here goes:

    The Network Profile XAP

    I'll upload a regular XAP soon, if no-one else bothers. A help for anyone else doing a spot of decompiling though:

    Windows Phone 7 RTM - GAC Assemblies

    The .NET Framework assemblies in the emulator image's GAC. Includes all the assemblies from .NET Compact Framework 3.7, Silverlight and XNA. I've had prompts for "System.Net", but it seems all it's functionality is in mscorlib, so I'm unsure why I get prompted for that in Reflector.