diff --git a/script.module.inputstreamhelper/README.md b/script.module.inputstreamhelper/README.md index 5f857e33d..58a0dbe05 100644 --- a/script.module.inputstreamhelper/README.md +++ b/script.module.inputstreamhelper/README.md @@ -90,6 +90,9 @@ Please report any issues or bug reports on the [GitHub Issues](https://github.co This module is licensed under the **The MIT License**. Please see the [LICENSE.txt](LICENSE.txt) file for details. ## Releases +### v0.8.1 (2025-09-22) +- Fix Widevine CDM installation on ARM hardware (@mediaminister) + ### v0.8.0 (2025-09-19) - Fix Widevine CDM installation on Windows, Linux and Macintosh (@mediaminister) - Add support for LG webOS (@Uukrull) diff --git a/script.module.inputstreamhelper/addon.xml b/script.module.inputstreamhelper/addon.xml index bd350e27c..70ba6744b 100644 --- a/script.module.inputstreamhelper/addon.xml +++ b/script.module.inputstreamhelper/addon.xml @@ -1,5 +1,5 @@ - + @@ -25,6 +25,9 @@ Jednostavan Kodi modul koji olakšava razvijanje dodataka koji se temelje na InputStream dodatku i reprodukciji DRM zaštićenog sadržaja. Простой модуль для Kodi, который облегчает жизнь разработчикам дополнений, с использованием InputStream дополнений и воспроизведения DRM контента. +v0.8.1 (2025-09-22) +- Fix Widevine CDM installation on ARM hardware + v0.8.0 (2025-09-19) - Fix Widevine CDM installation on Windows, Linux and Macintosh - Add support for LG webOS diff --git a/script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py b/script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py index 4b3994b1f..65245b78d 100644 --- a/script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py +++ b/script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py @@ -141,7 +141,7 @@ def _supports_widevine(self): ok_dialog(localize(30004), localize(30007, arch=arch())) # Widevine not available on this architecture return False - if arch() == 'arm64' and system_os() not in ['Android', 'Darwin'] and userspace64(): + if arch() == 'arm64' and system_os() not in ['Android', 'Darwin', 'Windows'] and userspace64(): is_version = parse_version(addon_version(self.inputstream_addon)) try: compat_version = parse_version(config.MINIMUM_INPUTSTREAM_VERSION_ARM64[self.inputstream_addon]) @@ -270,11 +270,12 @@ def remove_widevine(): """Removes Widevine CDM""" if has_widevinecdm(): widevinecdm = widevinecdm_path() - log(0, 'Removed Widevine CDM at {path}', path=widevinecdm) - delete(widevinecdm) - notification(localize(30037), localize(30052)) # Success! Widevine successfully removed. - set_setting('last_modified', '0.0') - return True + if widevinecdm: + log(0, 'Removed Widevine CDM at {path}', path=widevinecdm) + delete(widevinecdm) + notification(localize(30037), localize(30052)) # Success! Widevine successfully removed. + set_setting('last_modified', '0.0') + return True notification(localize(30004), localize(30053)) # Error. Widevine CDM not found. return False @@ -361,7 +362,13 @@ def _check_widevine(self): if cdm_from_repo(): # check that widevine arch matches system arch wv_config = load_widevine_config() - if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config['platforms'][0]['arch']: + if wv_config.get('accept_arch'): + wv_config_arch = wv_config.get('accept_arch')[0] + elif wv_config.get('platforms'): + wv_config_arch = wv_config.get('platforms')[0].get('arch') + else: + wv_config_arch = wv_config.get('arch') + if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config_arch: log(4, 'Widevine/system arch mismatch. Reinstall is required.') ok_dialog(localize(30001), localize(30031)) # An update of Widevine is required return self.install_widevine() diff --git a/script.module.inputstreamhelper/lib/inputstreamhelper/config.py b/script.module.inputstreamhelper/lib/inputstreamhelper/config.py index b85bc6af4..ce2ae365d 100644 --- a/script.module.inputstreamhelper/lib/inputstreamhelper/config.py +++ b/script.module.inputstreamhelper/lib/inputstreamhelper/config.py @@ -26,6 +26,7 @@ ARCH_MAP = { 'aarch64': 'arm64', 'aarch64_be': 'arm64', + 'ARM64': 'arm64', 'AMD64': 'x86_64', 'armv7': 'arm', 'armv8': 'arm', @@ -85,12 +86,11 @@ # To keep the Chrome OS ARM(64) hardware ID list up to date, the following resources can be used: # https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices # https://chromiumdash.appspot.com/serving-builds?deviceCategory=Chrome%20OS -# Last updated: 2024-10-13 -# current Chrome OS version: 16002.44.0, Widevine version: 4.10.2662.3 +# Last updated: 2025-09-21 +# current Chrome OS version: 16328.65.0, Widevine version: 4.10.2662.3 CHROMEOS_RECOVERY_ARM_BNAMES = [ 'bob', # no longer updated, still latest wv. last: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15509.81.0_bob_recovery_stable-channel_mp-v2.bin.zip 'elm', # probably 64bit soon. current: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15886.44.0_elm_recovery_stable-channel_mp-v6.bin.zip - 'hana', # probably 64bit soon. current: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15964.59.0_hana_recovery_stable-channel_mp-v11.bin.zip 'kevin', # no longer updated, still latest wv. last: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15509.81.0_kevin_recovery_stable-channel_mp-v2.bin.zip 'scarlet', # no longer updated, still latest wv. last: https://dl.google.com/dl/edgedl/chromeos/recovery/chromeos_15509.81.0_scarlet_recovery_stable-channel_mp-v8.bin.zip ] @@ -99,8 +99,11 @@ 'asurada', 'cherry', 'corsola', + 'geralt', + 'hana', 'jacuzzi', 'kukui', + 'staryu', 'strongbad', 'trogdor', ] diff --git a/script.module.inputstreamhelper/lib/inputstreamhelper/utils.py b/script.module.inputstreamhelper/lib/inputstreamhelper/utils.py index 22673dc92..c7954f08b 100644 --- a/script.module.inputstreamhelper/lib/inputstreamhelper/utils.py +++ b/script.module.inputstreamhelper/lib/inputstreamhelper/utils.py @@ -366,6 +366,18 @@ def userspace64(): return struct.calcsize('P') * 8 == 64 +def elfbinary64(path): + """To check if an ELF binary is 64bit or 32bit""" + with open(path, 'rb') as f: + f.seek(4) # skip 0x7F 'E' 'L' 'F' + b = f.read(1) + if b == b'\x01': + return False + if b == b'\x02': + return True + raise ValueError('Not a valid ELF class') + + def hardlink(src, dest): """Hardlink a file when possible, copy when needed""" if exists(dest): diff --git a/script.module.inputstreamhelper/lib/inputstreamhelper/widevine/arm.py b/script.module.inputstreamhelper/lib/inputstreamhelper/widevine/arm.py index 70709e0f2..26e4d1d35 100644 --- a/script.module.inputstreamhelper/lib/inputstreamhelper/widevine/arm.py +++ b/script.module.inputstreamhelper/lib/inputstreamhelper/widevine/arm.py @@ -7,7 +7,7 @@ from .. import config from ..kodiutils import browsesingle, localize, log, ok_dialog, open_file, progress_dialog, yesno_dialog -from ..utils import diskspace, http_download, http_get, parse_version, sizeof_fmt, system_os, update_temp_path, userspace64 +from ..utils import diskspace, elfbinary64, http_download, http_get, parse_version, sizeof_fmt, system_os, update_temp_path, userspace64 from .arm_chromeos import ChromeOSImage from .arm_lacros import cdm_from_lacros, install_widevine_arm_lacros @@ -138,11 +138,19 @@ def extract_widevine_chromeos(backup_path, image_path, image_version): progress = progress_dialog() progress.create(heading=localize(30043), message=localize(30044)) # Extracting Widevine CDM + filename = config.WIDEVINE_CDM_FILENAME[system_os()] + extract_path = os.path.join(backup_path, image_version) + extracted = ChromeOSImage(image_path, progress=progress).extract_file( - filename=config.WIDEVINE_CDM_FILENAME[system_os()], - extract_path=os.path.join(backup_path, image_version)) + filename=filename, + extract_path=extract_path) - if not extracted: + if extracted: + if not userspace64() == elfbinary64(os.path.join(extract_path, filename)): + log(4, 'Widevine CDM userspace mismatch. Please check Chrome OS Recovery image userspace') + progress.close() + return False + else: log(4, 'Extracting widevine from the zip failed!') progress.close() return False