December 4, 2026
Rooting the Realme 3 (RMX1825) โ When XDA Comes Up Empty, You Do It Yourself
A MediaTek BROM exploit, a few boot loops, and a handheld Linux box built out of an old phone.
By y0k1 monk
8 min read
WHY I EVEN BOTHERED
I've had a Realme 3 (RMX1825) sitting in a drawer for a while โ MediaTek Helio P60, Android 10, nothing special. My plan for it wasn't to use it as a daily driver again. I wanted to turn it into a small handheld hacking/research machine: no Google services, a proper Linux userland running through Termux, root so I could actually do things at the system level instead of fighting permission walls every five minutes.
Step one for all of that is root. So I went looking.
I searched XDA, the usual Realme and RMX1825 threads, a bunch of "root Realme 3" guides. Almost everything was outdated, written for Android 9, referencing tools or DA files that don't match this exact build, or just dead links. Nobody had a clean, current writeup for this specific device on Android 10 with a modern mtkclient. So I stopped reading and just started poking at it myself with mtkclient and a lot of patience. This is the writeup I wish I'd found.
Standard disclaimer, because it matters: this will trip your warranty, it can brick the device if you're careless, and it touches the EMMC directly. Back up anything you care about. If you're not comfortable with that risk, stop here.
DOES THIS WORK ON "SIMILAR DEVICES" TOO?
Yes, with caveats. The exploit targets the BootROM (BROM) itself, which is baked into the SoC, not the Android build. So anything on an older MediaTek chipset where BROM is unpatched and SLA (Serial Link Authentication) isn't enforced โ a lot of the Helio P-series and earlier MT67xx chips โ is fair game through mtkclient the same way. Newer chips (MT6781 and up) use a different protocol where BROM itself is patched and you need a signed loader instead, so this exact method won't apply there. Check your chipset against mtkclient's supported list before assuming it'll work.
THE TUTORIAL
What you need:
- A PC (Linux is easiest, Windows works with the right drivers)
- A USB cable (data-capable, not charge-only)
- mtkclient โ the open-source tool that does the actual exploit and flashing (https://github.com/bkerler/mtkclient)
- The Magisk APK on your phone (install it from GitHub, not some random APK site)
- Patience, and a full backup of anything on the device you care about
Step 1 โ Set up mtkclient
git clone https://github.com/bkerler/mtkclient
cd mtkclient
pip3 install -r requirements.txt
sudo cp Setup/Linux/*.rules /etc/udev/rules.d
sudo udevadm control -Rgit clone https://github.com/bkerler/mtkclient
cd mtkclient
pip3 install -r requirements.txt
sudo cp Setup/Linux/*.rules /etc/udev/rules.d
sudo udevadm control -RReboot after this, or at least re-login, so the udev rules and group membership (dialout/plugdev) actually take effect.
Step 2 โ Drop into BROM mode
Power the phone off completely. Hold Volume Down, then plug in the USB cable while still holding it. The device won't show anything on screen โ that's expected, BROM runs before the display driver even exists. mtkclient will detect a raw USB device appearing.
Step 3 โ Read the partition table first
Before touching anything, just read:
python mtk.py printgptpython mtk.py printgptThis connects through the BROM exploit, enumerates the GPT, and shows you every partition with its exact name, offset and size. Do this first โ it confirms the exploit works on your unit and tells you the partition name is "boot" (it can differ on some regional variants).
Step 4 โ Dump the stock boot partition (your safety net)
python mtk.py r boot boot.imgpython mtk.py r boot boot.imgDo not skip this. This stock boot.img is what saves you if a Magisk patch goes wrong later. Copy it somewhere safe off the phone too, not just the PC you're working from.
Step 5 โ Patch boot.img with Magisk
Push boot.img to the phone's internal storage, open the Magisk app, choose "Install" -> "Select and Patch a File," and point it at boot.img. Magisk will spit out a magisk_patched-XXXXX.img in the same folder. Pull that back to your PC.
Step 6 โ Flash the patched image
python mtk.py w boot magisk_patched-31100_XXXXX.imgpython mtk.py w boot magisk_patched-31100_XXXXX.img**change the xxxx in the command with actual digits from the .img
Step 7 โ Reboot and verify
python mtk.py resetpython mtk.py resetLet it boot normally. Open Termux (or any terminal app), type "su", approve the Magisk prompt that pops up, and check if your prompt turns into "#". That's root.
WHAT ACTUALLY WENT WRONG FOR ME (AND HOW I FIXED IT)
I'm not going to pretend this went smoothly on the first try, because it didn't.
Magisk refused to write the patched file. First attempt, it read boot.img fine but failed with "Installation failed" trying to write the output. Android 10's storage permissions were the culprit โ Magisk didn't have storage access granted. Fix was trivial once I found it: Settings -> Apps -> Magisk -> Permissions -> enable Storage. I also just moved boot.img to the root of /sdcard/ instead of a Download subfolder, which seemed to help Magisk find a writable path.
I boot-looped the device. After getting root working, I got a little too excited and enabled Zygisk and hit "Reinstall" inside the Magisk app in the same session. Bad idea โ it re-patched an already patched boot image on top of itself and mangled the ramdisk. Phone never got past the boot animation. This is exactly why I'd dumped the stock boot.img earlier:
python mtk.py w boot boot.img
python mtk.py resetpython mtk.py w boot boot.img
python mtk.py resetThat brought it back to stock, un-rooted but alive. I re-patched a clean copy of the stock boot image, flashed that, confirmed root worked, and only then went back and enabled Zygisk โ as a separate step, not stacked on top of a reinstall.
A root checker app lied to me. After getting root back, "Root Checker Basic" told me "Root Access: No," which had me convinced something was broken again. It wasn't. That app uses an old method of just checking if su sits in $PATH, which modern Magisk deliberately doesn't do โ root is granted per-app through the Magisk daemon, not a globally exposed binary. Checking with Termux (su, approve the prompt, look for "#") was the actual reliable test.
Lesson from all of it: always dump stock boot.img before you touch anything with Magisk, and don't chain multiple Magisk changes (patch + Zygisk + reinstall) in one sitting.
THE TECHNICAL PART โ WHAT'S ACTUALLY HAPPENING UNDER THE HOOD
This is the part I actually care about as a cybersecurity student. Rooting a phone is one thing; understanding why the exploit works is the interesting bit.
BROM: the hardware root of trust, and its weak point
Every MediaTek SoC has a small piece of immutable ROM code called the BootROM (BROM). It executes before anything else โ before the bootloader, before any verified-boot checks, before Android. Its only job is to initialize minimal hardware and load the next stage. BROM exposes itself over USB as a VCOM device, waiting for a Download Agent (DA) to hand off to.
Normally Secure Boot (SBC) should prevent unsigned code from running at any stage. But BROM has to parse USB packets before DRAM is even initialized, using a tiny static SRAM buffer for its input handler. On the chips this attack targets, that handler doesn't properly bounds-check incoming packet length โ classic stack buffer overflow, before any signature check ever gets a chance to run.
This specific class of bug is widely known as Kamakiri, credited to researcher xyzz and expanded on by the chimera team, and it's the exploit mtkclient automates. It's worth noting this is a slightly different animal from the better-known CVE-2020โ0069, which actually targets a different component โ the MediaTek Command Queue (CMDQ) kernel driver, exploited post-boot rather than at BROM stage โ but both bugs trace back to the same open MediaTek rooting research that had been circulating on XDA-Developers forums for months before Google patched anything in 2020. Independent hardware research has since shown the BROM trust chain can be attacked other ways too โ NCC Group demonstrated the BootROM is vulnerable to fault injection (glitching), letting an attacker bypass preloader signature verification entirely on the hardware side, which tells you this isn't a one-off bug, it's a structural weak point in how these SoCs establish trust at boot.
What the exploit actually does, step by step:
- BROM entry โ device powers on in download mode, exposes USB VCOM, waits for a DA.
- Handshake โ mtkclient reads the hardware code, subcode, and a target-config byte that reports which security features (SBC, DAA, memory read/write auth, SLA) are enabled.
- Kamakiri trigger โ a crafted payload is sent over USB before DA authentication completes. The overflow hijacks BROM's execution and redirects it into attacker-controlled shellcode sitting in SRAM.
- DA Stage 1 patch โ with arbitrary code execution inside BROM, mtkclient uploads the real MediaTek Download Agent binary but patches it in memory first: disables hash_check, get_vfy_policy, the SBC checks and anti-rollback logic, before letting it run.
- DA Stage 2 โ the now-neutered Stage 1 DA sets up DRAM and hands off to Stage 2, which is what actually gives full flash read/write access over USB.
- EMMC access โ from here it's just normal flash I/O: read the GPT, dump partitions, write partitions. No more security checks are in the way because they were disabled two steps ago.
The key insight: once BROM is compromised, everything above it โ preloader, bootloader, TrustZone, Android itself โ inherits that compromise. All those "SBC enabled / DAA enabled / mem auth enabled" flags mtkclient reports are true, and completely irrelevant, because the bug that gets exploited runs earlier than all of them.
Why Magisk, specifically, and what "systemless" actually buys you
Old-school rooting (SuperSU era) wrote directly to /system/bin/su. That tripped dm-verity, broke OTA updates, and was trivially detectable by any app that hashed system files.
Magisk does none of that. It injects itself at the ramdisk level inside boot.img:
Stock: Bootloader -> kernel -> init (from boot.img ramdisk) -> Android Magisk: Bootloader -> kernel -> magiskinit (injected) -> real init -> Android
magiskinit runs first, sets up a tmpfs overlay, starts the magiskd daemon in the background, then quietly hands off to the real Android init as if nothing happened. The actual /system partition on EMMC is never touched โ overlays are mounted in memory via bind mounts ("Magic Mount"), and modules are just tmpfs injections applied at boot. Pull the module, reboot, the system is clean again. This is also the entire reason removing root later, or passing certain integrity checks, is possible at all โ there's nothing permanently written to detect.
For actual research use, this opens up a lot: Frida and objection for runtime instrumentation without root restrictions, MagiskTrustUserCerts to make Burp/Charles CAs system-trusted for full HTTPS interception on any app, LSPosed for Java method hooking, full read access to /data/data/* for forensics work. None of that is available without root, and all of it respects the systemless model โ remove Magisk, the device is back to stock.
WHAT I ACTUALLY BUILT WITH IT
Root was step one. After that: I stripped every Google app off the device (GApps, Play Services, the lot), replaced the launcher, and set up Termux with a proot-distro Arch Linux chroot so I've got an actual Arch userland โ pacman, a real shell, the works โ running on a phone in my pocket instead of carrying a laptop everywhere. Root made the degoogling and some of the deeper Termux/package work possible. The end result does what I wanted: a small, disposable, no-telemetry Linux box built out of a phone most people would've thrown in a drawer.
KEY TAKEAWAYS
- BROM is the actual hardware root of trust on MediaTek SoCs. If it's compromised, everything built on top of it is too โ the security flags mean nothing if the first stage has a bug.
- This class of chip will never get a BROM patch through a software update, because BROM is literally ROM. It's exploitable forever on affected silicon.
- Always, always dump your stock boot.img before you touch anything with Magisk. It's the one thing that saved my device from a hard brick.
- Root detection is an arms race โ old-style checks (which su) stopped meaning anything once Magisk went systemless; current detection relies on Play Integrity and hardware attestation instead.
REFERENCES
- mtkclient โ https://github.com/bkerler/mtkclient
- Magisk โ https://github.com/topjohnwu/Magisk
- CVE-2020โ0069, NVD entry โ https://nvd.nist.gov/vuln/detail/CVE-2020-0069
- "Critical MediaTek rootkit affecting millions of Android devices has been out in the open for months" โ XDA-Developers
- "There's A Hole In Your SoC: Glitching The MediaTek BootROM" โ NCC Group
- "CVE-2020โ0069: Autopsy of the Most Stable MediaTek Rootkit" โ Quarkslab
- like to pdf โ https://drive.google.com/file/d/1RGBJBvKTc2FPmVqLtZpdlmXZs-E5Fkpb/view?usp=sharing