From 7bcc79d859a21e760e5e553128c9c57d8dd7b839 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D1=82=D0=BE=D0=BD=20=D0=A2=D1=80=D0=BE=D1=88?= =?UTF-8?q?=D0=B8=D0=BD?= Date: Mon, 10 Aug 2026 00:40:12 +0300 Subject: [PATCH] add 'Proactive UICC' pill to Card reader tab with event list display from SET UP EVENT LIST --- index.html | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 2e98088..2d9131b 100644 --- a/index.html +++ b/index.html @@ -563,8 +563,12 @@ + + - @@ -3056,10 +3061,11 @@ function pysimSwitchSubtab(name) { btn.classList.toggle('text-gray-700', !isActive); btn.classList.toggle('dark:text-slate-300', !isActive); }); - ['cmd', 'apdu', 'files', 'custom'].forEach(s => { + ['cmd', 'apdu', 'files', 'custom', 'proactive'].forEach(s => { document.getElementById('pysim-sub-' + s).classList.toggle('hidden', s !== name); }); if (name === 'custom') pysimCustomRender(); + if (name === 'proactive') pysimEventsRender(); } function pysimCmdKeydown(e) { @@ -3527,6 +3533,46 @@ function pysimFsResetEdit() { document.getElementById('pysim-fs-cancel-btn').classList.add('hidden'); } +// ===== proactive UICC events ===== +const EVENT_NAMES = { + 0x00: 'MT call', 0x01: 'Call connected', 0x02: 'Call disconnected', + 0x03: 'Location status', 0x04: 'User activity', 0x05: 'Idle screen available', + 0x06: 'Card reader status', 0x07: 'Language selection', + 0x08: 'Browser termination', 0x09: 'Data available', + 0x0A: 'Channel status', 0x0B: 'Access Technology Change', + 0x0C: 'Display parameters changed', 0x0D: 'Local connection', + 0x0E: 'Network Search Mode Change', 0x0F: 'Browsing status', + 0x10: 'Frames Information Change', 0x11: 'I-WLAN Access Status', + 0x12: 'Network Rejection', 0x13: 'HCI Connectivity', + 0x14: 'Change of UICC Access', 0x15: 'CSG Cell Change', + 0x16: 'Contactless state request', 0x17: 'Profile Container', + 0x18: 'LTE D2D Discovery Monitoring', 0x19: 'LTE D2D Communication Monitoring', + 0x1A: 'LTE D2D Announcement Response', 0x1B: 'LTE D2D Revocation', + 0x1C: 'LTE D2D Application Port', 0x1D: 'LTE D2D Security Recovery', + 0x1E: 'Off-net Emergency Call', 0x1F: 'ECall Over IMS', + 0x20: 'EARFCN Update', 0x21: 'SCEF Channel Status', +}; + +async function pysimEventsRender() { + const el = document.getElementById('pysim-event-list'); + el.innerHTML = '' + t('Loading...') + ''; + try { + const events = await pysimFetch('/api/events'); + if (!events || !events.length) { + el.innerHTML = '' + t('No events configured.') + ''; + return; + } + let html = ''; + events.forEach(e => { + const name = EVENT_NAMES[e] || ('Event 0x' + e.toString(16).padStart(2, '0').toUpperCase()); + html += '
' + e.toString(16).padStart(2, '0').toUpperCase() + ' ' + esc(name) + '
'; + }); + el.innerHTML = html; + } catch (e) { + el.innerHTML = 'Error: ' + esc(e.message) + ''; + } +} + // ===== custom files ===== let pysimCustomFiles = []; @@ -3749,6 +3795,9 @@ const LANG_RU = { 'Verifying against pySim reference...': 'Сверка с эталоном pySim...', 'Verify vs pySim': 'Проверить в pySim', 'Send to Card': 'Отправить на карту', + 'Proactive UICC': 'Проактивный UICC', + 'Events that the card monitors (SET UP EVENT LIST):': 'События, отслеживаемые картой (SET UP EVENT LIST):', + 'No events configured.': 'Нет настроенных событий.', }; let currentLang = 'en';