19

The documentation for the android DRM package says "Common uses of the DRM API include ... Determining which DRM plug-ins (agents) are installed on a device".

The only method I can find in the DRM package for doing that is DrmManagerClient.getAvailableDrmEngines(). This method does work, in the sense that it returns a string array containing names of DRM agents. Is that what the above statement about determining which plug-ins are installed is referring to?

However, that list, at least in some cases, completely contradicts the results of the newer method MediaDrm.isCryptoSchemeSupported(), which is in the android.Media package.

Examples:

HTC Desire 550 running Android 7:

  • getAvailableDrmEngines():
    • Playready DRM plug-in
    • DriveActivator plug-in
    • MirrorLink plug-in
    • OMA HTC
  • isCryptoSchemeSupported():
    • Common PSSH / CENC
    • WideVine

Samsung SM-G870A running Android 5.1.1:

  • getAvailableDrmEngines():
    • Widevine DRM plug-in
    • OMA V1 Forward Lock
    • (blank plug-in name)
    • Playready plug-in
    • TZ Playready plug-in
  • isCryptoSchemeSupported():
    • Common PSSH / CENC
    • WideVine

One developer, who has a very popular DRM-related tool in the Google Play store, kindly told me that he would consider the DrmManagerClient approach outdated / not commonly used anymore.

That being the case, it makes sense to use MediaDrm.isCryptoSchemeSupported() where possible, i.e. API level 18 or later. But MediaDrm doesn't offer a way to get a list of supported crypto schemes / agents / plug-ins; you just have to try the ones you're interested in. You could try putting known crypto scheme UUIDs from the DASHIF list into your code, and try them all. But that list will likely change over the years.

Which brings us back to the original question:

How do you get an (accurate) list of DRM plug-ins installed on a device?

Related questions feeding into that, for the purpose of clarifying the main question:

  • Is the original claim in the documentation about this referring to DrmManagerClient.getAvailableDrmEngines(), or something else?
  • If it's referring to DrmManagerClient.getAvailableDrmEngines(), but the latter gives wrong results on newer devices, why isn't it deprecated? Is it a widespread bug in manufacturers' implementations of Android?
    • Or is it possible that by "supported crypto schemes" they really do mean something different from (and independent of) installed DRM engines / agents? Sure, the concepts of DRM plug-in and encryption scheme are technically distinct, yet the answers seem to cover the same territory. (And the MediaDrm docs suggest that "DRM scheme" and "crypto scheme" are being used interchangeably: "It accesses the DRM-scheme-identifying UUID, typically from metadata in the content, and uses this UUID to construct an instance of a MediaDrm object that is able to support the DRM scheme required by the content. Crypto schemes are assigned 16 byte UUIDs. The method isCryptoSchemeSupported(UUID) can be used to query if a given scheme is supported on the device.") If these two methods really give independent information that are both correct, then how can the HTC support WideVine crypto scheme without a WideVine DRM plug-in available?
  • If DrmManagerClient.getAvailableDrmEngines() isn't reliable, is there another way to get a list, other than trying all the UUIDs you can find?
LarsH
  • 27,481
  • 8
  • 94
  • 152
  • 1
    It would be great to see a definitive answer to this question, but I suspect that your note "Sure, the concepts of DRM plug-in and encryption scheme are technically distinct, yet the answers seem to cover the same territory" is probably a good summary - the mechanisms overlap but are independent so the combined view may not have been rationalised. Another twist is that most DRM's have different levels, and there may be a distinction between the different levels, e.g. whether they are tied to a HW key, which affects the answers. – Mick Feb 12 '18 at 11:38

0 Answers0