Skip to content

Device identity and key storage

devinfo

devinfo is the central read-only identity formatter used by boot, OTA, USB, and self-check scripts. With no filter it emits shell assignments including:

  • SERIAL
  • MODEL
  • PLATFORM
  • HW_VERSION
  • FW_VERSION
  • SW_VERSION
  • DEVICE_ID
  • DEVICE_ID_FULL
  • DEVICE_STATE

Filters include --id, --id-full, --serial, --model, --hw, --fw, --sw, --fwlabel, and --state. The option string --platofrm is misspelled in the binary; use the default output or verify the exact build before relying on that filter.

S89 evaluates devinfo --serial for the USB serial. Self-check evaluates full devinfo output for FW_VERSION. S25 moves /etc/fwlabel to /data/fwlabel, where it survives normal factory cleanup.

Unifykeys backend

Observed from strings and the unifykey shell script: identity is backed by kernel sysfs nodes:

  • /sys/class/unifykeys/name
  • /sys/class/unifykeys/read
  • /sys/class/unifykeys/write
  • /sys/class/unifykeys/lock
  • /sys/class/unifykeys/attach

The serial reader selects key deviceid and also parses /proc/cpuinfo Serial where needed. devinfo checks /data/DEVICE_TEST_REQUIRED when deriving device state.

unifykey read KEY locks, selects the key, reads it, and unlocks. unifykey write KEY VALUE is a raw write path. devinfo-set writes through the same interface. The lock node is a userspace/kernel arbitration mechanism, not an OTP or root-proof write lock: root with sysfs access can request writes. No hardware fuse write was attempted during this research; changing identity can break cloud pairing, A/B metadata, or secure-boot provisioning.

Identity distinctions

Value Purpose
Hardware deviceid / serial Device identity, backup directory, USB serial, cloud metadata
Kernel androidboot.deviceid Bootloader-supplied copy observed in /proc/cmdline
DEVICE_ID from devinfo Userspace/cloud identifier
Marusya session + secret Account session, not hardware identity
xToken Short-lived provisioning credential
VK OAuth token Used by the phone to create the Marusya session

Do not regenerate or conflate these values. Restoring data can restore account state without changing the hardware key; writing a new hardware key can make an otherwise valid session inconsistent with the device.

AVB and device state

devinfo has two distinct outputs:

  • AVB_STATE: the literal value following androidboot.verifiedbootstate= in /proc/cmdline, or an empty string when absent (devinfo:0x5100). The current command line does not contain that key.
  • DEVICE_STATE: test_required when /data/DEVICE_TEST_REQUIRED exists, otherwise ok (devinfo:0x3400).

androidboot.rpmb_state=0 and SELinux enforcing do not establish AVB verification or a locked boot chain. They must not be substituted for the missing verifiedbootstate value.