• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

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

Search This thread

mario156090

Senior Member
Jun 9, 2014
355
50
Xiaomi Redmi Note 7
Well, the information in the main thread is a little strange for not english speakers. After 1 hour I can try use this tool but appears the next error:
Code:
[10:01:50][INFO  ] Starting login procedure
[10:02:01][INFO  ] Login procedure succeeded
[10:02:01][INFO  ] Checking account unlock permission
[10:02:05][INFO  ] Unlock permission confirmed
[10:02:05][INFO  ] Waiting for a fastboot device
[10:10:58][INFO  ] Device connected: 95b6c4eb
[10:10:58][INFO  ] Obtaining device info...
[10:10:58][INFO  ] Device info obtained
[10:10:58][INFO  ] Checking if unlock will erase data and server message
[10:11:10][INFO  ] Unlock procedure will not erase userdata
[10:11:10][INFO  ] Server message: The version of your tool is low and there may be a security risk. Please upgrade it right now!
[10:11:10][INFO  ] Querying unlock server for unlock key
[10:11:15][ERROR ] Unlock request replied with error code 20035
[10:11:15][ERROR ] Error meaning: Please download the latest version

What's mean whit "Please download the latest version"?
 

Firnefex

Member
Jul 16, 2017
10
2
Please can you write here the exact number of the alpha version? I downloaded the latest one but in Linux Mint Xfce 19.3 doesn't work

The latest one is 9.11.10.
You have to create a Mi Account and wait up to 2 weeks. Also don't forget to install ADB and Fastboot in Mint: https://forum.xda-developers.com/android/general/guide-installing-adb-fastboot-linux-adb-t3478678
Note that in Mint Xed is the default text editor, not gedit. Since Mint19 the correct invoking with root permission is: xed admin:///etc/udev/rules.d/51-android.rules
After all that it should work. If it hangs at 99% its normally because your new account isn't accepted by Xiaomi yet...
 
Last edited:
  • Like
Reactions: paolone1

paolone1

Senior Member
Oct 1, 2007
448
178
Milano
Xiaomi Redmi Note 5A
Hello, I have this error using the latest beta on the latest Linux Mint, can you help me please? :confused:
 

Attachments

  • errore_xiaomi.png
    errore_xiaomi.png
    89.1 KB · Views: 375

adityadeva

Senior Member
Mar 2, 2009
147
57
Kochi
not working in mx linux

got the following error while trying to run in mxlinux (debian buster). any help is most appreciated.

./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:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
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:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 10 more
 

natedogg20050

Senior Member
Aug 19, 2009
301
72
Exception in thread "main" java.lang.NoClassDefFoundError: javafx/application/Application

Error on Mac OS Catalina

---------- Post added at 01:12 PM ---------- Previous post was at 01:12 PM ----------

got the following error while trying to run in mxlinux (debian buster). any help is most appreciated.

./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:1017)
at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:800)
at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:698)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:621)
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:579)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
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:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 10 more

same error here
 

itzsnehasis

Member
Jul 14, 2019
13
1
Error!

Exception in Application start method
Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javaLoader.constructLoadException(FXMLLoader.java:2601)
at javafx.fxml.FXMLfx.application.LauncherImpl.lambda$launchApplication$1(LauncherImpl.java:182)
at java.lang.Thread.run(Thread.java:748)
Caused by: javafx.fxml.LoadException:
file:/home/snehasis/programms/MiUnlockTool/bin/MiUnlockTool.jar!/com/xiaomitool/miunlock/Gui/fxml/main.fxml

at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2571)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2441)
at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2409)
at com.xiaomitool.miunlock.a.start(SourceFile:34)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication.lambda$null$10(GtkApplication.java:245)
... 1 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:72)
at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:276)
at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2566)
... 12 more
Caused by: java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.252.b09-1.fc32.x86_64/jre/lib/amd64/libjfxwebkit.so
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1820)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1088)
at com.sun.glass.utils.NativeLibLoader.loadLibraryFullPath(NativeLibLoader.java:201)
at com.sun.glass.utils.NativeLibLoader.loadLibraryInternal(NativeLibLoader.java:94)
at com.sun.glass.utils.NativeLibLoader.loadLibrary(NativeLibLoader.java:39)
at com.sun.webkit.WebPage.lambda$static$0(WebPage.java:133)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.webkit.WebPage.<clinit>(WebPage.java:132)
at javafx.scene.web.WebEngine.<init>(WebEngine.java:881)
at javafx.scene.web.WebEngine.<init>(WebEngine.java:868)
at javafx.scene.web.WebView.<init>(WebView.java:273)
at com.xiaomitool.miunlock.Gui.MainController.init_webview(SourceFile:304)
at com.xiaomitool.miunlock.Gui.MainController.initialize(SourceFile:93)
... 22 more
[[email protected] MiUnlockTool]$
 

nickson99

New member
Jul 19, 2020
1
0
Here are some more

[08:26:48][INFO ] Starting login procedure
[08:26:54][INFO ] Login procedure succeeded
[08:26:54][INFO ] Checking account unlock permission
[08:26:55][INFO ] Unlock permission confirmed
[08:26:55][INFO ] Waiting for a fastboot device
[08:26:55][INFO ] Device connected: XXXXXXXX
[08:26:55][INFO ] Obtaining device info...
[08:26:55][INFO ] Device info obtained
[08:26:55][INFO ] Checking if unlock will erase data and server message
[08:26:56][INFO ] Unlock procedure will not erase userdata
[08:26:56][INFO ] Server message: The version of your tool is low and there may be a security risk. Please upgrade it right now!
[08:26:56][INFO ] Querying unlock server for unlock key
[08:26:56][ERROR ] Unlock request replied with error code 20035
[08:26:56][ERROR ] Error meaning: Please download the latest version
 

w_b_k

Member
Aug 11, 2020
6
2
How do I UBL without having to wait a few hours or longer?:confused:

I have searched for days, but the only answer I found, was: "Sorry, not possible".

I hate having to make an account and having my private phone send data to a random company for days before being able to free my phone of Google&Co, but I could not help it.

The company needs to have access to about all identifying info about your phone, your subscription, family and friends, surroundings and habits for a week. The procedure can not be started without a SIM, in airplane mode or without a data plan on your subscription (WiFi did not do the trick in my case, "Please enable mobile data to continue").

After a week you are allowed to remove their ROM from the phone.

In my case, I used XiaomiTool v2 to unlock my Redmi Note 8 (Ginkgo) with LineageOS (unofficial ROM).

I am not sure whether it is safe after that to remove the account from their servers.

Good luck!
 

eBuzz_Recon

Member
Jul 8, 2012
20
1
You need to install additional Java fx libs:
- download java fx lib's zip for your OS and extract it somewhere: gluonhq.com/products/javafx/
- configure java to run with these additional fx modules: openjfx.io/openjfx-docs/#install-javafx

Something like:

export JAVA_HOME=/usr/bin/
export PATH_TO_FX=/path/to/libfx/
sudo java -jar bin/MiUnlockTool.jar --module-path $PATH_TO_FX --add-modules javafx.base,javafx.controls,javafx.fxml,javafx.graphics,javafx.swing,javafx.web

See this post for more details: unix.stackexchange.com/questions/505130/start-jar-in-linux-javafx-application-application

Thanks, this is helpful. Running on Ubuntu 20.04

But I got error when in the app
Connection error - connect to unlock.update.miui.com:443 [unlock.update.miui.com/183.84.162] failed: Read time out
 

cudencuden

Senior Member
Feb 28, 2014
103
12
OS: Ubuntu 20.04.1 LTS
Java: openjdk version "11.0.8" 2020-07-14
Action: Unlock boot loader
Error: Xiaomi Server returned error 20044. Invalid fasboot token
XMT version: XiaoMiTool V2 20.7.28 beta
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Trying the tool to flash global ROM on my mi 11 ultra and failed with the following error. Did anyone face the same and any soln?
    1
    I have aquestion for you unrelated to your issue. Did you managed to unlock your bootloader with it and without waiting 360hours? or did you already had bootloader unlocked?
    I have used the same tool and unlocked the bootloader. Had to wait for 7 days as usual.
    1
    I have a problem with the tool:
    I type the command "sudo ./MiUnlockTool.sh user pass", and I receive the error "Login exception: Http sts request responded with status 401: Unauthorized".
    The username and password are correct as using a wrong password I get the different error "Login exception: Login return code is not zero: 70016 (Login error)".
    What may be causing the problem?
    I guess it could have something to do with the fact that using the windows tool it asks me to confirm the account via message the first time, but I don't know how to avoid the issue.
    Thanks in advance for the help.
    1
    Can't seem to download the tool. Is it available somewhere else?
  • 41
    [TOOL][WIN/LIN/MAC] MiUnlockTool - Unlock bootloader of xiaomi devices on mac & linux

    Ciao xda users, I'm here to introduce a new tool of mine, MiUnlockTool.
    MiUnlockTool is an unofficial tool used to unlock bootloader on Xiaomi devices. This tool is copied from the original windows MiFlashUnlock tool and works the same way. The main feature of this tool is compatibility with linux and mac operating system (and windows too).
    If you want more information about the tool and the story behind you can read below, if you just want the download link, here it is:
    DOWNLOAD LINK
    Requirements: java (javafx for gui if not included in your jdk/jre)

    Usage:
    - Download and extract the zip file
    - If you don't have it, install java
    - On windows:
    -- open MiFlashUnlock.bat for graphical interface or:
    -- open a cmd windows and cd into extracted dir and use "MiUnlockTool.bat username password" command for command-line usage
    - On linux:
    -- open a terminal window and cd into extracted dir and use "sudo ./MiUnlockTool.sh" command for gui interface or "sudo ./MiUnlockTool.sh username password" for command-line
    - On mac:
    -- open (double click) MiFlashUnlock.command for graphical interface or
    -- open a terminal window and cd into extracted dir and use "./MiFlashUnlock.command username password" for command-line
    - Attach your locked device in fastboot mode.
    - If you are using gui just follow what you see on your screen
    - If you are using command line version remember that there is no confirmation request before unlock and no check if the bootloader is already unlocked.

    Possible errors:
    - If you get a permission related error on linux or mac when launching the tool, open a terminal and cd into extracted dir and use "chmod 777 MiUnlockTool.sh" (or MiUnlockTool.command on mac) to set the executable permission.
    - If your device isn't recognized:
    -- On windows: install adb drivers
    -- On linux/mac trying launching the tool with sudo (sudo ./MiUnlockTool.sh on linux or sudo ./MiUnlockTool.command on mac)
    - Other problems launching the tool: try running "java -jar bin/MiUnlockTool.jar" command
    - 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.
    - Any other problem: provide feedback in the comments.


    Additional info: original MiFlashUnlock tool is just a bridge between fastboot, you (and your account login credentials) and xiaomi server: the tool gets device info from the device and send them to the server together with the account login token, the server checks wherever you satisfy all their requirements (account authorized, account associated with device in developer settings etc) and if everything is okay the server reply with the unlock key for your device instance (every time you reboot your phone you need a new key). Then the tool send the key to the device with a custom build of fastboot and if the key is right then the device is unlocked, else it reboots. After I discovered all the process behind the original unlock tool (and all the security encryption techniques) I decided to replicate it with a java (cross-platform) tool which embeds a custom fastboot version and replicates what the original tool does. That's a simple explaination of how my tool works (obviously it's more complicated than that).
    This tool requires all of what is required by the original tool (an authorized xiaomi account binded to the device through developer options for three days if I remember correctly).

    FAQs:
    - Is this tool safe to use?
    Yes, the main part is communication between tool and server, a safe thing. Also the unlock procedure itself is safe: or the key is correct or it is not. In both cases the device will not be damage.
    - How did you find out how to replicate the original tool?
    Thank you for your question. It's been a bit difficult since the original tool has been obfuscated and virtualized (protected against reverse engeneering) with a powerful protector: VMProtect. I've spent some time to reverse it (and custom fastboot too) and I finally did it. I will not explain in details how I did it.
    - Is this tool more powerful than the original on? why should I use it on Windows?
    Absolutely not, my tool is worst than the original one (it will have more bugs and on windows it doesn't manage drivers for example), that's why you should NOT use it on Windows. I made it work even with Windows because it was very simple to do. You can use it one Windows just to test it if you like, but I recommend using the better original tool MiFlashUnlock.
    - Wow, you did a tool already done by developers paid by xiaomi, who is paying for the effort you put into this?
    No one, I try to help people and getting appreciation for my work is a bit of a reward to me, but if you want to show your gratitude even more and support me as a developer you can make a donation, I will appreciate that even more ;) (donation link below)
    - I have to put my xiaomi account credentials, should I trust this?
    I'm the developer of XiaoMiTool, I hope that a little bit of my reputation together with the hopefully good early feedback of reckless users on this tool is enough. If you are more a geek you can track the traffic and see that the only server connected are xiaomi and miui.
    - I wanted too see the source of this tool but I see it is a bit obfuscated, why?
    Xiaomi clearly doesn't wanted people to see how MiFlashUnlock works (since they obfuscated it a lot), I don't want to disrespect xiaomi decision by releasing the source plain, so I decided to obfuscated it a bit just to make it a bit harder to see (even if my tool is 100 times easier to reverse than the original)
    - Can I share this tool?
    Of course yes, but I would like you to share it using the xiaomitool.com link (not mega.nz one) so that if I release an update new people will get that and not the old version (there is no tool update enginge built in).
    - You're english is not wonderful...
    I know, hopefully it is understandable enough


    Feedback.
    I love feedback, feedback is the best you can do to help me improving this tool. I have not time to answer everybody's questions but I generally read feedback and do my best to make the tool work. If the tool worked or if the tool didn't worked you can write it in the comments, adding additional information like what error you get, what screen you see when the tool get stuck or even what you tried to solve the problem are precious to me. I have not all of xiaomi devices, I fully ested my tool only with two devices (a redmi 4x and a mi note 2) and only on two operating systems (linux and windows), so any new combination could lead to new errors or problems. Please include also your operating system when leaving feedback. Sometimes there are problems on gui which are not on command-line version, so if the tools fails launching or when using gui I suggest trying the command-line version.

    Donation: free software is great from users prospective, but developers who spend hours of their time and don't get money for it are more unhappy to develop further free tools, so if you liked the tools and it saved you from the need to do 5000 kilometers to get a windows pc, or from the need to download a virtual machine image with your 32kB internet connection, you can show your gratitude by offering me a tasty, cold beer by clicking the link below ;)
    DONATION LINK

    Download: you missed the download link at the top? Here it is again:
    DOWNLOAD LINK
    7
    Fully obfuscated tool. Maybe bloatware or password hijacker
    3
    I'm using the latest Linux Mint but the MiUnlockTool don't work, do you know if there is another tool to unlock the bootloader using GNU/Linux?
    Unfortunately no. The only way that I found to unlock the bootloader was to install Windows and then use Xiaomi's unlock tool.
    I wrote a whole blog post about my experience doing it, but this forum won't let me post a link.
    To read it, search in Google for: "amosbbatto Why we don't own our mobile phones"

    Couldn't get Mi Unlock working on my Windows 10 for the life of me (Unlock button would stay grey even if I had plugged in my phone), but this seemed to work fine until it requested the unlock key.
    You either have to install the USB drivers from xiaomigeek.com or you have to register your phone at the Xiaomi web site. See my blog post about it.
    3
    So, uhh, is the author aware of the bug with %d displaying instead of something meaningful like hours until unlock?
    3
    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