• 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

mssadewa

New member
Oct 28, 2018
20
6
0
Jakarta
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
did you have create unlock request xiaomi?
make sure you have enable oem unlock and usb debugger in developer options..
 

Candymannetje

New member
Nov 5, 2018
1
0
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.
I had the same problem with Debian 10.
When it went to 'obtaining device info' I waited for 2 minutes then I booted in to fastboot again and the proces continued.
 

Pa-Jo

New member
Apr 27, 2012
55
10
0
Malý Čepčín
Is this tool working only for accounts which were not trying to unlock the bootloader with oficial unlock tool and get no reject with waiting time? I'm asking because if this modded unlock tool gets the token based on MiAccount which has been already signed on Xiaomi server with waiting time, it causes the %d error I think.

Can somebody confirm that bootloader can be unlocked while the MiAccount is bounded in Developer settings and this account hasn't been used with oficial unlocking tool and rejected by waiting time?

I am trying to unlock on Ubuntu with no luck, tryied both GUI and CLI methods.
 

devrruti

New member
Jan 23, 2011
681
198
0
I'm getting %d error on Ubuntu 18.10, I am unable to read how long I need to wait for unlocking my phone's bootloader. (Error 20036)
It doesn't report how much time remains until you can unlock. The official windows app does.
It's one month for all xiaomis manufactured since June, except pocophone (3 days)
Count starts since you add a xiaomi account to the phone
 

Black_Stark

New member
Sep 24, 2012
3,481
1,010
0
GOA
What is SUDO ?? :confused:
Lol...using linux and dont know about sudo. We start with sudo for some actions if we want to run comand with admin rights.

R u using terminal right?

Then u need sudo command sometime.

If u want to install app then u say
sudo apt-get install nameofapp
Or just go to ubuntu store and search android tools fasboot


Then open terminal and run fastboot commands
Connect phone to pc.

fastboot devices

fastboot oem device-info

If its hangs use

sudo fastboot oem device-info
Enter password
 

Soygdl

New member
Mar 15, 2017
17
1
0
Install android fastboot tools.

Use sudo

sudo fastboot oem device-info

I already did. I have worked the disconnect and remove and put back in fastboot mode and reconnect, and in advanced but I failed to wait hours and try again, now the question is how many hours should I wait? , it is unfortunate not to be able to visualize the number of hours to wait in Linux version, in advance thank you very much for the work the developer did I hope the tool better with the passage of time,
 

Black_Stark

New member
Sep 24, 2012
3,481
1,010
0
GOA
I already did. I have worked the disconnect and remove and put back in fastboot mode and reconnect, and in advanced but I failed to wait hours and try again, now the question is how many hours should I wait? , it is unfortunate not to be able to visualize the number of hours to wait in Linux version, in advance thank you very much for the work the developer did I hope the tool better with the passage of time,
We are very lucky he reverse engineered it for linux.
I dont know if will improve it. He never replied to thread. Dont know if he is active.

Did u bind ur account in developer option.?
Enable oem and usb debugging?

How many hours of waiting time it is showing?
 

Soygdl

New member
Mar 15, 2017
17
1
0
We are very lucky he reverse engineered it for linux.
I dont know if will improve it. He never replied to thread. Dont know if he is active.

Did u bind ur account in developer option.?
Enable oem and usb debugging?

How many hours of waiting time it is showing?
Already activated debugging USB and OEM, regarding the hours, as commented there is a bug which does not say the hours in Linux only says $% or something like that
 

Black_Stark

New member
Sep 24, 2012
3,481
1,010
0
GOA
Already activated debugging USB and OEM, regarding the hours, as commented there is a bug which does not say the hours in Linux only says $% or something like that
Your number should show activated.
And no device show in "other device" option.
And keep mi cloud sync on for data if u dont have wifi.
Ur phone info should sync with mi server.

What is ur current miui rom version?

Dont change rom from beta to stable or vice versa or update rom .
 

Attachments

Last edited:

Michal_M1

New member
Nov 13, 2014
6
0
0
Prague
error code 20041 ???

Hi,
I tried unlock my phone Xiaomi Mi Mix 2s [Global] with MiUnlockTool under Linux (Debian 10/x86-64, Java 1.8.0_191-b12), but without success. :(

Code:
sudo java -jar bin/MiUnlockTool.jar account_number password
[12:20:01][INFO  ] Starting login procedure
[12:20:05][INFO  ] Login procedure succeeded
[12:20:05][INFO  ] Checking account unlock permission
[12:20:06][INFO  ] Unlock permission confirmed
[12:20:06][INFO  ] Waiting for a fastboot device
[12:20:47][INFO  ] Device connected: eac3ed71
[12:20:47][INFO  ] Obtaining device info...
[12:20:47][INFO  ] Device info obtained
[12:20:47][INFO  ] Checking if unlock will erase data and server message
[12:20:49][INFO  ] Unlock procedure will erase userdata
[12:20:49][INFO  ] Server message: An unlocked device is an easy target for malware which may damage your device or cause financial loss.
[12:20:49][INFO  ] Querying unlock server for unlock key
[12:20:51][ERROR ] Unlock request replied with [B]error code 20041[/B]
[12:20:51][ERROR ] Error meaning: Unknown error: %d
Any solution?
 

nunoMaga

New member
Nov 27, 2018
1
0
0
on Ubuntu 18.04. Does it work with java 11? it was what i installed but it doesnt run.

sudo ./MiUnlockTool.sh


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:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
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:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 10 more


:~/Downloads/MiUnlockTool$ java -version


java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
 

DanDroidOS

New member
Jul 26, 2009
450
97
0
Southern California
dandroidos.com
on Ubuntu 18.04. Does it work with java 11? it was what i installed but it doesnt run.

sudo ./MiUnlockTool.sh


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:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
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:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 10 more


:~/Downloads/MiUnlockTool$ java -version


java version "11.0.1" 2018-10-16 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.1+13-LTS)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.1+13-LTS, mixed mode)
I am having the exact same issue!
 
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