diff --git a/README.md b/README.md index 195d257..9b50ae3 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ npm run build ## Interface -Four top-level tabs: **C-APDU**, **SCP80**, **Response parser**, **Card reader**. The **C-APDU** and **SCP80** tabs use pill sub-tabs, and the Card reader tab has six sub-tabs: **File manager**, **Custom files**, **Profiler**, **pySim command line**, **Raw APDU**, and **Proactive UICC**. +Five top-level tabs: **Remote APDU**, **SCP80**, **Card reader**, **Profiler**, and **Phone simulator**. **Remote APDU** and **SCP80** use pill sub-tabs; the Card reader tab has four sub-tabs: **File manager**, **Custom files**, **pySim command line**, and **Raw APDU**. --- -## C-APDU tab +## Remote APDU tab -Builds command APDUs (C-APDUs). Six sub-tabs cover different card generations and command sets. +Builds command APDUs (C-APDUs). Seven sub-tabs cover different card generations, command sets and decoding tools: **SIM RFM**, **USIM RFM**, **Expanded Script**, **RAM/GP**, **HTTP OTA**, **C-APDU Parser**, and **Response parser**. ### SIM RFM @@ -334,6 +334,19 @@ The **Command Scripting template** checkbox wraps the whole `81` triggering comm --- + +### Response parser + +Decodes a raw command response: pick the command that was sent, enter the SW (e.g. `9000`) and the response data hex, then press **Decode**. + +- **Command** — SIM/USIM group (SELECT, STATUS, READ/UPDATE, PIN ops, CAT commands like TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, ...) or RAM/GP group (INSTALL, LOAD, DELETE, GET/STORE DATA, auth, SCP commands). +- **SW decode** — status words resolved against generic, UICC (TS 102 221), and GlobalPlatform maps, with context auto-detected. +- **Privilege decode** — GET DATA / INSTALL response payloads decode the privilege bytes into human-readable flags. +- **Response data** — raw hex rendered and interpreted per command (e.g. SELECT FCP templates). + +--- + + ## SCP80 tab The **SCP80** top-level tab groups SCP80-related views, switched by three pills: **Secured Packet**, **Cards**, and **RAM**. Assembles secured packets per ETSI TS 102 225. @@ -463,17 +476,6 @@ Delete confirms via a browser prompt before sending the GP `DELETE` command via --- -## Response parser tab - -Decodes a raw command response: pick the command that was sent, enter the SW (e.g. `9000`) and the response data hex, then press **Decode**. - -- **Command** — SIM/USIM group (SELECT, STATUS, READ/UPDATE, PIN ops, CAT commands like TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, ...) or RAM/GP group (INSTALL, LOAD, DELETE, GET/STORE DATA, auth, SCP commands). -- **SW decode** — status words resolved against generic, UICC (TS 102 221), and GlobalPlatform maps, with context auto-detected. -- **Privilege decode** — GET DATA / INSTALL response payloads decode the privilege bytes into human-readable flags. -- **Response data** — raw hex rendered and interpreted per command (e.g. SELECT FCP templates). - ---- - ## Card Reader (pySim integration) Connects to the bundled [`pysim-otaman-server`](pysim_otaman_server/) for live card operations. @@ -499,9 +501,48 @@ Files not in pysim's model can be added manually: Custom files persist in `localStorage` across sessions. Export/import as JSON for sharing. -### Proactive UICC Pill +### Command Hints -The **Proactive UICC** sub-tab in the Card Reader provides real-time CAT session interaction: +Type a command name in the **pySim command line** input. Usage hints appear as a tooltip after 300ms. Command autocomplete suggestions appear above the input. + +--- + +## Profiler + +Verifies that a card matches a named **profile** — an ordered set of rules describing the expected file system and, optionally, file contents. Profiles are stored in `localStorage`. + +- **New profile** creates an empty ruleset; **Profile from card** scans the equipped card and generates one rule per existing file; **Import profile** loads a ruleset from JSON (the name is stored inside the file). +- Each profile row has **Check card ▶** (run against the equipped card), **Check card snapshot** (run offline against a saved snapshot), **Edit**, **Export**, and **Delete**. + +A filesystem rule is defined by: + +- **Path** — `MF`-rooted (e.g. `MF/7F10/6F3A`) or ADF AID-rooted (e.g. `A0000000871002/6F07`). +- **FCP/FCI check** — **Filetype only (FCP)**, **Filetype + size (FCP)** (adds file size, or record length/count for record files), or **Exact FCI** (byte-for-byte comparison of the raw SELECT FCP template `'62'`, catching FID/AID, life-cycle status, security-attribute, and proprietary-parameter changes). +- **File attributes** — file type, size, record length and record count, taken from the FCP template (any may be left unset). +- **Check contents** (optional) — **Exact** hex equality, or **Mask** where `?` is a per-nibble wildcard (a mask with no `?` is a prefix match, e.g. `0891` for the IMSI MCC/MNC). Record files store a per-record list. + +The check report marks each verified aspect (e.g. *filetype ✓, size ✗, contents ✓*), lists mismatches as read-only monospace expected/actual fields aligned in one column, and shows a decoded per-parameter FCI comparison for FCI mismatches. Corrupt FCI data shows whatever decoded before the faulty part plus an explicit decode-failure note; record mismatches list the *matching records*. **Only mismatches** in the results header hides all passing files and keeps failures and errors only. + +#### “Profile from card” scan options + +The scan dialog asks for a profile name and offers the FCP/FCI mode described above, an **Ignore contents of files** checklist of frequently-overwritten files (all checked by default except `EF.ARR`; the header checkbox toggles the whole list) — `EF.LOCI`, `EF.PSLOCI`, `EF.EPSLOCI`, `EF.5GS3GPPLOCI`, `EF.Keys`, `EF.KeysPS`, `EF.SMS`, `EF.Kc`, `EF.KcGPRS`, `EF.LOCIGPRS`, `EF.CBMID`, `EF.SMSS`, `EF.ACC`, `EF.EPSNSC`, `EF.START-HFN`, `EF.ARR` — and two checked-by-default mask options that capture only the first 4 bytes of `EF.IMSI` and `EF.ICCID` (uncheck for exact matching). A progress line shows *N / total files* with the current path; the options are locked while scanning. Rules are created only for files that actually exist (a FCP template is returned); custom files from the **Custom files** sub-tab are included under the same existence check. + +#### Card snapshots + +The list view has two tabs — **Profiles** and **Card snapshots**. A snapshot is an immutable capture of the card filesystem: for every existing file it stores the path, symbolic name, file type, size (or record length/count), the raw FCI from the SELECT response, and the contents whenever the file is readable (no ignore list, no masking). The ICCID is decoded from EF.ICCID and shown next to the snapshot name. + +- **New snapshot** scans the card; **Import snapshot** loads JSON. +- Each snapshot row has **Open** (all captured data read-only, raw FCI with decoded FCI and contents; only the name is editable), **Export**, and **Delete**. +- **Check card snapshot** on a profile row runs the profile rules against a snapshot picked from the list, without a card reader. Files whose contents were not captured are reported as unverifiable errors. +- **Compare snapshots** compares two snapshots offline exactly like a profile check: pick the *master* snapshot and the *snapshot to check*, optionally masking the first 4 bytes of EF.IMSI/EF.ICCID (on by default), and get the same report. Every file must match exactly (exact FCI, contents); files present only in the checked snapshot are reported as extra files. + +--- + +--- + +## Phone simulator + +The **Phone simulator** tab provides real-time CAT session interaction: **Subscribed Events** — the card's SET UP EVENT LIST is displayed with per-event **Send** buttons. Clicking opens a form specific to the event type: @@ -533,41 +574,6 @@ The **Proactive UICC** sub-tab in the Card Reader provides real-time CAT session Values persist on the server until restart. Apply → hex updates; Save → POSTs to server. The server will use these values to populate TERMINAL RESPONSE data for future PLI proactive commands. -### Command Hints - -Type a command name in the **pySim command line** input. Usage hints appear as a tooltip after 300ms. Command autocomplete suggestions appear above the input. - -### Profiler - -Verifies that a card matches a named **profile** — an ordered set of rules describing the expected file system and, optionally, file contents. Profiles are stored in `localStorage`. - -- **New profile** creates an empty ruleset; **Profile from card** scans the equipped card and generates one rule per existing file; **Import profile** loads a ruleset from JSON (the name is stored inside the file). -- Each profile row has **Check card ▶** (run against the equipped card), **Check card snapshot** (run offline against a saved snapshot), **Edit**, **Export**, and **Delete**. - -A filesystem rule is defined by: - -- **Path** — `MF`-rooted (e.g. `MF/7F10/6F3A`) or ADF AID-rooted (e.g. `A0000000871002/6F07`). -- **FCP/FCI check** — **Filetype only (FCP)**, **Filetype + size (FCP)** (adds file size, or record length/count for record files), or **Exact FCI** (byte-for-byte comparison of the raw SELECT FCP template `'62'`, catching FID/AID, life-cycle status, security-attribute, and proprietary-parameter changes). -- **File attributes** — file type, size, record length and record count, taken from the FCP template (any may be left unset). -- **Check contents** (optional) — **Exact** hex equality, or **Mask** where `?` is a per-nibble wildcard (a mask with no `?` is a prefix match, e.g. `0891` for the IMSI MCC/MNC). Record files store a per-record list. - -The check report marks each verified aspect (e.g. *filetype ✓, size ✗, contents ✓*), lists mismatches as read-only monospace expected/actual fields aligned in one column, and shows a decoded per-parameter FCI comparison for FCI mismatches. Corrupt FCI data shows whatever decoded before the faulty part plus an explicit decode-failure note; record mismatches list the *matching records*. **Only mismatches** in the results header hides all passing files and keeps failures and errors only. - -#### “Profile from card” scan options - -The scan dialog asks for a profile name and offers the FCP/FCI mode described above, an **Ignore contents of files** checklist of frequently-overwritten files (all checked by default except `EF.ARR`; the header checkbox toggles the whole list) — `EF.LOCI`, `EF.PSLOCI`, `EF.EPSLOCI`, `EF.5GS3GPPLOCI`, `EF.Keys`, `EF.KeysPS`, `EF.SMS`, `EF.Kc`, `EF.KcGPRS`, `EF.LOCIGPRS`, `EF.CBMID`, `EF.SMSS`, `EF.ACC`, `EF.EPSNSC`, `EF.START-HFN`, `EF.ARR` — and two checked-by-default mask options that capture only the first 4 bytes of `EF.IMSI` and `EF.ICCID` (uncheck for exact matching). A progress line shows *N / total files* with the current path; the options are locked while scanning. Rules are created only for files that actually exist (a FCP template is returned); custom files from the **Custom files** sub-tab are included under the same existence check. - -#### Card snapshots - -The list view has two tabs — **Profiles** and **Card snapshots**. A snapshot is an immutable capture of the card filesystem: for every existing file it stores the path, symbolic name, file type, size (or record length/count), the raw FCI from the SELECT response, and the contents whenever the file is readable (no ignore list, no masking). The ICCID is decoded from EF.ICCID and shown next to the snapshot name. - -- **New snapshot** scans the card; **Import snapshot** loads JSON. -- Each snapshot row has **Open** (all captured data read-only, raw FCI with decoded FCI and contents; only the name is editable), **Export**, and **Delete**. -- **Check card snapshot** on a profile row runs the profile rules against a snapshot picked from the list, without a card reader. Files whose contents were not captured are reported as unverifiable errors. -- **Compare snapshots** compares two snapshots offline exactly like a profile check: pick the *master* snapshot and the *snapshot to check*, optionally masking the first 4 bytes of EF.IMSI/EF.ICCID (on by default), and get the same report. Every file must match exactly (exact FCI, contents); files present only in the checked snapshot are reported as extra files. - ---- - ## PWA OTAMan is a Progressive Web App and can be installed for offline use. Use the **INSTALL PWA** button in the header, or use the browser's install prompt. diff --git a/README_RUS.md b/README_RUS.md index 90e4892..7d925be 100644 --- a/README_RUS.md +++ b/README_RUS.md @@ -31,13 +31,13 @@ npm run build ## Интерфейс -Четыре вкладки: **C-APDU**, **SCP80**, **Response parser**, **Card reader**. Вкладки C-APDU и SCP80 используют пиллы-подвкладки; во вкладке Card reader шесть подвкладок: **File manager**, **Custom files**, **Profiler**, **pySim command line**, **Raw APDU** и **Proactive UICC**. +Пять вкладок: **Remote APDU**, **SCP80**, **Card reader**, **Profiler** и **Phone simulator**. Вкладки Remote APDU и SCP80 используют пиллы-подвкладки; во вкладке Card reader четыре подвкладки: **File manager**, **Custom files**, **pySim command line** и **Raw APDU**. --- -## Вкладка C-APDU +## Вкладка Remote APDU -Построение команд APDU (C-APDU). Шесть подвкладок для разных поколений карт и наборов команд. +Построение команд APDU (C-APDU). Семь подвкладок для разных поколений карт, наборов команд и инструментов разбора: **SIM RFM**, **USIM RFM**, **Expanded Script**, **RAM/GP**, **HTTP OTA**, **Разбор C-APDU** и **«Парсер ответов»**. ### SIM RFM @@ -308,6 +308,19 @@ CLA = `80` (GlobalPlatform v2.3.1). Удалённое управление со --- + +### Парсер ответов + +Декодирование ответа команды: выберите отправленную команду, введите SW (например, `9000`) и данные ответа в hex, затем нажмите **Decode**. + +- **Команда** — группа SIM/USIM (SELECT, STATUS, READ/UPDATE, операции с PIN, CAT-команды TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, ...) или группа RAM/GP (INSTALL, LOAD, DELETE, GET/STORE DATA, аутентификация, команды SCP). +- **Декодирование SW** — статусные слова по картам generic, UICC (TS 102 221) и GlobalPlatform с автоопределением контекста. +- **Декодирование привилегий** — байты привилегий из ответов GET DATA / INSTALL в читаемые флаги. +- **Данные ответа** — hex с интерпретацией по команде (например, шаблоны FCP из SELECT). + +--- + + ## Вкладка SCP80 Вкладка **SCP80** группирует SCP80-виды, переключаемые тремя пиллами: **Secured Packet**, **Cards** и **RAM**. Сборка защищённых пакетов по ETSI TS 102 225. @@ -437,17 +450,6 @@ Delivery PoR (SPI2 `01`) проще — карта возвращает PoR на --- -## Вкладка Response parser - -Декодирование ответа команды: выберите отправленную команду, введите SW (например, `9000`) и данные ответа в hex, затем нажмите **Decode**. - -- **Команда** — группа SIM/USIM (SELECT, STATUS, READ/UPDATE, операции с PIN, CAT-команды TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, ...) или группа RAM/GP (INSTALL, LOAD, DELETE, GET/STORE DATA, аутентификация, команды SCP). -- **Декодирование SW** — статусные слова по картам generic, UICC (TS 102 221) и GlobalPlatform с автоопределением контекста. -- **Декодирование привилегий** — байты привилегий из ответов GET DATA / INSTALL в читаемые флаги. -- **Данные ответа** — hex с интерпретацией по команде (например, шаблоны FCP из SELECT). - ---- - ## Card Reader (интеграция с pySim) Подключение к встроенному [`pysim-otaman-server`](pysim_otaman_server/) для работы с картой. @@ -473,41 +475,13 @@ Delivery PoR (SPI2 `01`) проще — карта возвращает PoR на Пользовательские файлы сохраняются в `localStorage`. Экспорт/импорт в JSON для обмена. -### Proactive UICC - -Подраздел **Proactive UICC** во вкладке Card Reader обеспечивает взаимодействие с CAT-сессией в реальном времени: - -**Subscribed Events** — список событий SET UP EVENT LIST с кнопками **Send**. Клик открывает форму для конкретного типа события: - -- **События без данных** (User Activity, Idle Screen и др.) — однократное уведомление -- **Location Status** — выпадающий список: Normal / Limited / No service -- **Access Technology Change** — 13 типов RAT -- **Network Rejection** — полная адаптивная форма: тип регистрации (LU / GPRS / EPS / 5GS), поля локации (MCC, MNC, LAC, RAC, TAC), доступные технологии, 53-позиционный выпадающий список причин отказа (EMM, GMM, 5GMM, LU) - -**Proactive Command Log** — хронологический список проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор. - -**PLI Data Dictionary** — редактируемые hex-значения для всех 22 квалификаторов PROVIDE LOCAL INFORMATION (TS 102 223 + TS 131 111). 10 квалификаторов имеют встроенные формы декодирования/кодирования: - -| Код | Декодированные поля | -|------|--------------| -| 00 | MCC, MNC, LAC/TAC | -| 01 | IMEI (15 цифр) | -| 03 | Дата, время, TZ | -| 04 | Язык (2-символьный код) | -| 05 | ME Status, Timing Advance | -| 06 | Access Technology (выпадающий список) | -| 08 | IMEISV (16 цифр) | -| 09 | Search Mode (Auto/Manual) | -| 0A | Battery charge (%) | -| 0E | Multiple Access Technologies (список через запятую) | - -Значения сохраняются на сервере до перезапуска. Apply → hex обновляется; Save → POST на сервер. - ### Подсказки команд Введите имя команды в **pySim command line**. Подсказки по использованию появляются через 300 мс. Автодополнение команд — над полем ввода. -### Профайлер +--- + +## Профайлер Проверка соответствия карты именованному **профилю** — упорядоченному набору правил, описывающих ожидаемую файловую систему и (опционально) содержимое файлов. Профили хранятся в `localStorage`. @@ -538,6 +512,38 @@ Delivery PoR (SPI2 `01`) проще — карта возвращает PoR на --- +--- + +## Симулятор телефона + +Вкладка **«Симулятор телефона»** обеспечивает взаимодействие с CAT-сессией в реальном времени: + +**Subscribed Events** — список событий SET UP EVENT LIST с кнопками **Send**. Клик открывает форму для конкретного типа события: + +- **События без данных** (User Activity, Idle Screen и др.) — однократное уведомление +- **Location Status** — выпадающий список: Normal / Limited / No service +- **Access Technology Change** — 13 типов RAT +- **Network Rejection** — полная адаптивная форма: тип регистрации (LU / GPRS / EPS / 5GS), поля локации (MCC, MNC, LAC, RAC, TAC), доступные технологии, 53-позиционный выпадающий список причин отказа (EMM, GMM, 5GMM, LU) + +**Proactive Command Log** — хронологический список проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор. + +**PLI Data Dictionary** — редактируемые hex-значения для всех 22 квалификаторов PROVIDE LOCAL INFORMATION (TS 102 223 + TS 131 111). 10 квалификаторов имеют встроенные формы декодирования/кодирования: + +| Код | Декодированные поля | +|------|--------------| +| 00 | MCC, MNC, LAC/TAC | +| 01 | IMEI (15 цифр) | +| 03 | Дата, время, TZ | +| 04 | Язык (2-символьный код) | +| 05 | ME Status, Timing Advance | +| 06 | Access Technology (выпадающий список) | +| 08 | IMEISV (16 цифр) | +| 09 | Search Mode (Auto/Manual) | +| 0A | Battery charge (%) | +| 0E | Multiple Access Technologies (список через запятую) | + +Значения сохраняются на сервере до перезапуска. Apply → hex обновляется; Save → POST на сервер. + ## PWA OTAMan — Progressive Web App. Можно установить для offline-использования через кнопку **INSTALL PWA** или через браузер. diff --git a/frontend/help-ru.html b/frontend/help-ru.html index 4e2cde6..04a14f4 100644 --- a/frontend/help-ru.html +++ b/frontend/help-ru.html @@ -44,13 +44,14 @@
-

2. Вкладка C-APDU

-

Построение командных APDU (C-APDU). Шесть подвкладок охватывают разные поколения карт и наборы команд: SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA и Разбор C-APDU.

+

2. Вкладка Remote APDU

+

Построение командных APDU (C-APDU). Семь подвкладок охватывают разные поколения карт, наборы команд и инструменты разбора: SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, Разбор C-APDU и «Парсер ответов».

2.1 SIM RFM

CLA = A0 (GSM 11.11 / TS 151 011, ISO 7816-4). Удалённое управление файлами классических SIM-карт.

@@ -138,7 +139,7 @@

Декодирование ответов (TS 102 226 §5.2.2)

-

Входящие ответы Proof of Receipt декодируются сервером — формат expanded Remote Application response data (TS 102 226 §5.2.2) или компактный формат. Представление Secured Packet показывает результат после Отправить на карту (см. §3.1): статус PoR (TAR, счётчик, сырой PoR), а статусное слово и данные ответа последней команды подставляются на вкладку «Парсер ответов».

+

Входящие ответы Proof of Receipt декодируются сервером — формат expanded Remote Application response data (TS 102 226 §5.2.2) или компактный формат. Представление Secured Packet показывает результат после Отправить на карту (см. §3.1): статус PoR (TAR, счётчик, сырой PoR), а статусное слово и данные ответа последней команды подставляются в подвкладку «Парсер ответов» (Remote APDU).

2.4 RAM/GP

CLA = 80 (GlobalPlatform Card Specification v2.3.1). Команды удалённого управления приложениями. Строятся тем же сборщиком цепочки, что и SIM/USIM.

@@ -227,6 +228,17 @@

Упаковать в Secured packet отправляет готовый payload на вкладку SCP80 для заполнения SPI/счётчика — там укажите TAR, который слушает SD (обычно TAR OTASD).

+ +

2.8 «Парсер ответов»

+

Декодирует raw-ответ команды: выберите отправленную команду, введите SW (например, 9000) и hex данных ответа, затем нажмите Декодировать. Поля также автоматически заполняются статусным словом и данными ответа последней команды после успешного нажатия Отправить на карту (см. §3.1).

+ + +

3. Вкладка SCP80

Верхнеуровневая вкладка SCP80 объединяет разделы, связанные с SCP80. Переключение — тремя переключателями: Secured Packet, Карты и RAM. Собирает защищённые пакеты SCP80 по ETSI TS 102 225.

@@ -260,7 +272,7 @@
  • AES требует счётчик с защитой от повтора: биты SPI1 b5 b4 должны быть 10 (счётчик больше) или 11 (счётчик +1) согласно TS 102 225 §5.1.2/§5.1.3.1
  • Байт паддинга настраивается (00 по умолчанию или FF)
  • -

    Кнопка Проверить в pySim сверяет собранный пакет с эталонной реализацией OtaDialectSms.encode_cmd. Кнопка Отправить на карту доставляет пакет через ENVELOPE SMS-PP-DOWNLOAD (при подключении к серверу). Полученный Proof of Receipt декодируется и показывается строкой статуса PoR (статус, TAR, счётчик, сырой PoR); статусное слово и данные ответа последней команды подставляются на вкладку «Парсер ответов», а успешный PoR увеличивает счётчик повторов и очищает пакет.

    +

    Кнопка Проверить в pySim сверяет собранный пакет с эталонной реализацией OtaDialectSms.encode_cmd. Кнопка Отправить на карту доставляет пакет через ENVELOPE SMS-PP-DOWNLOAD (при подключении к серверу). Полученный Proof of Receipt декодируется и показывается строкой статуса PoR (статус, TAR, счётчик, сырой PoR); статусное слово и данные ответа последней команды подставляются в подвкладку «Парсер ответов» (Remote APDU), а успешный PoR увеличивает счётчик повторов и очищает пакет.

    3.2 Карты

    Хранит предустановки карт локально в браузере (localStorage), чтобы представление Secured Packet могло автоматически подставлять ключи и параметры.

    @@ -301,21 +313,10 @@
    -

    4. Вкладка «Парсер ответов»

    -

    Декодирует raw-ответ команды: выберите отправленную команду, введите SW (например, 9000) и hex данных ответа, затем нажмите Декодировать. Поля также автоматически заполняются статусным словом и данными ответа последней команды после успешного нажатия Отправить на карту (см. §3.1).

    -
      -
    • Команда — группа SIM/USIM (SELECT, STATUS, READ/UPDATE, PIN-операции, CAT-команды типа TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, …) или группа RAM/GP (INSTALL, LOAD, DELETE, GET/STORE DATA, auth, SCP-команды).
    • -
    • Декодирование SW — статусные слова разрешаются по generic-, UICC- (TS 102 221) и GlobalPlatform-таблицам, контекст определяется автоматически.
    • -
    • Декодирование привилегий — ответы GET DATA / INSTALL декодируют байты привилегий в читаемые флаги.
    • -
    • Данные ответа — raw hex отображается и интерпретируется согласно команде (например, FCP-шаблоны SELECT).
    • -
    +

    4. Вкладка «Картридер» (pySim)

    +

    Подключение к локальному pysim-otaman-server для работы с картой: введите URL сервера (по умолчанию http://127.0.0.1:8080) и нажмите Подключиться. Область статуса показывает состояние ридера/карты, а Подключить карту (пере)инициализирует карту после вставки. Подвкладки: Файловый менеджер, Пользовательские файлы, Командная строка pySim и Отправка APDU. «Профайлер» и «Симулятор телефона» — отдельные вкладки верхнего уровня.

    - -
    -

    5. Вкладка «Картридер» (pySim)

    -

    Подключение к локальному pysim-otaman-server для работы с картой: введите URL сервера (по умолчанию http://127.0.0.1:8080) и нажмите Подключиться. Область статуса показывает состояние ридера/карты, а Подключить карту (пере)инициализирует карту после вставки. Подвкладки: Файловый менеджер, Пользовательские файлы, Профайлер, Командная строка pySim, Отправка APDU и Проактивный UICC.

    - -

    5.1 Файловый менеджер

    +

    4.1 Файловый менеджер

    Дерево файловой системы отображается слева; выбор файла открывает панель деталей справа.

    • Прочитать — чтение файла (автоопределение transparent/record)
    • @@ -323,48 +324,55 @@
    • Данные как на карте / Декодированные данные — переключение между hex-дампом и декодированным JSON
    -

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

    +

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

    Добавление файлов, не покрытых моделью pySim: введите полный путь (например, 3F00/7F20/6F46) и псевдоним (например, EF.SPN), затем нажмите Добавить; добавленные файлы появляются в дереве «Файловый менеджер». Список сохраняется в localStorage; обмен — Экспорт в JSON / Экспорт в файл и Импорт из файла / Вставить и импортировать / Импорт JSON из буфера.

    -

    5.3 Командная строка pySim

    +

    4.3 Командная строка pySim

    Выполнение любых команд pySim-shell с подсказками (300 мс) и автодополнением.

    -

    5.4 Отправка APDU

    +

    4.4 Отправка APDU

    Отправка произвольного APDU и просмотр ответа.

    -

    5.5 Проактивный UICC

    -

    Работа с сессией Card Application Toolkit: меню STK, подписанные события, журнал проактивных команд, словарь данных PROVIDE LOCAL INFORMATION и опрос STATUS.

    +

    4.5 Сценарии использования

    -

    5.5.1 Меню STK

    -

    Если карта выдала команду SET UP MENU, вверху этого представления появляется блок «Меню STK» с изумрудной кнопкой STK: <название>, открывающей оверлей меню (браузер STK-меню карты). Если карта не задала меню, вместо кнопки показывается «Меню не задано картой». Состояние меню обновляется при каждом открытии представления. Интерактивные проактивные команды всегда получают TERMINAL RESPONSE: оверлей ждёт вашего выбора, и если вы не ответили и не нажали Timeout, сервер сам отвечает результатом timeout через --menu-timeout секунд (по умолчанию 60, 0 отключает).

    +

    Сценарий A — Работа с файлами, не входящими в модель pySim («Пользовательские файлы»)

    +
      +
    1. Получите FID целевого файла (документация вендора или анализ ATR/файловой системы; такие файлы часто отсутствуют в открытых спецификациях).
    2. +
    3. Откройте вкладку «Картридер» → подвкладку «Пользовательские файлы».
    4. +
    5. Введите полный путь (например, 3F00/7F20/6F46) и псевдоним (например, EF.SPN).
    6. +
    7. Нажмите Добавить — файл появится в дереве курсивом (непроверенный).
    8. +
    9. Кликните по файлу для проверки существования; при успехе (9000) он работает как обычный файл.
    10. +
    11. Читайте, редактируйте и сохраняйте hex-данные; переключайте Данные как на карте / Декодированные данные.
    12. +
    13. Экспортируйте список пользовательских файлов в JSON для переноса на другие машины.
    14. +
    -

    5.5.2 Подписанные события (SET UP EVENT LIST)

    -

    События, которые отслеживает карта. У каждого события есть кнопка Отправить, открывающая форму, специфичную для типа события:

    +

    Сценарий B — Симуляция реальной сетевой среды для тестирования SIM

    +

    B.1 Ответы на PROVIDE LOCAL INFORMATION (PLI)

    +
      +
    1. Откройте Симулятор телефонаДанные для PROVIDE LOCAL INFORMATION.
    2. +
    3. Используйте формы декодирования/кодирования для IMEI (01), Location Info (00), Access Technology (06) и т.д.
    4. +
    5. Нажмите Сохранить — значения сохранятся на сервере.
    6. +
    7. Включите Опрос (интервал 30 с), чтобы карта периодически выдавала PLI.
    8. +
    9. Сервер вставляет значения словаря в каждый TERMINAL RESPONSE.
    10. +
    11. Проверьте в журнале проактивных команд: запись PLI покажет декодированный ответ.
    12. +
    +

    B.2 Симуляция сетевых действий через ENVELOPE (event download)

    +
      +
    1. Проверьте список подписанных событий (из SET UP EVENT LIST).
    2. +
    3. Нажмите Отправить на событии (например, Location Status) и заполните форму; будет отправлен ENVELOPE(Event Download).
    4. +
    5. Для Network Rejection выберите тип регистрации → поля местоположения → технологию доступа → причину отклонения.
    6. +
    7. Карта может ответить проактивной командой, которую обработчик цепочки зарегистрирует и обработает автоматически.
    8. +
    +

    B.3 Проверка симулированной среды

      -
    • События без данных (User Activity, Idle Screen, Data Available, …) — уведомление в один клик
    • -
    • Location Status — выпадающий список: Normal / Limited / No service (тег 9B)
    • -
    • Access Technology Change — 13 типов RAT (тег BF)
    • -
    • Network Rejection — полная адаптивная форма: тип регистрации (LU / GPRS / EPS / 5GS), поля местоположения (MCC, MNC, LAC, RAC, TAC), технология доступа и единый выпадающий список из 53 кодов причин (EMM, GMM, 5GMM и LU)
    • +
    • Журнал проактивных команд показывает полный цикл (команда + байты TERMINAL RESPONSE).
    • +
    • Кнопка Отправить STATUS / автопросмотр поддерживают сессию CAT (цикл дренажа).
    -

    Отправка события использует ENVELOPE(Event Download) по TS 102 223 / TS 131 111.

    -

    5.5.3 Журнал проактивных команд

    -

    Хронологический список извлечённых проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор (для команд, у которых он есть). Для команд с данными ответа показывается строка Ответ: с байтами TERMINAL RESPONSE (без служебных TLV); ответы PROVIDE LOCAL INFORMATION декодируются через словарь данных PLI.

    -

    5.5.4 Словарь данных PROVIDE LOCAL INFORMATION

    -

    Редактируемые hex-значения для всех 22 квалификаторов PLI (TS 102 223 §8.6 + TS 131 111). У десяти квалификаторов есть встроенные формы декодирования/кодирования:

    -
      -
    • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
    • -
    • 01 IMEI · 03 Дата/время/TZ · 04 Язык · 05 Timing Advance
    • -
    • 06 Access Technology · 08 IMEISV · 09 Search Mode
    • -
    • 0A Battery · 0E Multiple Access Technologies
    • -
    -

    Значения хранятся на сервере до перезапуска. Когда карта выдаёт PLI, сервер вставляет значения словаря в TERMINAL RESPONSE.

    -

    5.5.5 Опрос STATUS

    -

    Кнопка Отправить STATUS отправляет STATUS (F2) вручную. Переключатель Опрос включает фоновый опрос: после настраиваемого интервала бездействия (аргумент сервера --poll-interval, 1–255 с, по умолчанию 30 с, 0 отключает опрос) сервер отправляет STATUS и обрабатывает любую ожидающую проактивную команду. При извлечении карты опрос останавливается, а состояние карты сбрасывается.

    - -

    5.6 Профайлер

    +
    +

    5. Профайлер

    Проверяет соответствие карты именованному профилю — упорядоченному набору правил, описывающих ожидаемую файловую систему и (опционально) содержимое файлов. Профили хранятся в localStorage.

    Список профилей

      @@ -395,48 +403,49 @@
    • Сравнить снимки сравнивает два снимка без картридера так же, как проверка профиля: выберите эталонный снимок и снимок для проверки, при необходимости включите маску первых 4 байт EF.IMSI/EF.ICCID (включена по умолчанию) и получите такой же отчёт. Файлы, которые есть только в проверяемом снимке, помечаются как лишние. «К списку» возвращает на вкладку «Снимки карт».
    -

    5.7 Сценарии использования

    - -

    Сценарий A — Работа с файлами, не входящими в модель pySim («Пользовательские файлы»)

    -
      -
    1. Получите FID целевого файла (документация вендора или анализ ATR/файловой системы; такие файлы часто отсутствуют в открытых спецификациях).
    2. -
    3. Откройте вкладку «Картридер» → подвкладку «Пользовательские файлы».
    4. -
    5. Введите полный путь (например, 3F00/7F20/6F46) и псевдоним (например, EF.SPN).
    6. -
    7. Нажмите Добавить — файл появится в дереве курсивом (непроверенный).
    8. -
    9. Кликните по файлу для проверки существования; при успехе (9000) он работает как обычный файл.
    10. -
    11. Читайте, редактируйте и сохраняйте hex-данные; переключайте Данные как на карте / Декодированные данные.
    12. -
    13. Экспортируйте список пользовательских файлов в JSON для переноса на другие машины.
    14. -
    - -

    Сценарий B — Симуляция реальной сетевой среды для тестирования SIM

    -

    B.1 Ответы на PROVIDE LOCAL INFORMATION (PLI)

    -
      -
    1. Откройте Проактивный UICCДанные для PROVIDE LOCAL INFORMATION.
    2. -
    3. Используйте формы декодирования/кодирования для IMEI (01), Location Info (00), Access Technology (06) и т.д.
    4. -
    5. Нажмите Сохранить — значения сохранятся на сервере.
    6. -
    7. Включите Опрос (интервал 30 с), чтобы карта периодически выдавала PLI.
    8. -
    9. Сервер вставляет значения словаря в каждый TERMINAL RESPONSE.
    10. -
    11. Проверьте в журнале проактивных команд: запись PLI покажет декодированный ответ.
    12. -
    -

    B.2 Симуляция сетевых действий через ENVELOPE (event download)

    -
      -
    1. Проверьте список подписанных событий (из SET UP EVENT LIST).
    2. -
    3. Нажмите Отправить на событии (например, Location Status) и заполните форму; будет отправлен ENVELOPE(Event Download).
    4. -
    5. Для Network Rejection выберите тип регистрации → поля местоположения → технологию доступа → причину отклонения.
    6. -
    7. Карта может ответить проактивной командой, которую обработчик цепочки зарегистрирует и обработает автоматически.
    8. -
    -

    B.3 Проверка симулированной среды

    -
      -
    • Журнал проактивных команд показывает полный цикл (команда + байты TERMINAL RESPONSE).
    • -
    • Кнопка Отправить STATUS / автопросмотр поддерживают сессию CAT (цикл дренажа).
    • -
    +
    -

    6. Установка сервера

    -

    Для работы с картой (вкладка «Картридер», «Проактивный UICC», доставка OTA) нужен локальный pysim-otaman-server — встроенный в OTAMan HTTP-сервер, оборачивающий pySim, работающий с ридером через PC/SC или serial и раздающий сам PWA (откройте http://127.0.0.1:8080).

    +

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

    +

    Работа с сессией Card Application Toolkit: меню STK, подписанные события, журнал проактивных команд, словарь данных PROVIDE LOCAL INFORMATION и опрос STATUS.

    -

    6.1 Требования

    +

    Меню STK

    +

    Если карта выдала команду SET UP MENU, вверху этого представления появляется блок «Меню STK» с изумрудной кнопкой STK: <название>, открывающей оверлей меню (браузер STK-меню карты). Если карта не задала меню, вместо кнопки показывается «Меню не задано картой». Состояние меню обновляется при каждом открытии представления. Интерактивные проактивные команды всегда получают TERMINAL RESPONSE: оверлей ждёт вашего выбора, и если вы не ответили и не нажали Timeout, сервер сам отвечает результатом timeout через --menu-timeout секунд (по умолчанию 60, 0 отключает).

    + +

    6.2 Подписанные события (SET UP EVENT LIST)

    +

    События, которые отслеживает карта. У каждого события есть кнопка Отправить, открывающая форму, специфичную для типа события:

    +
      +
    • События без данных (User Activity, Idle Screen, Data Available, …) — уведомление в один клик
    • +
    • Location Status — выпадающий список: Normal / Limited / No service (тег 9B)
    • +
    • Access Technology Change — 13 типов RAT (тег BF)
    • +
    • Network Rejection — полная адаптивная форма: тип регистрации (LU / GPRS / EPS / 5GS), поля местоположения (MCC, MNC, LAC, RAC, TAC), технология доступа и единый выпадающий список из 53 кодов причин (EMM, GMM, 5GMM и LU)
    • +
    +

    Отправка события использует ENVELOPE(Event Download) по TS 102 223 / TS 131 111.

    + +

    6.3 Журнал проактивных команд

    +

    Хронологический список извлечённых проактивных команд. Каждая строка показывает время, код типа, имя и декодированный квалификатор (для команд, у которых он есть). Для команд с данными ответа показывается строка Ответ: с байтами TERMINAL RESPONSE (без служебных TLV); ответы PROVIDE LOCAL INFORMATION декодируются через словарь данных PLI.

    + +

    6.4 Словарь данных PROVIDE LOCAL INFORMATION

    +

    Редактируемые hex-значения для всех 22 квалификаторов PLI (TS 102 223 §8.6 + TS 131 111). У десяти квалификаторов есть встроенные формы декодирования/кодирования:

    +
      +
    • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
    • +
    • 01 IMEI · 03 Дата/время/TZ · 04 Язык · 05 Timing Advance
    • +
    • 06 Access Technology · 08 IMEISV · 09 Search Mode
    • +
    • 0A Battery · 0E Multiple Access Technologies
    • +
    +

    Значения хранятся на сервере до перезапуска. Когда карта выдаёт PLI, сервер вставляет значения словаря в TERMINAL RESPONSE.

    + +

    6.5 Опрос STATUS

    +

    Кнопка Отправить STATUS отправляет STATUS (F2) вручную. Переключатель Опрос включает фоновый опрос: после настраиваемого интервала бездействия (аргумент сервера --poll-interval, 1–255 с, по умолчанию 30 с, 0 отключает опрос) сервер отправляет STATUS и обрабатывает любую ожидающую проактивную команду. При извлечении карты опрос останавливается, а состояние карты сбрасывается.

    + +
    + +
    +

    7. Установка сервера

    +

    Для работы с картой (вкладка «Картридер», «Симулятор телефона», доставка OTA) нужен локальный pysim-otaman-server — встроенный в OTAMan HTTP-сервер, оборачивающий pySim, работающий с ридером через PC/SC или serial и раздающий сам PWA (откройте http://127.0.0.1:8080).

    + +

    7.1 Требования

    • Python 3.8+ с pip
    • Git
    • @@ -444,20 +453,20 @@
    • Только Windows — используйте Python 3.10–3.13 (рекомендуется 3.13): pyscard (обёртка драйвера PC/SC) поставляет готовые wheels для этих версий. На Python 3.9 / 3.14 pip собирает pyscard из исходников, для чего требуются Microsoft C++ Build Tools («Desktop development with C++»). Мост SMPP (smpp.twisted3) на Windows намеренно не устанавливается, поэтому для Python 3.10–3.13 C++ Build Tools не нужны.
    -

    6.2 Быстрый старт — Linux / macOS

    +

    7.2 Быстрый старт — Linux / macOS

    git clone https://github.com/anttro/otaman.git
     cd otaman
     chmod +x setup.sh start.sh
     ./setup.sh          # создаёт .venv, устанавливает pysim + сервер (однократно)
     ./start.sh          # запускает сервер (PWA + API, автоопределение ридера)
    -

    6.3 Быстрый старт — Windows

    +

    7.3 Быстрый старт — Windows

    git clone https://github.com/anttro/otaman.git
     cd otaman
     setup.bat           # создаёт .venv, устанавливает pysim + сервер (однократно)
     start.bat           # запускает сервер (PWA + API)
    -

    6.4 Вспомогательные скрипты

    +

    7.4 Вспомогательные скрипты

    @@ -466,7 +475,7 @@ start.bat # запускает сервер (PWA + API)
    СкриптНазначение
    -

    6.5 Автоопределение ридера

    +

    7.5 Автоопределение ридера

    • PC/SC (Linux)start.sh передаёт -p 0, если запущен демон pcscd
    • PC/SC (Windows)start.bat всегда использует -p 0 (PC/SC встроен в Windows)
    • @@ -475,7 +484,7 @@ start.bat # запускает сервер (PWA + API)

    Если карта отсутствует, вкладка «Картридер» показывает «Карта не обнаружена. Вставьте карту и нажмите Подключить карту».

    -

    6.6 Ручная установка

    +

    7.6 Ручная установка

    # Создать и активировать venv
     python3 -m venv .venv
     source .venv/bin/activate   # Linux/macOS
    @@ -494,7 +503,7 @@ pysim-otaman-server --http-port 8080
    -

    7. Совместимость версий

    +

    8. Совместимость версий

    diff --git a/frontend/help.html b/frontend/help.html index 49fb166..8ccd842 100644 --- a/frontend/help.html +++ b/frontend/help.html @@ -44,13 +44,14 @@
    • Header — the app version, an INSTALL PWA button (shown when the browser offers installation, enabling offline use), links to the project on GitHub and to this help, an EN/RU language toggle, and a dark/light theme toggle.
    • Language and theme choices are stored in localStorage and persist across reloads.
    • -
    • The help link opens this documentation at the section matching the current view (e.g. the Profiler sub-tab opens §5.6).
    • +
    • Top-level tabs: Remote APDU (SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, C-APDU Parser, Response parser), SCP80 (Secured Packet, Cards, RAM), Card reader (File manager, Custom files, pySim command line, Raw APDU), Profiler, and Phone simulator.
    • +
    • The help link opens this documentation at the section matching the current view (e.g. the Profiler tab opens §5).
    -

    2. C-APDU tab

    -

    Builds command APDUs (C-APDUs). Six sub-tabs cover different card generations and command sets: SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, and C-APDU Parser.

    +

    2. Remote APDU tab

    +

    Builds command APDUs (C-APDUs). Seven sub-tabs cover different card generations, command sets and decoding tools: SIM RFM, USIM RFM, Expanded Script, RAM/GP, HTTP OTA, C-APDU Parser, and Response parser.

    2.1 SIM RFM

    CLA = A0 (GSM 11.11 / TS 151 011, ISO 7816-4). Remote File Management for classic SIM cards.

    @@ -138,7 +139,7 @@

    Response decoding (TS 102 226 §5.2.2)

    -

    Incoming Proof-of-Receipt responses are decoded by the server — expanded Remote Application response data (TS 102 226 §5.2.2) or the compact format. The Secured Packet view shows the outcome after Send to Card (see §3.1): the PoR status (TAR, counter, raw PoR), with the last command’s status word and response data filled into the Response parser tab.

    +

    Incoming Proof-of-Receipt responses are decoded by the server — expanded Remote Application response data (TS 102 226 §5.2.2) or the compact format. The Secured Packet view shows the outcome after Send to Card (see §3.1): the PoR status (TAR, counter, raw PoR), with the last command’s status word and response data filled into the Response parser pill under Remote APDU.

    2.4 RAM/GP

    CLA = 80 (GlobalPlatform Card Specification v2.3.1). Remote Application Management commands for card content management. Built with the same chain builder as SIM/USIM: add rows, fill fields, and the chain preview updates automatically.

    @@ -227,6 +228,17 @@

    Pack into Secured packet sends the built payload to the SCP80 tab for SPI/counter filling — insert the TAR the SD listens on (typically the OTASD TAR) there.

    + +

    2.8 Response parser

    +

    Decodes a raw command response: pick the command that was sent, enter the SW (e.g. 9000) and the response data hex, then press Decode. The fields are also auto-filled with the last command’s status word and response data after a successful “Send to Card” (see §3.1).

    +
      +
    • Command — SIM/USIM group (SELECT, STATUS, READ/UPDATE, PIN ops, CAT commands like TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, …) or RAM/GP group (INSTALL, LOAD, DELETE, GET/STORE DATA, auth, SCP commands).
    • +
    • SW decode — status words resolved against generic, UICC (TS 102 221), and GlobalPlatform maps, with context auto-detected.
    • +
    • Privilege decode — GET DATA / INSTALL response payloads decode the privilege bytes into human-readable flags.
    • +
    • Response data — raw hex rendered and interpreted per command (e.g. SELECT FCP templates).
    • +
    + +

    3. SCP80 tab

    The SCP80 top-level tab groups the SCP80-related views. It is switched by three pills: Secured Packet, Cards, and RAM. Assembles SCP80 secured packets per ETSI TS 102 225.

    @@ -301,21 +313,10 @@
    -

    4. Response parser tab

    -

    Decodes a raw command response: pick the command that was sent, enter the SW (e.g. 9000) and the response data hex, then press Decode. The fields are also auto-filled with the last command’s status word and response data after a successful “Send to Card” (see §3.1).

    -
      -
    • Command — SIM/USIM group (SELECT, STATUS, READ/UPDATE, PIN ops, CAT commands like TERMINAL PROFILE/ENVELOPE/FETCH/TERMINAL RESPONSE, MANAGE CHANNEL, …) or RAM/GP group (INSTALL, LOAD, DELETE, GET/STORE DATA, auth, SCP commands).
    • -
    • SW decode — status words resolved against generic, UICC (TS 102 221), and GlobalPlatform maps, with context auto-detected.
    • -
    • Privilege decode — GET DATA / INSTALL response payloads decode the privilege bytes into human-readable flags.
    • -
    • Response data — raw hex rendered and interpreted per command (e.g. SELECT FCP templates).
    • -
    +

    4. Card reader (pySim) tab

    +

    Connects to a local pysim-otaman-server for live card operations: enter the server URL (default http://127.0.0.1:8080) and press Connect. The status area shows the reader/card state, and Equip card (re)initializes the card after insertion. Sub-tabs: File manager, Custom files, pySim command line, and Raw APDU. The Profiler and Phone simulator are separate top-level tabs.

    - -
    -

    5. Card reader (pySim) tab

    -

    Connects to a local pysim-otaman-server for live card operations: enter the server URL (default http://127.0.0.1:8080) and press Connect. The status area shows the reader/card state, and Equip card (re)initializes the card after insertion. Sub-tabs: File manager, Custom files, Profiler, pySim command line, Raw APDU, and Proactive UICC.

    - -

    5.1 File manager

    +

    4.1 File manager

    The file system tree is displayed on the left; selecting a file opens its detail pane on the right.

    • Read — reads the selected file (auto-detects transparent vs record files)
    • @@ -323,48 +324,55 @@
    • Raw / Decoded — toggle between hex dump and pySim-decoded JSON
    -

    5.2 Custom files

    +

    4.2 Custom files

    Add files that pySim’s model does not cover: enter the full path (e.g. 3F00/7F20/6F46) and an alias (e.g. EF.SPN), then press Add; added files appear in the File manager tree. The list persists in localStorage and can be shared with Export as JSON / Export to file and restored with Import from file / Paste & import / Import JSON from clipboard.

    -

    5.3 pySim command line

    +

    4.3 pySim command line

    Execute any pySim-shell command with usage hints (300 ms) and autocomplete.

    -

    5.4 Raw APDU

    +

    4.4 Raw APDU

    Send an arbitrary APDU and view the raw response.

    -

    5.5 Proactive UICC

    -

    Interacts with the Card Application Toolkit session: the STK menu, subscribed events, the proactive command log, the PROVIDE LOCAL INFORMATION data dictionary, and STATUS polling.

    +

    4.5 Usage scenarios

    -

    5.5.1 STK menu

    -

    When the card has issued a SET UP MENU command, a “STK menu” block appears at the top of this view with an emerald STK: <title> button that opens the menu overlay (same as the card’s STK menu browser). If the card has not set up a menu, the block shows “No menu set by the card” instead. The menu state is refreshed each time the view is opened. User-interactive proactive commands always get a TERMINAL RESPONSE: the overlay pauses for your choice, and if you neither answer nor press Timeout, the server answers with a timeout result after the --menu-timeout seconds (default 60, 0 disables).

    +

    Scenario A — Working with files not in pySim’s model (Custom files)

    +
      +
    1. Obtain the FID of the target file (vendor documentation or ATR/file-system analysis; such files are often not in public specs).
    2. +
    3. Open the Card reader tab → Custom files sub-tab.
    4. +
    5. Enter the full path (e.g. 3F00/7F20/6F46) and an alias (e.g. EF.SPN).
    6. +
    7. Click Add — the file appears in the tree in italics (unverified).
    8. +
    9. Click the file to verify existence; on success (9000) it behaves like a normal file.
    10. +
    11. Read, edit and save hex data; toggle Raw/Decoded views.
    12. +
    13. Export the custom-file list as JSON to share with other machines.
    14. +
    -

    5.5.2 Subscribed events (SET UP EVENT LIST)

    -

    The events the card monitors. Each event has a Send button that opens a form specific to the event type:

    +

    Scenario B — Simulating a real network environment for SIM testing

    +

    B.1 Answer PROVIDE LOCAL INFORMATION (PLI)

    +
      +
    1. Open Phone simulatorPROVIDE LOCAL INFORMATION response data.
    2. +
    3. Use the decode/encode forms to set IMEI (01), Location Info (00), Access Technology (06), etc.
    4. +
    5. Click Save — values persist server-side.
    6. +
    7. Enable Polling (interval 30 s) so the card issues PLI periodically.
    8. +
    9. The server injects the dictionary values into each TERMINAL RESPONSE.
    10. +
    11. Verify in the proactive log: the PLI entry shows the decoded response.
    12. +
    +

    B.2 Simulate network actions via ENVELOPE (event download)

    +
      +
    1. Check the subscribed events list (from SET UP EVENT LIST).
    2. +
    3. Click Send on an event (e.g. Location Status) and fill the form; an ENVELOPE(Event Download) is sent.
    4. +
    5. For Network Rejection, select registration type → location fields → access technology → rejection cause.
    6. +
    7. The card may respond with a proactive command, which the chain handler logs and answers automatically.
    8. +
    +

    B.3 Verify the simulated environment

      -
    • No-data events (User Activity, Idle Screen, Data Available, …) — one-click notification
    • -
    • Location Status — dropdown: Normal / Limited / No service (tag 9B)
    • -
    • Access Technology Change — 13 RAT types (tag BF)
    • -
    • Network Rejection — full adaptive form: registration type (LU / GPRS / EPS / 5GS), location fields (MCC, MNC, LAC, RAC, TAC), access technology, and a 53-cause unified rejection cause dropdown covering EMM, GMM, 5GMM and LU causes
    • +
    • The proactive command log shows the full round-trip (command + TERMINAL RESPONSE bytes).
    • +
    • The STATUS button / auto-polling keep the CAT session alive (drain loop).
    -

    Sending an event uses ENVELOPE(Event Download) per TS 102 223 / TS 131 111.

    -

    5.5.3 Proactive command log

    -

    Chronological list of fetched proactive commands. Each row shows the elapsed time, type code, name, and a decoded qualifier (for commands that have one). Commands with response data show a Response: line with the TERMINAL RESPONSE bytes (boilerplate TLVs stripped); PROVIDE LOCAL INFORMATION responses are decoded using the PLI data dictionary decoders.

    -

    5.5.4 PROVIDE LOCAL INFORMATION data dictionary

    -

    Editable hex values for all 22 PLI qualifiers (TS 102 223 §8.6 + TS 131 111). Ten qualifiers have inline decode/encode forms:

    -
      -
    • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
    • -
    • 01 IMEI · 03 Date/Time/TZ · 04 Language · 05 Timing Advance
    • -
    • 06 Access Technology · 08 IMEISV · 09 Search Mode
    • -
    • 0A Battery · 0E Multiple Access Technologies
    • -
    -

    Values persist server-side until restart. When the card issues PLI, the server injects the dictionary values into the TERMINAL RESPONSE.

    -

    5.5.5 STATUS polling

    -

    A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s, 0 disables polling) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.

    - -

    5.6 Profiler

    +
    +

    5. Profiler

    Verifies that a card matches a named profile — an ordered set of rules describing the expected file system and (optionally) file contents. Profiles are stored in localStorage.

    Profile list

      @@ -395,48 +403,49 @@
    • Compare snapshots compares two snapshots offline, exactly like a profile check: pick the master snapshot and the snapshot to check, optionally masking the first 4 bytes of EF.IMSI/EF.ICCID (on by default), and get the same pass/fail report. Files present only in the checked snapshot are reported as extra files. Back to list returns to the Card snapshots tab.
    -

    5.7 Usage scenarios

    - -

    Scenario A — Working with files not in pySim’s model (Custom files)

    -
      -
    1. Obtain the FID of the target file (vendor documentation or ATR/file-system analysis; such files are often not in public specs).
    2. -
    3. Open the Card reader tab → Custom files sub-tab.
    4. -
    5. Enter the full path (e.g. 3F00/7F20/6F46) and an alias (e.g. EF.SPN).
    6. -
    7. Click Add — the file appears in the tree in italics (unverified).
    8. -
    9. Click the file to verify existence; on success (9000) it behaves like a normal file.
    10. -
    11. Read, edit and save hex data; toggle Raw/Decoded views.
    12. -
    13. Export the custom-file list as JSON to share with other machines.
    14. -
    - -

    Scenario B — Simulating a real network environment for SIM testing

    -

    B.1 Answer PROVIDE LOCAL INFORMATION (PLI)

    -
      -
    1. Open Proactive UICCPROVIDE LOCAL INFORMATION response data.
    2. -
    3. Use the decode/encode forms to set IMEI (01), Location Info (00), Access Technology (06), etc.
    4. -
    5. Click Save — values persist server-side.
    6. -
    7. Enable Polling (interval 30 s) so the card issues PLI periodically.
    8. -
    9. The server injects the dictionary values into each TERMINAL RESPONSE.
    10. -
    11. Verify in the proactive log: the PLI entry shows the decoded response.
    12. -
    -

    B.2 Simulate network actions via ENVELOPE (event download)

    -
      -
    1. Check the subscribed events list (from SET UP EVENT LIST).
    2. -
    3. Click Send on an event (e.g. Location Status) and fill the form; an ENVELOPE(Event Download) is sent.
    4. -
    5. For Network Rejection, select registration type → location fields → access technology → rejection cause.
    6. -
    7. The card may respond with a proactive command, which the chain handler logs and answers automatically.
    8. -
    -

    B.3 Verify the simulated environment

    -
      -
    • The proactive command log shows the full round-trip (command + TERMINAL RESPONSE bytes).
    • -
    • The STATUS button / auto-polling keep the CAT session alive (drain loop).
    • -
    +
    -

    6. Server installation

    -

    Live card operations (Card reader tab, Proactive UICC, OTA delivery) require the local pysim-otaman-server — a small HTTP server bundled with OTAMan that wraps pySim, talks to the reader over PC/SC or serial, and also serves the PWA itself (open http://127.0.0.1:8080).

    +

    6. Phone simulator

    +

    Interacts with the Card Application Toolkit session: the STK menu, subscribed events, the proactive command log, the PROVIDE LOCAL INFORMATION data dictionary, and STATUS polling.

    -

    6.1 Prerequisites

    +

    STK menu

    +

    When the card has issued a SET UP MENU command, a “STK menu” block appears at the top of this view with an emerald STK: <title> button that opens the menu overlay (same as the card’s STK menu browser). If the card has not set up a menu, the block shows “No menu set by the card” instead. The menu state is refreshed each time the view is opened. User-interactive proactive commands always get a TERMINAL RESPONSE: the overlay pauses for your choice, and if you neither answer nor press Timeout, the server answers with a timeout result after the --menu-timeout seconds (default 60, 0 disables).

    + +

    6.2 Subscribed events (SET UP EVENT LIST)

    +

    The events the card monitors. Each event has a Send button that opens a form specific to the event type:

    +
      +
    • No-data events (User Activity, Idle Screen, Data Available, …) — one-click notification
    • +
    • Location Status — dropdown: Normal / Limited / No service (tag 9B)
    • +
    • Access Technology Change — 13 RAT types (tag BF)
    • +
    • Network Rejection — full adaptive form: registration type (LU / GPRS / EPS / 5GS), location fields (MCC, MNC, LAC, RAC, TAC), access technology, and a 53-cause unified rejection cause dropdown covering EMM, GMM, 5GMM and LU causes
    • +
    +

    Sending an event uses ENVELOPE(Event Download) per TS 102 223 / TS 131 111.

    + +

    6.3 Proactive command log

    +

    Chronological list of fetched proactive commands. Each row shows the elapsed time, type code, name, and a decoded qualifier (for commands that have one). Commands with response data show a Response: line with the TERMINAL RESPONSE bytes (boilerplate TLVs stripped); PROVIDE LOCAL INFORMATION responses are decoded using the PLI data dictionary decoders.

    + +

    6.4 PROVIDE LOCAL INFORMATION data dictionary

    +

    Editable hex values for all 22 PLI qualifiers (TS 102 223 §8.6 + TS 131 111). Ten qualifiers have inline decode/encode forms:

    +
      +
    • 00 Location Info (MCC, MNC, LAC/TAC, Cell ID)
    • +
    • 01 IMEI · 03 Date/Time/TZ · 04 Language · 05 Timing Advance
    • +
    • 06 Access Technology · 08 IMEISV · 09 Search Mode
    • +
    • 0A Battery · 0E Multiple Access Technologies
    • +
    +

    Values persist server-side until restart. When the card issues PLI, the server injects the dictionary values into the TERMINAL RESPONSE.

    + +

    6.5 STATUS polling

    +

    A Send STATUS button issues a manual STATUS (F2). A Polling toggle enables background polling: after a configurable idle interval (server CLI --poll-interval, 1–255 s, default 30 s, 0 disables polling) the server sends STATUS and handles any pending proactive command. Polling stops and card state resets if the card is removed.

    + +
    + +
    +

    7. Server installation

    +

    Live card operations (Card reader tab, Phone simulator, OTA delivery) require the local pysim-otaman-server — a small HTTP server bundled with OTAMan that wraps pySim, talks to the reader over PC/SC or serial, and also serves the PWA itself (open http://127.0.0.1:8080).

    + +

    7.1 Prerequisites

    • Python 3.8+ with pip
    • Git
    • @@ -444,20 +453,20 @@
    • Windows only — use Python 3.10–3.13 (3.13 recommended): pyscard (the PC/SC driver wrapper) ships precompiled wheels for these versions. On Python 3.9 / 3.14 pip builds pyscard from source, which requires Microsoft C++ Build Tools (“Desktop development with C++”). The SMPP bridge (smpp.twisted3) is intentionally not installed on Windows, so no C++ Build Tools are needed for Python 3.10–3.13.
    -

    6.2 Quick start — Linux / macOS

    +

    7.2 Quick start — Linux / macOS

    git clone https://github.com/anttro/otaman.git
     cd otaman
     chmod +x setup.sh start.sh
     ./setup.sh          # creates .venv, installs pysim + server (run once)
     ./start.sh          # starts the server (serves PWA + API, auto-detects reader)
    -

    6.3 Quick start — Windows

    +

    7.3 Quick start — Windows

    git clone https://github.com/anttro/otaman.git
     cd otaman
     setup.bat           # creates .venv, installs pysim + server (run once)
     start.bat           # starts the server (serves PWA + API)
    -

    6.4 Helper scripts

    +

    7.4 Helper scripts

    PWA (OTAMan)СерверСтатус
    @@ -466,7 +475,7 @@ start.bat # starts the server (serves PWA + API)
    ScriptPurpose
    -

    6.5 Reader auto-detection

    +

    7.5 Reader auto-detection

    • PC/SC (Linux)start.sh passes -p 0 when the pcscd daemon is running
    • PC/SC (Windows)start.bat always uses -p 0 (PC/SC is built into Windows)
    • @@ -475,7 +484,7 @@ start.bat # starts the server (serves PWA + API)

    If no card is present, the Card reader tab shows “No card detected”. Insert the card and click Equip card to initialize it.

    -

    6.6 Manual installation

    +

    7.6 Manual installation

    # Create and activate a venv
     python3 -m venv .venv
     source .venv/bin/activate   # Linux/macOS
    @@ -494,7 +503,7 @@ pysim-otaman-server --http-port 8080
    -

    7. Version compatibility

    +

    8. Version compatibility

    diff --git a/frontend/index.html b/frontend/index.html index 1b88755..69102f1 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -28,23 +28,25 @@ -
    - +
    + - + +
    -
    +
    +
    @@ -256,6 +258,76 @@
    + +
    @@ -661,75 +733,6 @@
    -
    PWA (OTAMan)ServerStatus