Files
Button/tools/inspect-bundle.py
T
2026-08-24 16:40:48 +03:00

15 lines
546 B
Python

#!/usr/bin/env python3
import json
import sys
import tarfile
path = sys.argv[1]
with tarfile.open(path) as t:
install = t.extractfile("./device-install.sh").read().decode()
cfg = json.loads(t.extractfile("./config/config.json").read().decode())
print("reset_support:", "BUTTONTASK_RESET_CONFIG" in install)
print("password:", cfg.get("settings", {}).get("password"))
print("buttons:", len(cfg.get("buttons", [])))
for b in cfg.get("buttons", []):
print(" -", b.get("id"), b.get("label"), (b.get("action") or {}).get("url", "")[:50])