Perl Module to check OMA DRA support for a mobile device

Last Month in one of articles, I covered a topic on how to get the screen size of a mobile device, someone is wondering about how to check the Open Mobile Alliance (OMA) Digital Rights Management (DRM) support.

To check Forward-Lock, you need to ensure that the following content-type is accepted by the device:

  • application/vnd.oma.drm.message

To check Combined Delivery, you need to ensure that the following content-type is accepted by the device:

  • application/vnd.oma.drm.message
  • application/vnd.oma.drm.rights+xml

To check Separate Delivery, you need to ensure that the following content-type is accepted by the device:

  • application/vnd.oma.drm.rights+xml
  • application/vnd.oma.drm.rights+wbxml
  • application/vnd.oma.drm.content

One more thing is that the device may support (for example) Combined Delivery DRM, but you may not be able to use that in MMS. Thus, further check on “MmsCcppAccept” tag of the User Agent Profile (UAProf) to ensure that it is supported.

Some may wonder why I don’t just check the “DrmClass” tag instead. Well, you can, however, during my investigation, I found out that some mobile phone manufacturers do not include this in the UAProf. Thus, it is much safer to check the DRM’s content-types instead.

I have further modified the previous Mobile::UserAgentProfile library and include this checking into that. I have also make changes to the method calling so that I can hold the profile in memory rather than load the profile from file every time I need to check on the UAProf.

INSTALL

To install, do the following:

perl Makefile.PL
make
make install


The following a a perldoc of this module:

SYNOPSIS


 use Mobile::UserAgentProfile;
 my $uaprof= new Mobile::UserAgentProfile();

DESCRIPTION
This module will retrieve the screen size of the device from the UAProf.

METHODS

new, this method is used to create the UserAgentProfile object. Initial call will be slow if the DefaultCacheDir directory is not found. If DefaultCacheDir is not found, this module will retrieve a list of UAProf from the Internet. The current list is available at here .

Usage:


my $uaprof= new Mobile::UserAgentProfile();

my $uaprof= new Mobile::UserAgentProfile(
     DefaultUrl=>"http://www.artofmobile.com/uaprof/",
     UserAgent=>"UserAgentProfile Grabber",
     DefaultCacheDir=>"UAGrabber"
);

setDevice, this method will retrieve device profile on the UAProf URL. If the UAProf is not found in the DefaultCacheDir directory, this module will retrieve the UAProf from the given url. If the UAProf is found, it will retrieve from DefaultCacheDir directory.

Usage:


     $uaprof->setSize(HTTP_X_WAP_PROFILE=>$HTTP_X_WAP_PROFILE);

Example of accepted value for HTTP_X_WAP_PROFILE:

http://nds1.nds.nokia.com/uaprof/N6070r100.xml
"http://wap.sonyericsson.com/UAprof/K700iR201.xml", "1-bgyyJlyTUYSczJUKDdFYyw=="

getSize, this method will retrieve the size of the device.

Usage:


   my $size= $uaprof->getSize();

isOmaDrmForwardLock, this method will retrieve to see whether it supports the following content-type:

  • application/vnd.oma.drm.message

Usage:


   my $support= $uaprof->isOmaDrmForwardLock();

isOmaDrmCombinedDelivery, this method will retrieve to see whether it supports the following content-type:

  • application/vnd.oma.drm.message
  • application/vnd.oma.drm.rights+xml

Usage:


   my $support= $uaprof->isOmaDrmCombinedDelivery();

isOmaDrmSeparateDelivery, this method will retrieve to see whether it supports the following content-type:

  • application/vnd.oma.drm.rights+xml
  • application/vnd.oma.drm.rights+wbxml
  • application/vnd.oma.drm.content

Usage:


   my $support= $uaprof->isOmaDrmSeparateDelivery();

You can download the package at Mobile-UserAgentProfile-0.10.tgz