This guide installs Project-Curtana as a local Android flashing and diagnostics workspace for Xiaomi Curtana devices.
Project-Curtana is intentionally portable. The scripts can use platform-tools bundled under the repository or platform-tools already available in your system PATH.
| Requirement | Purpose |
|---|---|
| Windows 10 or Windows 11 | Primary supported script environment. |
| Android platform-tools | Provides adb.exe and fastboot.exe. |
| USB data cable | Charging-only cables will not work. |
| Unlocked bootloader | Required for custom recovery and custom ROM flashing. |
| Device-specific recovery | OrangeFox/TWRP build for curtana or supported miatoll. |
| Verified ROM/firmware packages | Prevents corrupt downloads and wrong-device flashes. |
Advanced users can also use the Python automation modules on Linux/macOS, but the current production scripts are Windows batch and PowerShell.
Project-Curtana/
tools/platform-tools/ adb.exe and fastboot.exe, optional but recommended
drivers/ local driver packages and extracted INF files
recovery/orangefox/ local recovery images and recovery ZIPs
firmware/ local firmware, ROMs, and checksum files
logs/ diagnostics, backups, and generated reports
The repository does not redistribute Android SDK binaries, Xiaomi firmware, recovery images, ROM builds, or proprietary drivers. Those artifacts remain local inputs.
git clone https://github.com/Project-Curtana/Project-Curtana.git
cd Project-CurtanaIf you are working from a downloaded ZIP, extract it to a short path such as:
C:\Android\Project-Curtana
Avoid paths with special characters when doing low-level device work. Batch scripts support quoted paths, but vendor flashing tools and driver installers are often less tolerant.
Download Android platform-tools from the official Android SDK distribution and extract these files into ../tools/platform-tools:
adb.exe
fastboot.exe
AdbWinApi.dll
AdbWinUsbApi.dll
Expected layout:
Project-Curtana/
tools/
platform-tools/
adb.exe
fastboot.exe
AdbWinApi.dll
AdbWinUsbApi.dll
The scripts first use local platform-tools. If local files are missing, they try adb and fastboot from PATH.
Verify manually:
tools\platform-tools\adb.exe version
tools\platform-tools\fastboot.exe --versionUse DRIVER_SETUP.md for the detailed driver path.
Quick path:
- Put driver ZIP files or extracted driver folders under
drivers\. - Open Command Prompt as Administrator.
- Run:
scripts\troubleshooting\install_drivers.batDriver state matters because Windows uses different interfaces for Android, recovery, Fastboot, FastbootD, and Qualcomm emergency modes.
On the phone:
- Open Settings.
- Open About phone.
- Tap MIUI version or Build number until Developer options are enabled.
- Open Additional settings -> Developer options.
- Enable USB debugging.
- Connect USB and approve the RSA fingerprint prompt.
Then run:
scripts\adb\check_device.batExpected result:
[OK] Authorized ADB device detected.
If the device shows unauthorized, unlock the phone screen and approve the prompt. If no prompt appears, revoke USB debugging authorizations, reconnect, and try again.
Reboot to bootloader:
scripts\adb\reboot_bootloader.batCheck Fastboot:
scripts\fastboot\verify_fastboot.batExpected output includes a Fastboot device and bootloader variables such as product, unlocked, and sometimes current-slot.
Curtana devices may report curtana or miatoll depending on the bootloader/recovery context. Treat unexpected values as a reason to stop and inspect before flashing.
scripts\fastboot\unlock_status_check.batCustom recovery, custom ROMs, modified boot images, and many repair operations require an unlocked bootloader.
Do not relock the bootloader while running custom recovery, custom ROM, Magisk-patched boot images, non-stock vbmeta state, or mismatched firmware. Relocking in that state can brick the device.
Place a verified OrangeFox image here:
recovery\orangefox\orangefox.img
Then temporary boot first:
scripts\recovery\boot_orangefox.batTemporary booting is safer than immediately flashing because it confirms:
- Fastboot can load the image.
- The image is compatible enough to boot.
- Touch, storage, and decryption behavior can be inspected.
Flash only after a successful temporary boot:
scripts\recovery\flash_recovery.batKeep ROMs and firmware in firmware\ or another local folder. Always verify checksums:
$env:PYTHONPATH = "$PWD\automation"
python -m curtana_toolkit.cli sha256 firmware\rom.zipIf a ROM maintainer provides a .sha256 file:
$env:PYTHONPATH = "$PWD\automation"
python -m curtana_toolkit.cli verify firmware\rom.zip firmware\rom.zip.sha256Before flashing:
- Device codename and family are known.
- Bootloader is unlocked.
- Battery is above 50 percent.
- USB cable is stable and data-capable.
- Drivers are installed for the mode you are using.
- Recovery and ROM are built for Curtana or supported Miatoll.
- SHA256 checksums match.
- Required firmware base is installed or ready to flash.
- Personal data is backed up.
- You have a known path back to stock.
adb devices empty
-> Check USB debugging, RSA prompt, cable, Google USB driver.
adb unauthorized
-> Unlock phone, approve RSA prompt, revoke authorizations if needed.
fastboot devices empty
-> Check Android Bootloader Interface driver in Device Manager.
fastboot works but flashing fails
-> Confirm unlock state, correct mode, correct partition, and dynamic partition requirements.
recovery boots but storage is encrypted
-> Use sideload/USB OTG or format data only when the ROM flow requires it.