Automated tool to extract DJI Home (Romo robot vacuum) credentials from an Android emulator's memory. These credentials enable MQTT integration with Home Assistant or any custom automation platform.
The DJI Home app stores authentication tokens in memory after login. This script:
- Sets up an Android emulator — installs Android SDK, creates a rooted AVD (if not already present)
- Installs DJI Home — side-loads the APK into the emulator
- Waits for you to log in — you manually log in to your DJI account in the emulator
- Dumps process memory — reads
/proc/<pid>/memof the DJI Home process via root access - Extracts credentials — parses the memory dump for tokens, user IDs, device serial numbers
- Validates via API — tests the extracted token against DJI's API and retrieves MQTT broker credentials
| Field | Description |
|---|---|
DJI_USER_TOKEN |
Authentication token (US_...) for DJI Home API |
DJI_USER_ID |
Numeric user ID |
DJI_DEVICE_SN |
Robot vacuum serial number |
| MQTT broker | crobot-mqtt-us.djigate.com:8883 (TLS) |
| MQTT credentials | user_uuid + dynamic password (obtained via API, expires ~4h) |
- macOS (uses Homebrew for dependencies)
- Android Studio (or Android SDK with Emulator) — download. The script will use your existing SDK or try to install command-line tools; if the emulator is missing, it will ask you to install Android Studio.
- DJI Home APK (
com.dji.home.apk) — download from APKMirror or APKPure - Internet connection
- DJI account with a paired Romo robot vacuum
- Download the DJI Home APK and place it in the same directory as the script:
dji-home-credential-extractor/
dji_credentials_extractor.py
com.dji.home.apk <-- place APK here
- Run the extractor:
python3 dji_credentials_extractor.py-
Follow the on-screen instructions:
- The script will install dependencies and start an Android emulator (first run takes ~10 min)
- When the emulator is ready, DJI Home will open automatically
- Log in to your DJI account in the emulator
- Navigate to the main screen where your robot is visible
- Press ENTER in the terminal to start extraction
-
Credentials are saved to:
.env— environment variables for use with MQTT clientsdji_credentials.txt— human-readable summary
The .env file contains your DJI_USER_TOKEN. To connect to the MQTT broker:
# 1. Get dynamic MQTT credentials (token expires every ~4h)
curl "https://home-api-vg.djigate.com/app/api/v1/users/auth/token?reason=mqtt" \
-H "x-member-token: $DJI_USER_TOKEN"
# Response contains: mqtt_domain, mqtt_port, user_uuid, user_token (password)
# 2. Connect via MQTT (TLS, port 8883)
# Subscribe to: forward/cr800/thing/product/<DEVICE_SN>/#| Topic | Description |
|---|---|
forward/cr800/thing/product/<SN>/property |
Device telemetry (battery, position, status) |
forward/cr800/thing/product/<SN>/events |
Events (cleaning progress, errors, drying) |
forward/cr800/thing/product/<SN>/services |
Commands (cloud to device) |
| Variable | Description |
|---|---|
DJI_USER_TOKEN |
API authentication token |
DJI_USER_ID |
Numeric user ID |
DJI_DEVICE_SN |
Robot serial number |
DJI_API_URL |
API base URL (default: https://home-api-vg.djigate.com) |
DJI_LOCALE |
Locale (default: en_US) |
| Issue | Solution |
|---|---|
| Emulator won't start | Ensure you have enough disk space (~10GB) and RAM (~4GB free) |
| APK not found | Place the .apk file in the same directory as the script |
| Root access denied | Use a Google APIs system image (not Google Play) — the script does this by default |
| Token not found | Make sure you're fully logged in and on the main screen before pressing ENTER |
| API returns error | Token may have expired — re-run the extractor |
- Uses
google_apissystem image (rootable, unlikegoogle_playimages) - Memory dump reads 500MB starting at offset
0x12c00000(heap region) - Extracts strings matching known DJI token patterns (
US_...,flutter.user_id, etc.) - MQTT credentials are not stored in the APK — they are fetched dynamically from the API using the
user_token
This tool is intended for extracting credentials from your own DJI account to enable local smart home integrations. Use responsibly and only with devices you own.
MIT