Giter Club home page Giter Club logo

termux-miunlock's Introduction

Termux MiUnlock

A program that can be used to retrieve the bootloader unlock token for Xiaomi devices. (and unlock the bootloader) using Termux

Note: This tool cannot bypass the 7, 14, 30 day unlock time.

How to unlock xiaomi device bootloader using termux?

Usage

Usage: get_token.sh [OPTIONS] DATA
A program that can be used to retrieve the bootloader unlock token for Xiaomi
devices. using Termux.
*     DATA                Install account.apk from repo, login and copy-paste
                            the response.
      --debug             Output messages about what the tool is doing
      --help              Display a help message
*     --product=PRODUCT   Used to verify device product
      --region=REGION     Tool server hosts or regions: india, global, china,
                            russia, europe
                            Default: india
*     --token=TOKEN       Used to verify device token
      --version           Version information

Requirements

  1. Verified Xiaomi Account
  2. Two Android device (Host & Target)
  3. USB Otg & Data cable
  4. Internet Connection

Some Instructions

  1. Install required apps termux, termux-api and account.apk on your host device.

  2. Login and bind your xiaomi account on your target device.

  3. Clone this repo.

git clone https://github.com/RohitVerma882/termux-miunlock.git && cd termux-miunlock
  1. Run setup.sh to install required packages.
chmod +x setup.sh && ./setup.sh
  1. Get device product
mi-fastboot getvar product
  1. Get device token
mi-fastboot getvar token
  1. Get device token for mtk device.
mi-fastboot oem get_token

if you received 2 or 3 token then merge it, example:

// Before 
(bootloader) token: VQECMAEQTSdjm281zqPylolzfxy3bQMGbWVy
(bootloader) token: bGluAhTVfQBXJGUJ78qoZQ0ctBDLQ1PkJg==

// After
VQECMAEQTSdjm281zqPylolzfxy3bQMGbWVybGluAhTVfQBXJGUJ78qoZQ0ctBDLQ1PkJg==
  1. Run get_token.sh script with required arguments.
chmod +x get_token.sh
./get_token.sh --region=global --product=PRODUCT --token=TOKEN DATA

if the code succeeds it will give you a really long string which is the unlock token.

You should pass correct region which you used in account.apk if you got error 20045

available options: india, global, china, russia, europe

./get_token.sh --region=REGION --product=PRODUCT --token=TOKEN DATA
  1. Convert unlock token string to binary token.
echo "UNLOCK_TOKEN" | xxd -r -p > token.bin
  1. Type:
mi-fastboot stage token.bin && mi-fastboot oem unlock

Or (skip step 9):

mi-fastboot oem-unlock "UNLOCK_TOKEN"

The device will factory reset and unlock successfully.

More Projects

ADBify — Android Debug Bridge

Heimdoo — Samsung flashing Tool

termux-adb — prebuilt adb & fastboot binaries for Termux

termux-miunlock's People

Contributors

rohitverma882 avatar barisbora avatar araafroyall avatar bigbruno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.