Files view: the full DF chain in the file path (v2.7.6)

- the tracker kept only the immediate parent DF, so a phonebook file read as
  "DF_PHONEBOOK/4FA1" — the trace's own selection path (00a4080406
  7F105F3A4FA1) spells out the whole chain; the channel state now carries it
  (selected_df_state() returns (df, path), e.g. ('5f3a', ['7f10', '5f3a'])),
  the tracker stores it per file and _file_path() renders it:
  "DF_TELECOM/DF_PHONEBOOK/4FA1"
- chain rules: a child DF selected by FID appends to the current chain, MF and
  the ADF restart it, an AID is its own root, a path selection uses the DFs
  in the path (an explicit '7fff' collapsing to the ADF), and an EF selects
  keeps it.  A leading MF is implicit in a longer path; MF-only files keep
  "MF/…", ADF files "ADF/…" (the previous labels unchanged)
- the chain is learned from the FCP sighting too and extends a shorter path
  recorded earlier, so entries created from a GET RESPONSE still get the full
  path
- verified on the live traces (sessions 47/193): 5f3a/4fa1 ->
  DF_TELECOM/DF_PHONEBOOK/4FA1, 5f3a/4f30 -> DF_TELECOM/DF_PHONEBOOK/EF_PBR
  (4F30), while 3f00/2fe2 -> MF/EF_ICCID (2FE2) and 7fff/6f07 ->
  ADF/EF_IMSI (6F07) stay as before
- tests: selected_df_state (path/FID/MF/ADF/AID/EF cases) and a tracker flow
  with a path selection asserting the full path; 529 Python + 76 Node tests
- README/README_RUS show the chain; PWA_VERSION/pyproject/version.py 2.7.6,
  SW cache simtrace-analyser-v86
This commit is contained in:
catarrh committed 2026-10-18 01:05:55 +03:00
1 parent 1df52a34e5
commit 5dea6bceb8
12 files changed
+184 -52

No files matched your search

+27
View File
@@ -1814,6 +1814,33 @@ class TestSfiResolution(unittest.TestCase):
self.assertEqual(r['file']['ef'], 'EF_LOCI')
self.assertEqual(r['file']['tmsi'], '1E731E57')
def test_selected_df_state(self):
from simtrace_analyser.decode import selected_df_state
def sel(p1, body):
return {'ins_hex': 'a4', 'p1': {'raw': p1}, 'body': {'hex': body}}
# A path selection spells out the DF chain: 7F10/5F3A/4FA1.
self.assertEqual(selected_df_state(sel('08', '7f105f3a4fa1')),
('5f3a', ['7f10', '5f3a']))
# A child DF selected by FID appends to the current chain.
self.assertEqual(selected_df_state(sel('00', '5f3a'), '7f10', ['7f10']),
('5f3a', ['7f10', '5f3a']))
# MF and the ADF start a fresh chain; an AID is the root.
self.assertEqual(selected_df_state(sel('00', '3f00'), '7f10',
['7f10', '5f3a']),
('3f00', ['3f00']))
self.assertEqual(selected_df_state(sel('08', '7fff6f07'), '3f00',
['3f00']), ('7fff', ['7fff']))
aid = 'aid:a00000015141434c00'
self.assertEqual(selected_df_state(sel('04', 'A00000015141434C00'),
'3f00', ['3f00']), (aid, [aid]))
# An EF selection leaves the chain in place; non-SELECTs never move it.
self.assertEqual(selected_df_state(sel('09', '4fa1'), '5f3a',
['7f10', '5f3a']),
('5f3a', ['7f10', '5f3a']))
self.assertEqual(selected_df_state({'ins_hex': 'b0'}), (None, None))
def test_selected_df_fid(self):
from simtrace_analyser.decode import selected_df_fid, sfi_table
self.assertEqual(selected_df_fid({'ins_hex': 'a4', 'p1': {'raw': '08'},