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.
This commit is contained in:
+5
-2
@@ -9458,8 +9458,11 @@ function ramElfVersionHint(elfForm) {
|
|||||||
function cardEtsiRelease(elfs) {
|
function cardEtsiRelease(elfs) {
|
||||||
const tk = (elfs || []).find(e => (e.aid || '').toUpperCase() === UICC_TOOLKIT_AID);
|
const tk = (elfs || []).find(e => (e.aid || '').toUpperCase() === UICC_TOOLKIT_AID);
|
||||||
if (!tk) return null;
|
if (!tk) return null;
|
||||||
const v = String(tk.version || '').trim();
|
const raw = String(tk.version || '').trim();
|
||||||
if (!v) return { release: '', basis: '' };
|
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 };
|
return { release: ETSI_TOOLKIT_RELEASE[v] || '', basis: 'uicc.toolkit ' + v };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
const CACHE = 'simple-v354';
|
const CACHE = 'simple-v355';
|
||||||
const URLS = [
|
const URLS = [
|
||||||
'index.html',
|
'index.html',
|
||||||
'help.html',
|
'help.html',
|
||||||
|
|||||||
@@ -707,15 +707,19 @@ test('ramFmtLadder orders the registry command formats cautiously', () => {
|
|||||||
|
|
||||||
test('cardEtsiRelease infers the card ETSI release from uicc.toolkit', () => {
|
test('cardEtsiRelease infers the card ETSI release from uicc.toolkit', () => {
|
||||||
const tk = v => ({ aid: 'A0000000090005FFFFFFFF8912000000', version: v });
|
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' });
|
{ 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' });
|
{ 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' });
|
{ release: 'REL-9', basis: 'uicc.toolkit 1.5' });
|
||||||
// a version outside the table: the basis is still named
|
// a version outside the table: the basis is still named
|
||||||
assert.deepStrictEqual(cardEtsiRelease([tk('9.9')]),
|
assert.deepStrictEqual(cardEtsiRelease([tk('01FF')]),
|
||||||
{ release: '', basis: 'uicc.toolkit 9.9' });
|
{ 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)
|
// the compact listing carries no versions (the expanded CE tag does)
|
||||||
assert.deepStrictEqual(cardEtsiRelease([tk('')]), { release: '', basis: '' });
|
assert.deepStrictEqual(cardEtsiRelease([tk('')]), { release: '', basis: '' });
|
||||||
// no uicc.toolkit (SIM-only card): no label, like SIM-only CAPs
|
// 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', () => {
|
test('the explorer shows the inferred ETSI release', () => {
|
||||||
globalThis.t = s => s;
|
globalThis.t = s => s;
|
||||||
const out = ramRenderExploreHtml({ appCount: 1, freeNV: 2, freeV: 3 }, [], [],
|
const out = ramRenderExploreHtml({ appCount: 1, freeNV: 2, freeV: 3 }, [], [],
|
||||||
[{ aid: 'A0000000090005FFFFFFFF8912000000', version: '1.12' }], 'compact', '', '');
|
[{ aid: 'A0000000090005FFFFFFFF8912000000', version: '010C' }], 'compact', '', '');
|
||||||
delete globalThis.t;
|
delete globalThis.t;
|
||||||
assert.ok(out.includes('ETSI release: REL-15/16/17 (uicc.toolkit 1.12)'), out);
|
assert.ok(out.includes('ETSI release: REL-15/16/17 (uicc.toolkit 1.12)'), out);
|
||||||
globalThis.t = s => s;
|
globalThis.t = s => s;
|
||||||
|
|||||||
Reference in New Issue
Block a user