From 163a85965887845c926888674e8ebe53377df93c 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: Sat, 19 Sep 2026 23:26:21 +0300 Subject: [PATCH] ui: drop the clipboard/paste JSON buttons from Cards and custom files (v2.5.1) - Cards and Custom files now expose only Export to file (JSON download) and Import from file; the Export-as-JSON / Paste & import / Import-JSON-from- clipboard buttons and their paste textareas are gone - import feedback moves to a transient status line (new ioStatus helper); cardsImport/pysimCustomImport no longer read the clipboard - Network simulation parameters: note under the operator form listing the scenarios that use the MCC/MNC (EPS/2G attach and SMS received write real LAI/RAI/TAI; cold boot, service lost, limited service and roaming denied write dummy files keeping the PLMN; churn/CB/AUTHENTICATE do not use it) - i18n: removed-button entries dropped, note added EN/RU; help EN/RU updated - guard tests for the button set and the note; SW cache simple-v196 --- frontend/help-ru.html | 4 +- frontend/help.html | 4 +- frontend/index.html | 75 +++++++++-------------------------- frontend/sw.js | 2 +- frontend/tests/html.test.js | 18 +++++++++ pyproject.toml | 2 +- pysim_simple_server/server.py | 2 +- 7 files changed, 44 insertions(+), 63 deletions(-) diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 5dcd539..6bf4913 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -313,7 +313,7 @@ PSK keySCP81 HTTP OTA: 32 hex-символа (16 байт) для PSK TLS-слушателя; ключ выбирается по идентификатору, который предъявляет карта -

Столбец SCP81 показывает, задана ли в предустановке рабочая пара PSK: (зелёный) — идентификатор и ключ заданы; (жёлтый) — задано только одно из двух, и слушатель такую предустановку игнорирует; — PSK нет. Идентификатор и ключ PSK задаются вместе. Кнопка Редактировать загружает предустановку в форму (кнопка Add становится Сохранить; Отмена очищает форму), поэтому поля можно менять без повторного ввода карты; Удалить удаляет строку. Обмен предустановками: Экспорт в JSON и Экспорт в файл для выгрузки, Импорт из файла, Вставить и импортировать или Импорт JSON из буфера для загрузки. Выбранная предустановка автоматически заполняет форму Secured Packet; изменения сразу передаются работающему слушателю SCP81.

+

Столбец SCP81 показывает, задана ли в предустановке рабочая пара PSK: (зелёный) — идентификатор и ключ заданы; (жёлтый) — задано только одно из двух, и слушатель такую предустановку игнорирует; — PSK нет. Идентификатор и ключ PSK задаются вместе. Кнопка Редактировать загружает предустановку в форму (кнопка Add становится Сохранить; Отмена очищает форму), поэтому поля можно менять без повторного ввода карты; Удалить удаляет строку. Обмен предустановками: Экспорт в файл для выгрузки и Импорт из файла для загрузки. Выбранная предустановка автоматически заполняет форму Secured Packet; изменения сразу передаются работающему слушателю SCP81.

@@ -436,7 +436,7 @@

Пользовательские файлы

-

Добавление файлов, не покрытых моделью pySim. Пользовательский файл всегда имеет полный путь от MF или ADF (ADF.USIM, ADF.ISIM): выберите корень, введите путь родительского DF (сам корень, стандартный DF из дерева файлового менеджера или пользовательский DF — любой вложенности, с подсказками при вводе; родитель, ещё не встречавшийся в дереве, остаётся допустимым и помечается ), 4-hex FID и псевдоним (EF.…/DF.…; префикс определяет, EF это или DF). Канонический путь убирает прежнюю неоднозначность, когда один и тот же файл можно было описать и относительно, и абсолютно. Добавленные файлы появляются в дереве «Файловый менеджер»; в каждой строке есть «Редактировать» (путь + псевдоним; изменение пути DF перепривязывает дочерние записи — кнопка становится «Сохранить», «Отмена» отменяет) и «Удалить» (удаление DF удаляет и его дочерние записи после подтверждения). Список сохраняется в localStorage; обмен — Экспорт в JSON / Экспорт в файл / Импорт; старые относительные пути (например, a153/4954) разрешаются при загрузке, неразрешимые отбрасываются и отмечаются в списке.

+

Добавление файлов, не покрытых моделью pySim. Пользовательский файл всегда имеет полный путь от MF или ADF (ADF.USIM, ADF.ISIM): выберите корень, введите путь родительского DF (сам корень, стандартный DF из дерева файлового менеджера или пользовательский DF — любой вложенности, с подсказками при вводе; родитель, ещё не встречавшийся в дереве, остаётся допустимым и помечается ), 4-hex FID и псевдоним (EF.…/DF.…; префикс определяет, EF это или DF). Канонический путь убирает прежнюю неоднозначность, когда один и тот же файл можно было описать и относительно, и абсолютно. Добавленные файлы появляются в дереве «Файловый менеджер»; в каждой строке есть «Редактировать» (путь + псевдоним; изменение пути DF перепривязывает дочерние записи — кнопка становится «Сохранить», «Отмена» отменяет) и «Удалить» (удаление DF удаляет и его дочерние записи после подтверждения). Список сохраняется в localStorage; обмен — Экспорт в файл / Импорт из файла; старые относительные пути (например, a153/4954) разрешаются при загрузке, неразрешимые отбрасываются и отмечаются в списке.

8. Симулятор телефона

diff --git a/frontend/help.html b/frontend/help.html index 5ebb645..55e28bd 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -313,7 +313,7 @@ PSK keySCP81 HTTP OTA: 32 hex chars (16 bytes) for the PSK TLS listener, picked by the identity the card presents -

The SCP81 column shows whether the preset supplies a usable PSK pair: (green) — identity and key set; (amber) — only one of the two, so the listener ignores the preset; — no PSK. PSK identity and key must be set together. Edit loads a preset into the form (the Add button becomes Save; Cancel clears it) so fields can be changed without re-entering the card; Remove deletes the row. Presets can be shared with Export as JSON / Export to file and restored with Import from file, Paste & import, or Import JSON from clipboard. The selected card preset auto-fills the Secured Packet form; edits are pushed into a running SCP81 listener automatically.

+

The SCP81 column shows whether the preset supplies a usable PSK pair: (green) — identity and key set; (amber) — only one of the two, so the listener ignores the preset; — no PSK. PSK identity and key must be set together. Edit loads a preset into the form (the Add button becomes Save; Cancel clears it) so fields can be changed without re-entering the card; Remove deletes the row. Presets can be shared with Export to file and restored with Import from file. The selected card preset auto-fills the Secured Packet form; edits are pushed into a running SCP81 listener automatically.

@@ -436,7 +436,7 @@

Custom files

-

Add files that pySim’s model does not cover. A custom file always has a full path rooted at MF or an ADF (ADF.USIM, ADF.ISIM): pick the root, type the parent DF path (the root itself, a standard DF known from the file-manager tree, or a custom DF — any depth, with suggestions while you type; a parent that has not been seen in the tree yet stays valid and is marked ), the 4-hex FID and an alias (EF.…/DF.…; the prefix decides whether the entry is an EF or a DF). The canonical path removes the old ambiguity where the same file could be described both relatively and absolutely. Added files appear in the File manager tree; each row has Edit (path + alias; changing a DF’s path re-points its child entries — the button becomes Save, Cancel aborts) and Delete (deleting a DF also deletes its child entries after a confirmation). The list persists in localStorage and can be shared with Export as JSON / Export to file / Import; legacy relative paths (e.g. a153/4954) are resolved on load, unresolvable ones are dropped and reported in the list.

+

Add files that pySim’s model does not cover. A custom file always has a full path rooted at MF or an ADF (ADF.USIM, ADF.ISIM): pick the root, type the parent DF path (the root itself, a standard DF known from the file-manager tree, or a custom DF — any depth, with suggestions while you type; a parent that has not been seen in the tree yet stays valid and is marked ), the 4-hex FID and an alias (EF.…/DF.…; the prefix decides whether the entry is an EF or a DF). The canonical path removes the old ambiguity where the same file could be described both relatively and absolutely. Added files appear in the File manager tree; each row has Edit (path + alias; changing a DF’s path re-points its child entries — the button becomes Save, Cancel aborts) and Delete (deleting a DF also deletes its child entries after a confirmation). The list persists in localStorage and can be shared with Export to file / Import from file; legacy relative paths (e.g. a153/4954) are resolved on load, unresolvable ones are dropped and reported in the list.

8. Phone simulator

diff --git a/frontend/index.html b/frontend/index.html index c7fb6c2..a21908b 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -763,13 +763,10 @@
- - -
- + +
Sets the PLMN written to LOCI/PSLOCI/EPSLOCI. Used by EPS attach, 2G attach and SMS received (real LAI/RAI/TAI; SMS only when its location rewrite is enabled), and by Cold boot, Service lost, Limited service and Roaming denied (dummy files keep this PLMN). Churn, CB reconfig and AUTHENTICATE don't use it.
@@ -1266,13 +1264,10 @@
- - -
- +
') > block.lastIndexOf('')); }); +test('cards and custom files expose only file import/export', () => { + assert.ok(!html.includes('data-l10n="Export as JSON"')); + assert.ok(!html.includes('data-l10n="Paste & import"')); + assert.ok(!html.includes('data-l10n="Import JSON from clipboard"')); + for (const fn of ['cardsExportFile', 'cardsImportFile', 'pysimCustomExportFile', 'pysimCustomImportFile']) { + assert.ok(html.includes('function ' + fn + '('), fn); + } + assert.ok(!html.includes('function cardsExport(')); + assert.ok(!html.includes('function pysimCustomExport(')); + assert.ok(!html.includes('cardsImportField(')); + assert.ok(!html.includes('pysimCustomImportField(')); + // import feedback goes to the transient status line + assert.ok(html.includes('function ioStatus(')); + assert.ok(html.includes("ioStatus('cards-io'")); + assert.ok(html.includes("ioStatus('pysim-cf-io'")); +}); + test('SCP81 listener exposes its four modes with the matching notes', () => { for (const v of ['tls', 'redirect', 'passthru', 'dump']) { assert.ok(html.includes('value="' + v + '"'), v); diff --git a/pyproject.toml b/pyproject.toml index 8df221d..610d066 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "pysim-simple-server" -version = "2.5.0" +version = "2.5.1" description = "HTTP REST server wrapping pysim for the SIMple PWA" requires-python = ">=3.8" # pysim is a git-only dependency installed explicitly by setup.bat/setup.sh. diff --git a/pysim_simple_server/server.py b/pysim_simple_server/server.py index 99ee5d2..457a57b 100644 --- a/pysim_simple_server/server.py +++ b/pysim_simple_server/server.py @@ -24,7 +24,7 @@ from osmocom.construct import GsmOrUcs2Adapter from osmocom.tlv import BER_TLV_IE -VERSION = '2.5.0' +VERSION = '2.5.1' MAX_ENVELOPE_SEGMENTS = 5 # max SMS segments for outgoing C-APDU in ENVELOPE