Skip to content

Instantly share code, notes, and snippets.

@miklosbagi
Created December 8, 2020 16:49
Show Gist options
  • Save miklosbagi/e0655392de617dd47e7214a5ef18f2ae to your computer and use it in GitHub Desktop.
Save miklosbagi/e0655392de617dd47e7214a5ef18f2ae to your computer and use it in GitHub Desktop.
Xiaomi Roborock rootpw decrypt (UART)
#!/bin/bash
[ -z "$1" ] && { echo "Give me the Xiaomi string (e.g. ZNDRTERCGVDD@XES)"; exit 1; }
key="55"; d=""; hex=`echo -n "$1" | od -An -tuC`
for c in $hex; do xor=$(($c^$key)); printf "\\$(printf '%03o' "$xor")"; done; echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment