Android手机上的WideVine认证DRM问题
创始人
2024-10-10 15:00:34
0
  1. 检查设备安全级别

在AndroidManifest.xml文件中添加以下权限:



使用以下代码检查设备的安全级别是否符合要求:

MediaDrm mediaDrm = new MediaDrm(WIDEVINE_UUID);
String securityLevel = mediaDrm.getPropertyString("securityLevel");
if (securityLevel.equals("L1")) {
    // Device is Widevine L1 certified
} else {
    // Device is NOT Widevine L1 certified
}
  1. 检查设备是否处于compliant状态

使用以下代码检查设备是否处于compliant状态:

MediaDrm mediaDrm = new MediaDrm(WIDEVINE_UUID);
String provider = mediaDrm.getPropertyString("vendor");
if (provider.equals("widevine")) {
    String drmVersion = mediaDrm.getPropertyString("version");
    int level = Integer.parseInt(drmVersion.split("\\.")[0]);
    if (level >= 6) {
        String status = mediaDrm.getPropertyString("com.widevine.alpha.drm.info");
        if (status.contains("Compliant")) {
            // Device is compliant
        } else {
            // Device is NOT compliant
        }
    }
}
  1. 检查是否安装了正确的Widevine CDM

使用以下代码检查设备是否安装了正确的Widevine CDM:

private boolean isWidevineCDMInstalled(Context context) {
    PackageManager manager = context.getPackageManager();
    List apps = manager.getInstalledApplications(PackageManager.GET_META_DATA);
    for (ApplicationInfo app : apps) {
        if (app.packageName.equals("com.google.android.exoplayer2.demo")) {
            try {
                PackageInfo packageInfo = manager.getPackageInfo(app.packageName, PackageManager.GET_ACTIVITIES);
                String path = packageInfo.applicationInfo.dataDir + "/widevine";
                File file = new File(path);
                if (file.exists()) {
                    // Widevine CDM is installed
                    return true;
                }
            } catch (PackageManager.NameNotFoundException e) {
                e.printStackTrace();
            }
        }
    }
    return false;
}

如果Widevine CDM未正确安装,请按照以下步骤解决问题:

  1. 在app的build.gradle中添加以下依赖项:
implementation 'com.google.android.exoplayer:exoplayer-core:[version_number]'
  1. 在设备上安装Widevine CDM
Default

相关内容

热门资讯

透视游戏"拱趴大菠萝... 《透视游戏"拱趴大菠萝怎么开挂"详细辅助AI教程(本然是真的有挂)》 拱趴大菠萝怎么开挂软件透明挂更...
透视教程"hhpok... 此外,数据分析德州(hhpoker是正品吗)辅助神器app还具备辅助透视行为开挂功能,通过对客户hh...
透视攻略"wpk透视... 《透视攻略"wpk透视是真的假的"详细辅助详细教程(切实真的是有挂)》 wpk透视是真的假的软件透明...
透视教学"wepok... 透视教学"wepoker买脚本靠谱吗"详细辅助解密教程(最初真的是有挂);1.wepoker买脚本靠...
透视脚本"来玩app... 透视脚本"来玩app 德州 辅助"详细辅助2025版教程(一向有挂);建议优先通过来玩app 德州 ...
透视有挂"来玩app... 透视有挂"来玩app破解"详细辅助德州教程(起初是真的有挂)准备好在来玩app破解ia的高塔上攀登,...
透视模拟器"wepo... 透视模拟器"wepoker透视辅助下载"详细辅助力荐教程(原生真的是有挂),支持语音通讯、好友开房及...
透视最新"wpk辅助... 透视最新"wpk辅助购买"详细辅助技巧教程(一直真的是有挂);玩家必备必赢加哟《136704302》...
透视苹果版"xpok... 透视苹果版"xpoker辅助怎么用"详细辅助第三方教程(素来是真的有挂)是一款可以让一直输的玩家,快...
透视玄学"hhpok... 透视玄学"hhpoker怎么破解"详细辅助揭秘攻略(一向是有挂)是由北京得hhpoker怎么破解黑科...