v1.8.0: proactive log overhaul, Expanded Script rename, proactive view sizing

Server:
- Track all TERMINAL RESPONSEs (chain, TP, pySim auto-handler, menu-respond
  link to paused entry) with shared _build_tr/_record_tr
- Log entry ids + cmd_num; server-side decode of fetched commands and TRs
  (compact PLI port); Result CTLV extracted as tr_result/tr_result_name
- _LoggingApduTracer captures TR SW for pySim auto-handler responses
- _DefaultProactiveHandler answers PLI with editor data (no re-request)
- VERSION 1.8.0

Frontend:
- Expandable proactive log rows (click to expand, state survives re-render)
- Response section: Result name + hex, decoded fields, width-restrained
  readonly hex inputs; no SW display
- Rename Expanded Script tab/pill/button/docs; proactive UICC view font
  sizing increase; card reader pills text-sm
This commit is contained in:
2026-08-19 18:04:08 +03:00
parent a916e8a255
commit 80a860549a
11 changed files with 563 additions and 124 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ from pySim.log import PySimLogger
from pySim.cards import UiccCardBase
from .shell import load_pysim_app
from .server import PysimHandler, StderrApduTracer, VERSION, _send_terminal_profile, _DefaultProactiveHandler, _handle_proactive_chain, _send_status, _init_proactive_session
from .server import PysimHandler, StderrApduTracer, _LoggingApduTracer, VERSION, _send_terminal_profile, _DefaultProactiveHandler, _handle_proactive_chain, _send_status, _init_proactive_session
_server_start = 0
@@ -59,7 +59,7 @@ def main():
try:
kwargs = {}
if opts.apdu_trace:
kwargs['apdu_tracer'] = StderrApduTracer()
kwargs['apdu_tracer'] = _LoggingApduTracer()
sl = mod.init_reader(opts, **kwargs)
scc = SimCardCommands(sl)
scc.cat_cla = '80' # UICC CLA default; overridden for SIM after init_card
@@ -78,7 +78,7 @@ def main():
traceback.print_exc()
app = None
if scc and hasattr(scc, '_tp'):
scc._tp.apdu_tracer = StderrApduTracer()
scc._tp.apdu_tracer = _LoggingApduTracer()
try:
_init_proactive_session()
sys.stderr.write('INIT: sending TERMINAL PROFILE %s (CLA=%s)\n' % (opts.terminal_profile, scc.cat_cla))
@@ -104,7 +104,7 @@ def main():
# PysimApp.__init__ and every `equip` wipe the transport apdu_tracer
# (_onchange_apdu_trace sets it to None). Re-attach our tracer and make
# sure it stays attached across equip/re-equip.
tracer = StderrApduTracer()
tracer = _LoggingApduTracer()
def _reattach_tracer():
if app.card:
app.card._scc._tp.apdu_tracer = tracer