sieflasher/cli/package.json
Konstantin Pereiaslov c447595406
Add apply and revert commands
`sieflasher apply` / `sieflasher revert` write a VKP patch into a phone or
undo it again, with the same options as the other phone commands
(--serial, --loader, --phone, --baud) plus --file to patch a fullflash
dump in place. The patch is a positional .vkp path or comes from stdin.

The warnings of V_KLay's PatchDataConvert (the old data of the patch is
not in the flash, or the patch has no old data at all) are asked on
/dev/tty, so a patch piped through stdin still gets an interactive
prompt; without a terminal they are declined and nothing is written
(--yes confirms them, --force writes without asking and without a
recovery patch, --dry-run only checks). When a warning is confirmed, the
recovery patch the core generates is saved into ~/.sieflasher/recovery
before the first write and its path is printed: undoing it restores the
original flash contents. A patch reaching outside of the flash is now
rejected before the phone is booted instead of being written in part.

Every real apply and revert is logged into ~/.sieflasher/history as the
patch text plus a JSON sidecar (date, action, device, patch, writes,
written bytes, result and the recovery patch), the file system analog of
the web tools patch history and of V_KLay's DoPatchLogging. The root
follows SIEFLASHER_HOME and is %APPDATA%\sieflasher on Windows.

The e2e suite gains the patches of the new tests/patches submodule
(github.com/siemens-mobile-hacks/patches): every patch of the firmware of
a fullflash is applied to a fresh copy of it as a file and undone again,
the 10 most unusual ones per phone additionally in a real flasher session
over the emulator serial port, one of them is undone there as well, and
one patch that does not apply cleanly is forced through to check that the
recovery patch restores the fullflash. Patches that do not apply cleanly
must leave the flash untouched; their status is tracked in
tests/patches-status.json and a change of it fails the run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012nptCSUpWj9mfqzrAt1yCG
2026-09-13 02:56:15 -05:00

34 lines
849 B
JSON

{
"name": "@sie-js/flasher-cli",
"version": "0.1.0",
"description": "The sieflasher command line tool: flashing the old Siemens phones from the terminal.",
"type": "module",
"bin": {
"sieflasher": "./dist/index.js"
},
"files": [
"./dist/*"
],
"scripts": {
"build": "tsc -p tsconfig.json",
"dev": "tsc -p tsconfig.json --watch",
"test": "node --test tests/*.test.mjs"
},
"license": "MIT",
"repository": {
"url": "git+https://github.com/siemens-mobile-hacks/sieflasher.git",
"directory": "cli"
},
"dependencies": {
"@sie-js/flasher": "workspace:*",
"@sie-js/node-serialport-bindings-cpp": "^0.0.2",
"@sie-js/serial": "^1.1.19",
"@sie-js/vkp": "^2.0.2",
"@serialport/stream": "^13.0.0",
"serialport-bindings-socket": "^1.0.4"
},
"devDependencies": {
"@types/node": "^22.19.15",
"typescript": "^5.9.3"
}
}