FORUMS
Remove All Ads from XDA

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

9 posts
Thanks Meter: 158
 
By franztesca, XDA Ad-Free Junior Member on 25th April 2018, 09:49 PM
Post Reply Email Thread
5th May 2019, 03:48 PM |#101  
BigFatTony's Avatar
Member
Thanks Meter: 22
 
More
I need your tool because on Windows, fastboot continues to fail. (Or at least I think that's the reason.)
I have a Xiaomi MIX 2S.
I run the tool using oracle java 8 on Fedora 30:
Code:
❯ java -version
java version "1.8.0_212"
Java(TM) SE Runtime Environment (build 1.8.0_212-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.212-b10, mixed mode)
But it doesn't go further than this:

Code:
❯ sudo ./MiUnlockTool.sh <username> <password>
[16:44:23][INFO  ] Starting login procedure
[16:44:29][INFO  ] Login procedure succeeded
[16:44:29][INFO  ] Checking account unlock permission
[16:44:35][INFO  ] Unlock permission confirmed
[16:44:35][INFO  ] Waiting for a fastboot device
[16:44:35][INFO  ] Device connected: 577d12ae
[16:44:35][INFO  ] Obtaining device info...
(The GUI also works, well done!)

## EDIT: During the step `Obtaining device info...` I simply unplugged the phone (still in fastboot mode) and plugged it back in. Then, the process continued but failed:

Code:
[16:53:23][INFO  ] Starting login procedure
[16:53:29][INFO  ] Login procedure succeeded
[16:53:29][INFO  ] Checking account unlock permission
[16:53:33][INFO  ] Unlock permission confirmed
[16:53:33][INFO  ] Waiting for a fastboot device
[16:53:33][INFO  ] Device connected: 577d12ae
[16:53:33][INFO  ] Obtaining device info...
<unplug -> plug back in>
[16:53:54][INFO  ] Device info obtained
[16:53:54][INFO  ] Checking if unlock will erase data and server message
[16:53:59][INFO  ] Unlock procedure will not erase userdata
[16:53:59][INFO  ] Server message: An unlocked device is an easy target for malware which may damage your device or cause financial loss.
[16:53:59][INFO  ] Querying unlock server for unlock key
[16:54:03][ERROR ] Unlock request replied with error code 20031
[16:54:03][ERROR ] Error meaning: Add your account and device in MIUI's Settings > Developer options > Mi Unlock status.
 
 
17th June 2019, 07:50 PM |#102  
Junior Member
Thanks Meter: 6
 
More
I had this error: Unlock request replied with error code 20041

Solved it by Verifying my phone number in Mi Account Settings.
22nd June 2019, 09:15 PM |#103  
Senior Member
Thanks Meter: 57
 
More
This software is hosted at github, but the author hides the source code:

https://github.com/francescotescari/XMT/issues/2

Is somebody working on decompiling the relevant parts of this bloatware ?
24th June 2019, 12:33 AM |#104  
Junior Member
Thanks Meter: 0
 
More
Java Error when running ...
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(Secure ClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass (BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOn ClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOr Null(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(B uiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.lo adClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:5 21)
at com.xiaomitool.miunlock.Main.main(SourceFile:46)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(B uiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.lo adClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:5 21)
... 10 more
17th July 2019, 06:34 AM |#105  
bencaradocdavies's Avatar
Junior Member
Flag Dunedin
Thanks Meter: 0
 
More
Thanks @franztesca, MiUnlockTool (command line) worked fine on my Redmi Note 7 Global under Debian sid:
- Wait time not shown.
- Still locked after 90 hours.
- Unlocked successfully after 258 hours (about 10.75 days, next time I tested).
- Root or sudo is not required with correctly configured udev (e.g. logged in at console).
- Usage: "java -jar bin/MiUnlockTool.jar PHONE PASSWORD" where PHONE is the full Mi Account phone number starting with "+".
- MiUnlockTool hangs after successful unlock.
- Using openjdk-11-jdk 11.0.4+10-1 amd64.
- openjfx is *not* installed (using command line).
- Used a USB 3.0 port on an Asus motherboard.

MiUnlockTool console log when unlock refused because insufficient time has passed:

[11:26:29][ERROR ] Unlock request replied with error code 20036
[11:26:29][ERROR ] Error meaning: After %d hours of trying to unlock the device

MiUnlockTool console log for successful unlock:

[12:47:53][INFO ] Unlock key received
[12:47:53][INFO ] Starting final unlock procedure
[hangs but succeeds]

Kind regards,
Ben.

---------- Post added at 17:34 ---------- Previous post was at 17:27 ----------

Quote:
Originally Posted by vishnu666

Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application

This error means that you tried to use the GUI version and did not have a JavaFX implementation installed. I suggest that you try one of these options:
1. Use the command line version.
2. Install openjfx.
3. Use an Oracle JDK with JavaFX.

The first post in this thread contains clear instructions: "If you get some errors with javafx class not found stuff when you try to launch the gui, then you are missing javafx library. See openjfx package on linux."
24th July 2019, 05:24 PM |#106  
Junior Member
Flag Grenoble
Thanks Meter: 7
 
More
The connections is lost with the Pocophone F1 when going into fastboot. In my opinion, the phone bootloader is buggy (it often gets out of bootloader when connecting the usb).
BUT due to that issue the official tool is unusable. And your tool almost does the job (i have to manually reboot into bootloader until the software detects the phone). I say "almost" because i still have the <72 hours delay.
Sooo.. . Almost thanks, your software works better than the original for this particular issue.
27th July 2019, 05:27 PM |#107  
thebeastglasser's Avatar
Senior Member
Thanks Meter: 79
 
Donate to Me
More
Java doesn't bundle JavaFX on Java releases newer than Java 8. You're going to want to install an older release if you want to use the GUI.

@franztesca I would recommend bundling in JavaFX by including it as an explicit dependency. Java 8 will lose support sooner than later and most Java installations will be a version other than Java 8 then.



Quote:
Originally Posted by vishnu666

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(Secure ClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass (BuiltinClassLoader.java:802)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOn ClassPathOrNull(BuiltinClassLoader.java:700)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOr Null(BuiltinClassLoader.java:623)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(B uiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.lo adClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:5 21)
at com.xiaomitool.miunlock.Main.main(SourceFile:46)
Caused by: java.lang.ClassNotFoundException: javafx.application.Application
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(B uiltinClassLoader.java:583)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.lo adClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:5 21)
... 10 more

30th July 2019, 12:26 PM |#108  
vladi-it's Avatar
Senior Member
Flag Milano
Thanks Meter: 64
 
More
THANKS - linux user
grafical tool do not work for me it asks for something fx, but command line works wonderfully
unloked on the fly ! lucky? this is my first Xiaomi phone and I was prepred for 360 hour.... but
UNLOKED
Thank you
11th August 2019, 06:54 PM |#109  
Junior Member
Thanks Meter: 1
 
More
Quote:
Originally Posted by Domkerks

It's stuck on a last bit
[10:44:37][INFO ] Starting login procedure
[10:44:40][INFO ] Login procedure succeeded
[10:44:40][INFO ] Checking account unlock permission
[10:44:42][INFO ] Unlock permission confirmed
[10:44:42][INFO ] Waiting for a fastboot device
[10:46:00][INFO ] Device connected: f969e8f8
[10:46:00][INFO ] Obtaining device info...

It has been like this for a while now any idea why?

I had this same issue on two of my laptops. I finally fixed it by the following

1) Make sure the phone is not connected via USB
2) Run the app on the command line and it will say 'waiting for fastboot device'
3) Plug in phone to USB then plug USB into the computer, hold down volume for fastboot

That worked for me every time

Sad to say my phone never got unlocked under Linux. It kept hanging, but never unlocked (which others said worked for them). Was forced to install Win 10 on a laptop to unlock
13th August 2019, 04:21 AM |#110  
Junior Member
Thanks Meter: 0
 
More
Unlock request replied with error code 20041
Code:
[11:00:40][INFO  ] Starting login procedure
[11:00:45][INFO  ] Login procedure succeeded
[11:00:45][INFO  ] Checking account unlock permission
[11:00:52][INFO  ] Unlock permission confirmed
[11:00:52][INFO  ] Waiting for a fastboot device
[11:00:52][INFO  ] Device connected: c9e5014
[11:00:52][INFO  ] Obtaining device info...
[11:00:52][INFO  ] Device info obtained
[11:00:52][INFO  ] Checking if unlock will erase data and server message
[11:01:03][INFO  ] Unlock procedure will erase userdata
[11:01:03][INFO  ] Server message: An unlocked device is an easy target for malware which may damage your device or cause financial loss.
[11:01:03][INFO  ] Querying unlock server for unlock key
[11:01:08][ERROR ] Unlock request replied with error code 20041
[11:01:08][ERROR ] Error meaning: Unknown error: %d
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes