• XDA Forums have been migrated to XenForo. To discuss, report bugs and other issues, use this thread.

[TOOL][WIN/LIN/MAC] MiUnlockTool - Unlock bootloader of xiaomi devices on mac & linux

frandavid100

New member
Aug 5, 2009
489
14
0
Valencia
First off, thanks for your hard work. I'm trying to use your tool on Fedora, and I'm not sure if everything's working right.

If I just type 'sudo ./MiUnlockTool.sh', it says 'Unable to start gui application. Are you running this tool on a display environment?'

Which is not a big issue, since I can simply type 'sudo ./MiUnlockTool.sh (username) (password)' to run the tool in CLI mode.

But when I do that, I get a 'Add your account and device in MIUI's Settings' error. Which is weird, because I've already linked my account to the phone in the 'Mi unlock' screen of the Settings.

Does that error message always appear when I still have to wait for some hours? Or should I be getting a different message?
 

Black_Stark

New member
Sep 24, 2012
3,481
1,010
0
GOA
First off, thanks for your hard work. I'm trying to use your tool on Fedora, and I'm not sure if everything's working right.

If I just type 'sudo ./MiUnlockTool.sh', it says 'Unable to start gui application. Are you running this tool on a display environment?'

Which is not a big issue, since I can simply type 'sudo ./MiUnlockTool.sh (username) (password)' to run the tool in CLI mode.

But when I do that, I get a 'Add your account and device in MIUI's Settings' error. Which is weird, because I've already linked my account to the phone in the 'Mi unlock' screen of the Settings.

Does that error message always appear when I still have to wait for some hours? Or should I be getting a different message?
After adding account on phone u need to wait 72hours.
 

Black_Stark

New member
Sep 24, 2012
3,481
1,010
0
GOA
Yes, I know I need to wait (although I'm not sure if it's 72 or 360 hours). My question is: should I be getting a "you need to wait xxx hours" message instead of a "you need to enable xxx option in the Settings"?
No. Just bind ur account in dev settings . also keep ur mi cloud sync on both with data and wifi.

Ur mobile hardware info should be synchronised with xiaomi server.
It takes couple of days.

When u try to unlock using tool then everything should match to that of server Then It will send u unlock key. Dont update or change rom from beta to stable. Just keep cloud sync on and wait for couple of days.

Make sure u enable oem unlock, usb debugging, and fastboot driver installed shows ur device is connected.

Try after 3 days.

I un locked my device 2yrs back. I dont know if u need to apply for permission to unlock or not.
 

k1ks

New member
Jan 17, 2014
2,932
6,782
0
plus.google.com
Tips only for error "Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application"

sudo apt-get purge openjdk*
sudo apt autoremove
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt install oracle-java8-set-default
JAVA_HOME="/usr/lib/jvm/java-8-oracle/jre/"
 
  • Like
Reactions: AdRi_232

silentext

New member
Nov 3, 2016
35
11
0
a bit surprised with this tool and worked like charm on may mac

but rather than that, it reduced the waiting time for me. original xiaomi tool gives me 720 hours waiting time. so i was waiting. just with curiosity i have downloaded this and checked with this on my mac before ending my waiting time. it was 4 days. surprisingly this tool showed me no waiting time and just unlocked. amazing!
 

Fridiero

New member
Feb 14, 2012
9
1
0
Moscow
Hi! COuld you please help me? On mac I have such problem. I've installed jdk-11.

HTML:
Downloads/MiUnlockTool/MiUnlockTool.command ; exit;
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:801)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:699)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:622)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:580)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at com.xiaomitool.miunlock.Main.main(SourceFile:46)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 10 more
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
How can I solve this problem?
 
Last edited:
  • Like
Reactions: nunoMaga

hugolp

New member
Mar 8, 2013
84
42
0
Hi

Solved: problem seem to be with my computer usb controller half dying.

I am trying to unlock a Poco F1 using this tool on linux and I am stuck at "Obtaining device info...". I have let it run at that stage for up to 20 minutes. I have tried through the GUI and console modes, same result.

I am using Ubuntu 16.04 and I have installed Java using this instructions. Using the open java implementation with openjfx packet did still produce an error when trying to run the GUI.

This is what I have done:

  1. Update the phone
  2. Enable developer mode and check USB debug and OEM unlock
  3. In the phone, sign in to my Mi account (which is a few years old), I have not verified my phone number if that matters
  4. Start your program, input Mi account login and password, and wait for it to ask me for fastboot mode phone
  5. Put Poco F1 in fastboot mode and connect it to computer

Your program recognizes the device and goes to "Obtaining device info...", just to get stuck there (both with GUI and console modes).

Any help appreciated.
 
Last edited:

cjlargear

New member
Jul 27, 2005
5
0
0
Are u using GUI or terminal ?
GUI,I will also try cli to see if there is any difference...

On cli it stucks on last stage "Starting final unlock procedure"... and after a few tries it gives error 20034...

EDIT: CLI mode responds : [10:29:00][ERROR ] Error meaning: Current account cannot unlock this device
 
Last edited:

Imran21

New member
Dec 30, 2016
2
0
0
showing error

It shows error 20091 and says to add account and device. But when i try to add under developer option, it always shows error 20091. I have tried with vpn with china server but still this happens. Please help
device: redmi note 4x
miui global beta 8.9.20
 

djpatch

New member
Jan 8, 2012
22
2
0
It shows error 20091 and says to add account and device. But when i try to add under developer option, it always shows error 20091. I have tried with vpn with china server but still this happens. Please help
device: redmi note 4x
miui global beta 8.9.20
The same for me , ever 20091 error
 

martinaje

New member
Oct 29, 2018
2
0
0
Issue with select multiple files on mac?

Actually, I am also looking for the same thing when I select multiple files on my iPhone for sharing, It shows me an error regarding this and there has no connectivity through an app or network but I have still faced a problem. So please share any guideline about How to select multiple files on Mac .;):)
 

tilbud

New member
Nov 2, 2018
1
0
0
error 20041

thank you for this great tool!
...but unfortunately i got an unknown error :(

[14:29:23][INFO ] Querying unlock server for unlock key
[14:29:27][ERROR ] Unlock request replied with error code 20041
[14:29:27][ERROR ] Error meaning: Unknown error: %d

does anybody know this error?

regards
tilbud
 
Our Apps
Get our official app! (coming soon)
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone