|
11 | 11 | set_setting, set_setting_bool, textviewer, translate_path, yesno_dialog)
|
12 | 12 | from .utils import arch, http_download, parse_version, remove_tree, store, system_os, temp_path, unzip, userspace64
|
13 | 13 | from .widevine.arm import dl_extract_widevine, extract_widevine, install_widevine_arm
|
14 |
| -from .widevine.widevine import (backup_path, has_widevinecdm, ia_cdm_path, install_cdm_from_backup, latest_available_widevine_from_repo, |
| 14 | +from .widevine.widevine import (backup_path, cdm_from_repo, has_widevinecdm, ia_cdm_path, install_cdm_from_backup, latest_available_widevine_from_repo, |
15 | 15 | latest_widevine_version, load_widevine_config, missing_widevine_libs, widevine_config_path, widevine_eula, widevinecdm_path)
|
16 | 16 | from .unicodes import compat_path
|
17 | 17 |
|
@@ -142,7 +142,7 @@ def _supports_widevine(self):
|
142 | 142 | ok_dialog(localize(30004), localize(30007, arch=arch())) # Widevine not available on this architecture
|
143 | 143 | return False
|
144 | 144 |
|
145 |
| - if arch() == 'arm64' and system_os() != 'Android' and userspace64(): |
| 145 | + if arch() == 'arm64' and system_os() not in ['Android', 'Darwin'] and userspace64(): |
146 | 146 | is_version = parse_version(addon_version(self.inputstream_addon))
|
147 | 147 | try:
|
148 | 148 | compat_version = parse_version(config.MINIMUM_INPUTSTREAM_VERSION_ARM64[self.inputstream_addon])
|
@@ -173,8 +173,8 @@ def _supports_widevine(self):
|
173 | 173 | return True
|
174 | 174 |
|
175 | 175 | @staticmethod
|
176 |
| - def _install_widevine_x86(bpath): |
177 |
| - """Install Widevine CDM on x86 based architectures.""" |
| 176 | + def _install_widevine_from_repo(bpath): |
| 177 | + """Install Widevine CDM from Google's library CDM repository""" |
178 | 178 | cdm = latest_available_widevine_from_repo()
|
179 | 179 | cdm_version = cdm.get('version')
|
180 | 180 |
|
@@ -219,8 +219,8 @@ def install_widevine(self):
|
219 | 219 | if not widevine_eula():
|
220 | 220 | return False
|
221 | 221 |
|
222 |
| - if 'x86' in arch(): |
223 |
| - result = self._install_widevine_x86(backup_path()) |
| 222 | + if cdm_from_repo(): |
| 223 | + result = self._install_widevine_from_repo(backup_path()) |
224 | 224 | else:
|
225 | 225 | result = install_widevine_arm(backup_path())
|
226 | 226 | if not result:
|
@@ -307,7 +307,7 @@ def _update_widevine(self):
|
307 | 307 | if not wv_config:
|
308 | 308 | log(3, 'Widevine config missing. Could not determine current version, forcing update.')
|
309 | 309 | current_version = '0'
|
310 |
| - elif 'x86' in arch(): |
| 310 | + elif cdm_from_repo(): |
311 | 311 | component = 'Widevine CDM'
|
312 | 312 | current_version = wv_config['version']
|
313 | 313 | latest_version = latest_available_widevine_from_repo().get('version')
|
@@ -343,9 +343,9 @@ def _check_widevine(self):
|
343 | 343 | ok_dialog(localize(30001), localize(30031)) # An update of Widevine is required
|
344 | 344 | return self.install_widevine()
|
345 | 345 |
|
346 |
| - if 'x86' in arch(): # check that widevine arch matches system arch |
| 346 | + if cdm_from_repo(): # check that widevine arch matches system arch |
347 | 347 | wv_config = load_widevine_config()
|
348 |
| - if config.WIDEVINE_ARCH_MAP_X86[arch()] != wv_config['arch']: |
| 348 | + if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config['arch']: |
349 | 349 | log(4, 'Widevine/system arch mismatch. Reinstall is required.')
|
350 | 350 | ok_dialog(localize(30001), localize(30031)) # An update of Widevine is required
|
351 | 351 | return self.install_widevine()
|
@@ -454,7 +454,7 @@ def info_dialog(self):
|
454 | 454 | else:
|
455 | 455 | wv_updated = 'Never'
|
456 | 456 | text += localize(30821, version=self._get_lib_version(widevinecdm_path()), date=wv_updated) + '\n'
|
457 |
| - if arch() in ('arm', 'arm64'): # Chrome OS version |
| 457 | + if arch() == 'arm' or arch() == 'arm64' and system_os() != 'Darwin': # Chrome OS version |
458 | 458 | wv_cfg = load_widevine_config()
|
459 | 459 | if wv_cfg:
|
460 | 460 | text += localize(30822, name=wv_cfg['hwidmatch'].split()[0].lstrip('^'), version=wv_cfg['version']) + '\n'
|
@@ -485,7 +485,7 @@ def rollback_libwv(self):
|
485 | 485 | installed_version = load_widevine_config()['version']
|
486 | 486 | del versions[versions.index(installed_version)]
|
487 | 487 |
|
488 |
| - if 'x86' in arch(): |
| 488 | + if cdm_from_repo(): |
489 | 489 | show_versions = versions
|
490 | 490 | else:
|
491 | 491 | show_versions = []
|
|
0 commit comments