Skip to content

Commit f25abcf

Browse files
committed
[script.module.inputstreamhelper] 0.8.1
1 parent a072684 commit f25abcf

File tree

6 files changed

+51
-15
lines changed

6 files changed

+51
-15
lines changed

script.module.inputstreamhelper/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ Please report any issues or bug reports on the [GitHub Issues](https://github.co
9090
This module is licensed under the **The MIT License**. Please see the [LICENSE.txt](LICENSE.txt) file for details.
9191

9292
## Releases
93+
### v0.8.1 (2025-09-22)
94+
- Fix Widevine CDM installation on ARM hardware (@mediaminister)
95+
9396
### v0.8.0 (2025-09-19)
9497
- Fix Widevine CDM installation on Windows, Linux and Macintosh (@mediaminister)
9598
- Add support for LG webOS (@Uukrull)

script.module.inputstreamhelper/addon.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.0" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
2+
<addon id="script.module.inputstreamhelper" name="InputStream Helper" version="0.8.1" provider-name="emilsvennesson, dagwieers, mediaminister, horstle">
33
<requires>
44
<!--py3 compliant-->
55
<import addon="xbmc.python" version="3.0.0"/>
@@ -25,6 +25,9 @@
2525
<description lang="hr_HR">Jednostavan Kodi modul koji olakšava razvijanje dodataka koji se temelje na InputStream dodatku i reprodukciji DRM zaštićenog sadržaja.</description>
2626
<description lang="ru_RU">Простой модуль для Kodi, который облегчает жизнь разработчикам дополнений, с использованием InputStream дополнений и воспроизведения DRM контента.</description>
2727
<news>
28+
v0.8.1 (2025-09-22)
29+
- Fix Widevine CDM installation on ARM hardware
30+
2831
v0.8.0 (2025-09-19)
2932
- Fix Widevine CDM installation on Windows, Linux and Macintosh
3033
- Add support for LG webOS

script.module.inputstreamhelper/lib/inputstreamhelper/__init__.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def _supports_widevine(self):
141141
ok_dialog(localize(30004), localize(30007, arch=arch())) # Widevine not available on this architecture
142142
return False
143143

144-
if arch() == 'arm64' and system_os() not in ['Android', 'Darwin'] and userspace64():
144+
if arch() == 'arm64' and system_os() not in ['Android', 'Darwin', 'Windows'] and userspace64():
145145
is_version = parse_version(addon_version(self.inputstream_addon))
146146
try:
147147
compat_version = parse_version(config.MINIMUM_INPUTSTREAM_VERSION_ARM64[self.inputstream_addon])
@@ -270,11 +270,12 @@ def remove_widevine():
270270
"""Removes Widevine CDM"""
271271
if has_widevinecdm():
272272
widevinecdm = widevinecdm_path()
273-
log(0, 'Removed Widevine CDM at {path}', path=widevinecdm)
274-
delete(widevinecdm)
275-
notification(localize(30037), localize(30052)) # Success! Widevine successfully removed.
276-
set_setting('last_modified', '0.0')
277-
return True
273+
if widevinecdm:
274+
log(0, 'Removed Widevine CDM at {path}', path=widevinecdm)
275+
delete(widevinecdm)
276+
notification(localize(30037), localize(30052)) # Success! Widevine successfully removed.
277+
set_setting('last_modified', '0.0')
278+
return True
278279
notification(localize(30004), localize(30053)) # Error. Widevine CDM not found.
279280
return False
280281

@@ -361,7 +362,13 @@ def _check_widevine(self):
361362

362363
if cdm_from_repo(): # check that widevine arch matches system arch
363364
wv_config = load_widevine_config()
364-
if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config['platforms'][0]['arch']:
365+
if wv_config.get('accept_arch'):
366+
wv_config_arch = wv_config.get('accept_arch')[0]
367+
elif wv_config.get('platforms'):
368+
wv_config_arch = wv_config.get('platforms')[0].get('arch')
369+
else:
370+
wv_config_arch = wv_config.get('arch')
371+
if config.WIDEVINE_ARCH_MAP_REPO[arch()] != wv_config_arch:
365372
log(4, 'Widevine/system arch mismatch. Reinstall is required.')
366373
ok_dialog(localize(30001), localize(30031)) # An update of Widevine is required
367374
return self.install_widevine()

script.module.inputstreamhelper/lib/inputstreamhelper/config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
ARCH_MAP = {
2727
'aarch64': 'arm64',
2828
'aarch64_be': 'arm64',
29+
'ARM64': 'arm64',
2930
'AMD64': 'x86_64',
3031
'armv7': 'arm',
3132
'armv8': 'arm',
@@ -85,12 +86,11 @@
8586
# To keep the Chrome OS ARM(64) hardware ID list up to date, the following resources can be used:
8687
# https://www.chromium.org/chromium-os/developer-information-for-chrome-os-devices
8788
# https://chromiumdash.appspot.com/serving-builds?deviceCategory=Chrome%20OS
88-
# Last updated: 2024-10-13
89-
# current Chrome OS version: 16002.44.0, Widevine version: 4.10.2662.3
89+
# Last updated: 2025-09-21
90+
# current Chrome OS version: 16328.65.0, Widevine version: 4.10.2662.3
9091
CHROMEOS_RECOVERY_ARM_BNAMES = [
9192
'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
9293
'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
93-
'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
9494
'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
9595
'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
9696
]
@@ -99,8 +99,11 @@
9999
'asurada',
100100
'cherry',
101101
'corsola',
102+
'geralt',
103+
'hana',
102104
'jacuzzi',
103105
'kukui',
106+
'staryu',
104107
'strongbad',
105108
'trogdor',
106109
]

script.module.inputstreamhelper/lib/inputstreamhelper/utils.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,18 @@ def userspace64():
366366
return struct.calcsize('P') * 8 == 64
367367

368368

369+
def elfbinary64(path):
370+
"""To check if an ELF binary is 64bit or 32bit"""
371+
with open(path, 'rb') as f:
372+
f.seek(4) # skip 0x7F 'E' 'L' 'F'
373+
b = f.read(1)
374+
if b == b'\x01':
375+
return False
376+
if b == b'\x02':
377+
return True
378+
raise ValueError('Not a valid ELF class')
379+
380+
369381
def hardlink(src, dest):
370382
"""Hardlink a file when possible, copy when needed"""
371383
if exists(dest):

script.module.inputstreamhelper/lib/inputstreamhelper/widevine/arm.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from .. import config
99
from ..kodiutils import browsesingle, localize, log, ok_dialog, open_file, progress_dialog, yesno_dialog
10-
from ..utils import diskspace, http_download, http_get, parse_version, sizeof_fmt, system_os, update_temp_path, userspace64
10+
from ..utils import diskspace, elfbinary64, http_download, http_get, parse_version, sizeof_fmt, system_os, update_temp_path, userspace64
1111
from .arm_chromeos import ChromeOSImage
1212
from .arm_lacros import cdm_from_lacros, install_widevine_arm_lacros
1313

@@ -138,11 +138,19 @@ def extract_widevine_chromeos(backup_path, image_path, image_version):
138138
progress = progress_dialog()
139139
progress.create(heading=localize(30043), message=localize(30044)) # Extracting Widevine CDM
140140

141+
filename = config.WIDEVINE_CDM_FILENAME[system_os()]
142+
extract_path = os.path.join(backup_path, image_version)
143+
141144
extracted = ChromeOSImage(image_path, progress=progress).extract_file(
142-
filename=config.WIDEVINE_CDM_FILENAME[system_os()],
143-
extract_path=os.path.join(backup_path, image_version))
145+
filename=filename,
146+
extract_path=extract_path)
144147

145-
if not extracted:
148+
if extracted:
149+
if not userspace64() == elfbinary64(os.path.join(extract_path, filename)):
150+
log(4, 'Widevine CDM userspace mismatch. Please check Chrome OS Recovery image userspace')
151+
progress.close()
152+
return False
153+
else:
146154
log(4, 'Extracting widevine from the zip failed!')
147155
progress.close()
148156
return False

0 commit comments

Comments
 (0)