Разблокировка загрузчика xiaomi линукс

How to Unlock Xiaomi Devices on Linux and Mac

Owners of Xiaomi devices who want to flash and unlock their devices have the official MiFlashUnlock tool available to them – however, it does not run on Linux. The MiFlashUnlock software can be ran inside Wine or a VM, but there exists a better way.

MiUnlockTool is an unofficial tool based on MiFlashUnlock, which runs natively on Linux (but can also be installed on Mac and Windows). MiUnlockTool is a bridge between fastboot, your Xiaomi credentials, and the Xiaomi server. It retrieves your device info and sends it to the Xiaomi server together with your login token, then checks if you meet all the requirements to receive an unlock key from the server.

The tool will then send the unlock key to your Xiaomi device utilizing a custom build of fastboot. There are no different requirements for receiving an unlock key via MiUnlockTool compared to MiFlashUnlock – you require an authorized Xiaomi account tied to the device through Developer Options.

Requirements

Linux Users

  1. Download the MiUnlockTool, it comes in a .zip file.
  2. Open your terminal and CD to the extracted directory.
  3. In the terminal, type “sudo ./MiUnlockTool.sh”, which will launch the GUI interface. Alternatively, you can use “sudo ./MiUnlockTool.sh username password” for a command-line interface.

Windows and Mac Users

  1. After extracting the .zip file, launch MiFlashUnlock.bat for a graphical interface.
  2. Alternatively you can open a command prompt, CD to the extracted directory, and type “MiUnlockTool.bat username password” for a command-line interface.

After you have launched the MiUnlockTool in whatever OS you’re using, connect your Xiaomi device to your computer while it is in Fastboot Mode.

If you launched the GUI mode, follow the on screen directions. If you are using the command-line interface, there won’t be a confirmation request before unlocking, nor will it check if the bootloader is already unlocked.

Troubleshooting

  • If you receive permission errors on Linux or Mac when launching the MiUnlockTool, you need to open a terminal and CD to the extracted directory.
  • Then grant it 777 permissions using “chmod 777 MiUnlockTool.sh” (or MiUnlockTool.command on Mac), which will set the proper permissions.
  • If you have problems launching the tool even with the Sudo command, you can try the command “java -jar bin/MiUnlockTool.jar”.
  • If you encounter errors with JavaFX class not being found, you are missing JavaFX library from your package. Check the OpenJFX package on Linux.

Final Notes

This tool is absolutely safe to use, as is the unlock procedure. Your Xiaomi device will not be damaged, even if the MiUnlockTool attempts an incorrect unlock key.

Читайте также:  Доступ к общей папке linux

However, Windows users should probably stick to the official Xiaomi unlock tool. Because MiUnlockTool is a third-party copy built more specifically for Linux users, it can have additional bugs, and Windows will not manage the drivers for example. So MiUnlockTool does work on Windows, its just not recommended.

Источник

Разблокировка загрузчика смартфонов Xiaomi на Linux’е с использованием VM и Windows

В последнее время в обширное использование пошли смартфоны от китайского производителя Xiaomi. Все у них шикарно, вот только загрузчик заблокирован. а это означает, что ни каких вам модификаций, патчей, root-прав. Но не все так плохо, как кажется.

Я когда начал юзать смартфон Xiaomi, скрипя зубами терпел весь этот гугловский софт и навязчивое предложение завести аккаунт у Xiaomi. Последний кстати пригодился один раз. Покопавшись в интернетах и почитав много нужной и не очень информации, мною было принято решение: разблокирую загрузчик, уйду на кастомную прошивку, прощай гугл и Xiaomi-сервисы! Было решено. но вот только на моем аппарате был по умолчанию разблокирован загрузчик. Что пошло мне на руку. Ну а Вам я расскажу, как разблокировать загрузчик на данных аппаратах. Итак, начнем:

Что же такое загрузчик?

Загрузчик в Android — это встроенное средство загрузки операционной системы. Если привести в пример компьютерные терминалы с несколькими установленными «операционками» (скажем, Windows и Linux), загрузчик после включения стационарного блока или ноутбука предлагает юзеру вход в систему на выбор, а после подтверждения загружает ту или иную ОС. Равно как и в стационарных системах, загрузчик в мобильных девайсах обращается к инициализационным файлам по типу того, как это делает, например, Windows при загрузке параметров из файла boot.ini. Если обратить внимание именно на такие данные, нетрудно сделать вывод, что в Android-системах запросто можно изменить не только способ загрузки, но и загружаемую ОС либо в ручном, либо в автоматическом режиме. Однако мало кто знает, что сам этот инструмент загружает исключительно ту систему, которая написана под определенную модель смартфона или планшета.

Разблокировка загрузчика:

Я уже писал статью о разблокировке загрузчиков на Android девайсах. прочитать можно тут: ТЫЦ. Однако разблокировка загрузчиков на смартфонах Xiaomi заслуживает отдельного обсуждения.

Начинаем разблокировку с подачи заявки разработчику.

Заходим на англоязычный сайт: ТЫК

Нажимаем на кнопку Unlock Now

Вводим данные своего Mi-Аккаунта. Авторизуемся. Попадаем на страницу подачи заявки. Все поля заполняем на английском языке. В графе причины для разблокировки можно указать: Для установки локализованной версии прошивки. Под формой ставим галочку и жмякаем подтверждение. Попадаем на следующую страницу и ждем смску с кодом, которая придет на указанный Вами номер при заполнении. Вводим код. Заявка подана. Ответ придет смкой в течении 3х дней.

Вот наконец получили ответ от разработчика. Одобрили. Приступаем:

1) Установка эмулятора.
Возьмем, чтоб не скучно было, qemu.

Источник

[Update: Note from dev] MiUnlockTool unlocks Xiaomi phones’ bootloader on macOS and Linux

[Update: Note from dev] MiUnlockTool unlocks Xiaomi phones

Piunikaweb

As a hardware maker, Xiaomi has a beefy portfolio of products. Smartphone, tablet, laptop, bluetooth speaker, electric scooter, smartplug, laser projector, rice cooker – you name it!

Читайте также:  Linux change console size

Xiaomi tried to come up with an Apple-like ecosystem, particularly in Mainland China. Their products, along with in-house software and operating system, are tightly integrated with each other.

They even have alternatives to iCloud & iMessage, namely Mi Cloud and Mi Message. Functionality wise they are at par with their Apple counterparts.

While expanding outside of China, especially India or European countries, Xiaomi faced some hiccups with this setup. People were using and accustomed with other alternative services. To suit their needs, Xiaomi needed to adapt itself with the environment.

In fact, they did. MIUI, their in house skin of Android, was split into two halves: one dedicated for global users and the other one for Chinese people. While the base is same, feature sets vary between two branches.

On the other hand, there are issues with reselling. Third party vendors often resell Xiaomi smartphones in different regions without any authorization. They even install frankenbuild operating systems on Chinese phones to sell them internationally.

Xiaomi introduced a locked bootloader policy since 2016 for extra security. The idea was to prevent unauthorized reselling and minimize the existence of vendor ROMs.

xiaomi_bootloader_lock_announcement

Subsequently anti-rollback protection was launched to make cross-region firmware flashing or downgrading more complicated. PiunikaWeb covered the scenario to some extent in this article.

xiaomi_cross_flash_announcement

To comply with the ecosystem, the official bootloader unlock method require a valid Xiaomi account. The account needs to be bound with (i.e. logged in from) the target device for a specific amount of time.

Initially the unlock process involved manual request and verification which was removed later on. Xiaomi provides a Windows-only tool, where user needs to login using their Mi account.

mi_unlock_official

After successful verification, the phone requires to be connected with PC in bootloader/fastboot mode. The tool, named ‘Mi Unlock’, verifies the prerequisites and unlocks the bootloader of the phone.

Xiaomi uses VMProtect to obfuscate their tool from reverse engineers.

VMProtect protects code by executing it on a virtual machine with non-standard architecture that makes it extremely difficult to analyze and crack the software. Besides that, VMProtect generates and verifies serial numbers, limits free upgrades and much more.

Franesco Tescari AKA XDA member franztesca has a knack on Xiaomi’s tools. He carefully observed the working principle of the recovery mode of Mi/Redmi phones and Mi Flash application. At the end of the day, he was able to decode the modifications done by Xiaomi engineers on Google’s SDK platform tools such fastboot and adb.

Xiaomi ADB is a modified compiled version of Android Debug Bridge, which allows you to sideload official miui roms to your device via stock recovery.

XiaoMiTool is a Windows tool developed to change rom on Xiaomi devices!

As an extension of the work, he also developed MiUnlockTool – a cross-platform alternative to the bloated ‘Mi Unlock’.

Читайте также:  Linux reload limits conf

The tool is written on Java, so at least latest version of Java Runtime Environment (JRE) needs to be installed to use it. To use the graphical user interface, JavaFX is also required.

The developer has included easy-to-use scripts for major operating systems like Windows/Linux/macOS to execute the program. Command line parameters should work like the following:

MiUnlockTool.bat username password
sudo ./MiUnlockTool.sh username password
./MiFlashUnlock.command username password

mi_unlock_tool

franztesca described the working principle of his work:

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).

The tool is still work-in-progress, so novice users are suggested to use the official tool from Xiaomi. For support and queries, make sure to check the support thread and FAQ.

The tool can be downloaded from here. Source code was intentionally made unavailable by the dev.

Update (12 February, 2019)

The developer notified the author via XDA’s Editor-in-Chief Mishaal Rahman about a potential incompatibility.

He noted that the current version of MiUnlockTool is based on v2 of the official Mi Unlock utility. Xiaomi is currently on the v3 branch and new APIs are not yet incorporated inside this project. It may not work at all when Xiaomi drops the support for legacy APIs.

PiunikaWeb is a unique initiative that mainly focuses on investigative journalism. This means we do a lot of hard work to come up with news stories that are either ‘exclusive,’ ‘breaking,’ or ‘curated’ in nature. Perhaps that’s the reason our work has been picked by the likes of Forbes, Foxnews, Gizmodo, TechCrunch, Engadget, The Verge, Macrumors, and more. Do take a tour of our website to get a feel of our work. And if you like what we do, stay connected with us on Twitter (@PiunikaWeb) and other social media channels to receive timely updates on stories we publish.

Источник

Оцените статью
Adblock
detector