Skip to content

Instantly share code, notes, and snippets.

@sourcevault
Created September 21, 2021 01:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourcevault/d059d8b5896b94acdc4676075c37427f to your computer and use it in GitHub Desktop.
Save sourcevault/d059d8b5896b94acdc4676075c37427f to your computer and use it in GitHub Desktop.
xiaomi phone
1. As at 2021-08-29, there is no more waiting period or manual form to request for unlock approval from Xiaomi. Instead follow every step described in this video https://youtu.be/pByHHTvms4k
2. Clone and check out linux branch
```
git clone https://github.com/francescotescari/XiaoMiToolV2.git && cd XiaoMiToolV2 && git checkout linux
```
3. Edit one Java source file exactly as described [Xiaomi procedure failed: [getServiceToken] Missing serviceToken cookie #23 (comment)](https://github.com/francescotescari/XiaoMiToolV2/issues/23#issuecomment-904082515)
4. Install openjdk-11, `sudo dnf install java-11-openjdk`
5. Install gradle by following just Step 2, https://docs.gradle.org/current/userguide/installation.html#step_2_unpack_the_distribution. I didn't bother to set up PATH, etc. described further on the page.
6. Set up Gradle wrapper. This step will inevitably overwrite a few Gradle-related files in the repo, i.e. gradlew, etc.
```
# Step above got me gradle-7.2. Adjust this if you've got a newer release.
/opt/gradle/gradle-7.2/bin/gradle wrapper
```
7. Build using the wrapper, `./gradlew build`. If this fails, you have probably messed up the Java source code edit.
8. Run application, `sudo ./gradlew run`
9. After clicking on the "unlock bootloader" button in the app, please be patient. My phone showed a static "MIUI" for over 3 minutes which kinda frightened me. But it eventually booted normally into a fresh install (like factory reset) and showed the "unlocked" status under Developer Options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment