From 0f69c6d588d0b78c5f30b9e9840199d02aad74a0 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: Fri, 2 Oct 2026 00:53:00 +0300 Subject: [PATCH] Fix the card ETSI release lookup: the CE tag is raw hex The expanded registry returns the package version as two bytes of hex (010C) and the ELF rows format it with ramFmtVersion (010C -> 1.12) - the release lookup used the raw value, so the live card showed "ETSI release: unknown (uicc.toolkit 010C)". cardEtsiRelease formats it the same way (a non-4-hex value passes through unchanged) and the tests now use the raw vectors the card actually returns. - sw cache simple-v355. --- frontend/index.html | 7 +++++-- frontend/sw.js | 2 +- frontend/tests/ram.test.js | 16 ++++++++++------ 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 27c16df..3bd3996 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -9458,8 +9458,11 @@ function ramElfVersionHint(elfForm) { function cardEtsiRelease(elfs) { const tk = (elfs || []).find(e => (e.aid || '').toUpperCase() === UICC_TOOLKIT_AID); if (!tk) return null; - const v = String(tk.version || '').trim(); - if (!v) return { release: '', basis: '' }; + const raw = String(tk.version || '').trim(); + if (!raw) return { release: '', basis: '' }; + // the CE tag is raw hex (010C = 1.12): ramFmtVersion is the same + // formatter the ELF rows use; a non-4-hex value passes through unchanged + const v = ramFmtVersion(raw); return { release: ETSI_TOOLKIT_RELEASE[v] || '', basis: 'uicc.toolkit ' + v }; } diff --git a/frontend/sw.js b/frontend/sw.js index 45429a4..01acac4 100644 --- a/frontend/sw.js +++ b/frontend/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'simple-v354'; +const CACHE = 'simple-v355'; const URLS = [ 'index.html', 'help.html', diff --git a/frontend/tests/ram.test.js b/frontend/tests/ram.test.js index dffb599..fc91421 100644 --- a/frontend/tests/ram.test.js +++ b/frontend/tests/ram.test.js @@ -707,15 +707,19 @@ test('ramFmtLadder orders the registry command formats cautiously', () => { test('cardEtsiRelease infers the card ETSI release from uicc.toolkit', () => { const tk = v => ({ aid: 'A0000000090005FFFFFFFF8912000000', version: v }); - assert.deepStrictEqual(cardEtsiRelease([tk('1.12')]), + // the CE tag is raw hex: 010C is 1.12 (ramFmtVersion, as the ELF rows show) + assert.deepStrictEqual(cardEtsiRelease([tk('010C')]), { release: 'REL-15/16/17', basis: 'uicc.toolkit 1.12' }); - assert.deepStrictEqual(cardEtsiRelease([tk('1.11')]), + assert.deepStrictEqual(cardEtsiRelease([tk('010B')]), { release: 'REL-12', basis: 'uicc.toolkit 1.11' }); - assert.deepStrictEqual(cardEtsiRelease([tk('1.5')]), + assert.deepStrictEqual(cardEtsiRelease([tk('0105')]), { release: 'REL-9', basis: 'uicc.toolkit 1.5' }); // a version outside the table: the basis is still named - assert.deepStrictEqual(cardEtsiRelease([tk('9.9')]), - { release: '', basis: 'uicc.toolkit 9.9' }); + assert.deepStrictEqual(cardEtsiRelease([tk('01FF')]), + { release: '', basis: 'uicc.toolkit 1.255' }); + // a value that is not 4-hex passes through ramFmtVersion unchanged + assert.deepStrictEqual(cardEtsiRelease([tk('1.12')]), + { release: 'REL-15/16/17', basis: 'uicc.toolkit 1.12' }); // the compact listing carries no versions (the expanded CE tag does) assert.deepStrictEqual(cardEtsiRelease([tk('')]), { release: '', basis: '' }); // no uicc.toolkit (SIM-only card): no label, like SIM-only CAPs @@ -726,7 +730,7 @@ test('cardEtsiRelease infers the card ETSI release from uicc.toolkit', () => { test('the explorer shows the inferred ETSI release', () => { globalThis.t = s => s; const out = ramRenderExploreHtml({ appCount: 1, freeNV: 2, freeV: 3 }, [], [], - [{ aid: 'A0000000090005FFFFFFFF8912000000', version: '1.12' }], 'compact', '', ''); + [{ aid: 'A0000000090005FFFFFFFF8912000000', version: '010C' }], 'compact', '', ''); delete globalThis.t; assert.ok(out.includes('ETSI release: REL-15/16/17 (uicc.toolkit 1.12)'), out); globalThis.t = s => s;