How to Unlock Bootloader & Root Any Android Using Termux in 2025 — Step-by-Step Guide
Short snippet: This guide explains, in plain language, how to unlock your Android device's bootloader and obtain root using Termux (2025). It's written for educational use — follow all warnings, back up your data, and understand the risks before you proceed.
What this article covers
You’ll get a clear overview of what a bootloader is, why people unlock it, what rooting means in 2025, and a safe, general workflow using Termux + ADB/Fastboot. I include prerequisites, common problems and easy-to-follow explanations — with bullet lists where things get technical.
1. Important warning (read first)
Do not continue unless you understand the risks:
- Unlocking the bootloader usually erases all user data (factory reset). Backup first.
- Manufacturers may void warranty after unlocking or rooting.
- Root access increases responsibility — misused system changes can brick your device or open security holes.
- This guide is for educational purposes. Use it only on devices you own or have permission to modify.
2. Quick primer: Bootloader vs Root
What is the bootloader?
The bootloader is the small program that starts Android. OEMs lock it to protect the official software chain. Unlocking lets you flash custom images (custom ROMs, kernels, patched boot images).
What does rooting mean?
Rooting gives apps or you administrative (superuser) control over the Android OS. That enables powerful customizations, but also adds risk if permissions are abused.
Pros & cons (short)
- Pros: Full control, ability to install custom ROMs, advanced backups, system-level tweaks.
- Cons: Possible warranty void, software update issues, security exposure, chance of bootloops.
3. Prerequisites — what you need before starting
- An Android device you own (check model-specific unlock rules).
- Termux installed on the device (latest version from F-Droid or official source).
- ADB & Fastboot binaries available inside Termux (or a computer with ADB/Fastboot if you prefer).
- Developer options enabled on your phone: USB debugging and, when present, OEM unlock.
- A reliable USB cable (or wireless ADB setup) and a charged battery (≥50%).
- Full backup of your important files (use cloud, local PC, or backup apps).
🛠Step — Install ADB & Fastboot in Termux
We’ll use Termux-ADB to add ADB & Fastboot tools directly to Termux. Works on ARM/ARM64 devices only.
Silent installation (no logs):
apt update > /dev/null 2>&1 && apt --assume-yes install wget > /dev/null 2>&1 && wget https://github.com/MasterDevX/Termux-ADB/raw/master/InstallTools.sh -q && bash InstallTools.sh
Common installation (with logs):
apt update && apt install wget && wget https://github.com/MasterDevX/Termux-ADB/raw/master/InstallTools.sh && bash InstallTools.sh
After installation, test ADB with:
adb version fastboot --version
4. High-level workflow (what we’ll do)
- Verify connection between device and Termux (ADB).
- Reboot device to the bootloader/fastboot mode.
- Use the manufacturer-appropriate unlock command (fastboot flashing unlock / OEM command).
- Obtain a patched boot image (usually with Magisk) and flash it to get root.
- Reboot, verify root, and install management tools (Magisk Manager).
If any step seems confusing, the next sections explain each part with short bullets and simple commands.
5. Install & check ADB/Fastboot in Termux (short)
If you want to do everything from the phone using Termux, you need working ADB/Fastboot binaries inside Termux. Many users either:
- Install ADB/Fastboot packages compiled for Android (search reputable Termux repositories), or
- Use a PC to run ADB/Fastboot (safer and easier for many devices).
Tip: If you encounter permission issues, run Termux with the right storage permissions and follow the package instructions carefully.
6. Unlocking the bootloader — general steps
The exact commands differ by device. This is the common pattern:
- Enable OEM Unlock in Developer Options (if the setting is present).
- Connect the device and confirm ADB can see it (example command):
adb devices
. - Reboot to the bootloader:
adb reboot bootloader
(or use hardware keys). - Use fastboot to unlock. Common commands (device-dependent):
Common fastboot examples (device-specific):
fastboot flashing unlock -- or -- fastboot oem unlock
After unlocking, the device typically performs a factory reset.
How to confirm
- Fastboot may show a confirmation message on the device screen.
- Run
fastboot getvar unlocked
or check bootloader status text (varies with vendor).
If unlocking is blocked
- Some vendors (Samsung, some carriers) require an unlock token from the manufacturer.
- Check your device-specific forum or official OEM policy before trying.
7. Rooting — general safe approach (Magisk, 2025)
Magisk remains the most popular systemless root solution in 2025. The common flow:
- Extract the stock boot image for your exact firmware version (from your ROM or firmware package).
- Patch the boot image with Magisk (use Magisk app on-device or a trusted patching tool).
- Flash the patched boot image via fastboot:
fastboot flash boot patched_boot.img
(or vendor-specific slot commands). - Reboot and install the Magisk Manager app to manage root permissions and modules.
Verify root
- Open Termux and type
su
. If you get a root shell prompt and Magisk grants permission, root is active. - Use root checker apps or
id
command to verify UID 0.
8. Post-root checklist
- Install Magisk Manager and review module compatibility.
- If you use banking apps or SafetyNet-sensitive services, configure Magisk Hide / Play Integrity fixes carefully (results vary in 2025).
- Create a full backup (TWRP or other preferred tool) if you plan major system changes.
- Keep a copy of the original stock boot image and firmware — useful for restoring if things go wrong.
9. Common problems & quick fixes
“Device not found” in ADB/Fastboot
- Check USB cable and port; try another cable.
- Enable USB debugging and accept the PC key prompt on the device.
- Use a PC if on-device Termux binaries are unreliable.
Bootloop after flashing
- Reboot to recovery and restore stock boot or full firmware.
- If you have a TWRP backup, restore it.
- Check device logs if possible to identify module or driver issues.
Permission denied in Termux
- Ensure Termux has the correct permissions and that binaries are executable.
- Some devices restrict access — using a PC for ADB/Fastboot is often simpler.
10. FAQs (short & practical)
Q: Will unlocking let me install any ROM?
A: It allows flashing custom images, but you must use ROMs compatible with your exact device model and firmware.
Q: Can I relock the bootloader later?
A: Some vendors allow relocking, but relocking after modifying system images can cause boot issues. Always keep stock images handy.
Q: Is it possible without a PC?
A: Yes, in many cases (Termux + on-device ADB/fastboot), but using a PC reduces complexity and permission problems.
11. Related articles (on Kumar’s Magic)
My thoughts
I’ve always recommended taking things slow: read device-specific threads, keep backups, and use a PC when you feel stuck — it makes recovery easier. Unlocking and rooting can be empowering, but they come with responsibility. If you decide to try this, test on a secondary device first and document every step so you can roll back if needed.