How patrislav1/unisoc-unlock works
unisoc-unlock is a Python tool for locking or unlocking a Unisoc/Spreadtrum Android bootloader. The user selects a command; the tool connects to the device in fastboot mode, requests and extracts its identifier token, signs the token with the bundled key, downloads the signature, then issues the lock or unlock command. The bundled fastboot implementation handles protocol messages over USB, with shared device discovery and transport code. The README also documents platform support and on-device confirmation. Some fastboot implementation details are unsampled, so the graph limits those connections to relationships visible in excerpts or documented behavior.
Main entry points: fastboot.py Fastboot commands · cli.py Bootloader command · common.py USB transport · usb_exceptions.py USB exceptions
Components 12
Unlock workflow
- CLI command
src/unisoc_unlock/cli.py - Bootloader command
src/unisoc_unlock/cli.py - Token extraction
src/unisoc_unlock/cli.py - Token signing
src/unisoc_unlock/cli.py - Module entry
src/unisoc_unlock/__main__.py
Fastboot protocol
- Fastboot commands
src/unisoc_unlock/bundled_adb/fastboot.py - Fastboot protocol
src/unisoc_unlock/bundled_adb/fastboot.py
Device transport
- USB transport
src/unisoc_unlock/bundled_adb/common.py
Errors and key
- Bundled signing key
src/unisoc_unlock/rsa4096_vbmeta.pem - USB exceptions
src/unisoc_unlock/bundled_adb/usb_exceptions.py
Other components
- User
- Unisoc device
Connections 16
- User → CLI command: selects command
README.md - Module entry → CLI command: calls main
src/unisoc_unlock/__main__.py - CLI command → Bootloader command: dispatches command
src/unisoc_unlock/cli.py - Bootloader command → Fastboot commands: connects and requests token
src/unisoc_unlock/cli.py - Fastboot commands → Token extraction: passes response callback
src/unisoc_unlock/cli.py - Bootloader command → Token signing: signs extracted token
src/unisoc_unlock/cli.py - Token signing → Bundled signing key: loads key
src/unisoc_unlock/cli.py - Bootloader command → Fastboot commands: downloads signature and sends lock command
src/unisoc_unlock/cli.py - Fastboot commands → Fastboot protocol: dispatches commands
src/unisoc_unlock/bundled_adb/fastboot.py - Fastboot protocol → USB transport: reads and writes packets
src/unisoc_unlock/bundled_adb/fastboot.py - Fastboot commands → USB transport: discovers devices
src/unisoc_unlock/bundled_adb/fastboot.py - USB transport → Unisoc device: communicates over USB
README.md - Fastboot protocol → Unisoc device: exchanges fastboot messages
src/unisoc_unlock/bundled_adb/fastboot.py - Fastboot commands → USB exceptions: raises device errors
src/unisoc_unlock/bundled_adb/fastboot.py - USB transport → USB exceptions: wraps USB failures
src/unisoc_unlock/bundled_adb/common.py - Unisoc device → User: requests confirmation
README.md