Skip to content

Guide

Posted on:September 3, 2023 at 12:00 AM

Realme 8 MEGAGUIDE

==================

If you have any questions at any moment feel free to message Realme 8 AOSP on Telegram or open a new Discussion on GitHub. Also check the FAQ (frequently asked questions)

Disclaimer - We WON’T be responsible if anything happens with your device. - Neither Windows 7 (old python version) nor RealmeUI 4 (lk method was patched) are supported

ℹ️ If you have unlocked already skip to [EXTRA] Installing a Custom recovery and ROM

✴️ Make sure to read and do all of the steps to avoid your device being bricked.

📛 WARNING: RUI4 disables fastboot access if previously unlocked, only upgrade to RUI3 until it is resolved.

✨✨✨ You can revert all the changes by following Revert


Table of Contents

Open Table of Contents

0. Back up your system partitions

[!CAUTION]

BEFORE ATTEMPTING ANY OPERATIONS FOLLOW THE Backup guide (in wiki)

Backup guide (in wiki)

I. Unlocking

Prerequisites

1. Installing prerequisites

  1. Mediatek USB

    1. Extract and enter the folder of Mediatek USB driver.

    2. Find the .inf file, right click and press install

      Image

  2. Install USBDk

  3. Install Python from Microsoft Store

🛑 Do not disconnect the phone during the flashing and unlocking processes

2. Downgrade to RUI2

  1. Extract MTK Client and open a cmd in the folder where you extracted the files

    Image

  2. Get the needed libraries using command python -m pip install -r requirements.txt. Send the payload with python mtk payload. It should look like this:

    Image

  3. Make sure your phone is powered off, hold down both Vol+, Vol- and connect the usb cable. MTK Client should output something like this:

    Image

  4. The phone is now in BROM mode. Run the SP Flash tool flash_tool.exe

  5. Click on Options > Option... and make sure the right COM Port is selected, UART enabled and baud rate is set to 921600.

    Image

  6. Unpack Haadi’s A.19 RUI2 Firmware and load the scatter.txt file

    Image

    🛑 Remember to uncheck: opporeserve2 and cdt_engineering

    opporeserve2 (Signed partition)cdt_engineering (Digital warranty codes)
  7. Remember to have Download Only mode.

    Image

  8. Avoid moving your phone so as to not disconnect anything. This process will take up to 15-20 minutes. To get A.19 on your phone, click Download. No progress? Click me

    Image

  9. If everything goes well, it should look like this.

    Image

  10. Before doing anything, we’ll WIPE the phone for safety. Hold down Vol-, and power button, In recovery select wipe data, and then select Format Data.

3. Unlocking the bootloader

  1. Open the console in MTK Client’s folder

  2. Reboot your device, turn it off and Hold down both Vol+, Vol- - (Don’t leave the buttons until the command is done)

  3. Type python mtk e metadata,userdata,md_udc - This assetscommand wipes your data. It should look like this:

  4. Unlock the bootloader using command python mtk da seccfg unlock, the output should look like this

    🔄 After this, turn on your phone. First boot will take around 5-20 minutes.

    📛 You will see dm-verity corruption and orange state warnings. Press the Power Button to continue. These are normal and will be patched later in the guide.

  5. Your bootloader is now unlocked.

❗ Check FAQ (frequently asked questions) if something does not work or you have questions

4. Upgrade to RealmeUI 3

  1. Open a cmd again in MTK Client’s folder

  2. Send the payload with python mtk payload:

  3. Make sure your phone is powered off, hold down both Vol+, Vol- and connect the usb cable. MTK Client should output something like this:

    Image

  4. The phone is now in BROM mode. Run the SP Flash tool flash_tool.exe

  5. Click on Options > Option... and make sure the right COM Port is selected, UART enabled and baud rate is set to 921600.

  6. Unpack SG’s C.18 RUI3 Firmware and load the MT6785_Android_scatter.txt file

  7. Remember to have Download Only mode

  8. Place your phone on a stable surface, to not disconnect anything. This process will take up to 15-20 minutes. To get C.18 on your phone, click Download. No progress? Click me

  9. If everything goes well, it should look like this:

    Image

  10. Before continuing, you’ll need to WIPE the phone for safety. Hold down Vol-, and power button, In recovery select wipe data, and then select Format Data.

❗ Check FAQ (frequently asked questions) if something does not work or you have questions


II. Patching lk- qetting fastboot access and removing dm-verity and orange state warnings

❕ SKIP ONLY IF you unlocked with DEEP TESTING

🛑 Do not disconnect the phone during the process

  1. Open the console again in MTK Client folder

  2. Make sure your phone is powered off, hold down both Vol+, Vol- and connect the usb cable.

  3. Run the command python mtk r lk lk.bin. There will now be a lk.bin file in MTK Client folder.

  4. Go to this website. Upload your lk.bin file and the lk-patched.bin will be downloaded. Move it to MTK Client folder. If the website gives an error check FAQ #2

  5. Run command python mtk w lk lk-patched.bin

Check the FAQ if you have any issues

III. Installing a Custom Recovery and ROM

Prerequisites

1. Rebooting to fastboot

Your device needs to be turned on

  1. Open a command prompt window in the platform-tools folder.
  2. On your phone, enable Developer Options and enable USB Debugging.
  3. In the platform-tools folder open a command prompt and run adb devices. You will see Allow USB Debugging for ... on phone, check Always allow... and hit Allow.
  4. In the command prompt run adb reboot boootloader. Phone will reboot to a screen that says fastboot_unlock_verify ok.

❗ Check FAQ (frequently asked questions) if something does not work or you have questions

2. Installing custom recovery and sideloading custom rom

⚠️ If switching between custom roms skip step 2.

⚠️ If the required recovery has not changed you may skip step 3 as well, and run adb reboot recovery directly.

  1. Move the recovery.img and vbmeta.img files to the platform-tools folder.

  2. Run the command fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img. It should show

  3. Run the command fastboot flash recovery recovery.img. The phone should show USB Transmission ok/

  4. Now, reboot to recovery mode with the command fastboot reboot recovery

  5. In recovery, go to Factory reset > Format data/factory reset > Format data. After factory reset go back and select Apply update > Apply from ADB. You should see this when running adb devices:

  6. Now run the command adb sideload custom-rom.zip (replace custom-rom.zip with custom rom package name). For example I flashed LeafOS 2:

  7. ONLY do this step on custom roms WIHTOUT GAPPS / GMS (check the rom’s description to check). Select Apply update > Apply from ADB again and run adb sideload gapps.zip (replace gapps.zip with package name).

  8. Once finished, in the recovery go back to Reboot system now. The phone will reboot into your Custom ROM.

⚠️ If you get a “Signature verification error” on your phone, click Yes to continue anyways, this goes the same to any other ZIPs you flash.

IV. Rooting

1. With Magisk

You will need

  1. Open the console in MTK Client’s folder

  2. Run python mtk r boot boot.img. Turn your device off, hold down both Vol+, Vol- and connect the device to the computer.

  3. A boot.img file will be created in the folder. Turn your device on and copy the file to it.

  4. Navigate to where you donwnloaded the Magisk Manager apk file and install it.

  5. Open Magisk Manager and click install next to Magisk.

  6. Select Patch vbmeta in boot image and click Select and patch a file. The file picker will open, Find and select the boot.img you extracted.

  7. When you see this screen, the patching is done and you will be givne the path of the patched .img file. Copy that file to your computer in the platform-tools folder.

  8. Connect your pphone to your computer, enable usb debugging on your phone and, in the platform-tools folder open a Command Prompt and run the command adb devices. Accept USB Debugging on your phone and run and reboot bootloader. The phone will reboot to a fastboot_unlock_verify ok screen.

  9. Now in the cmd run the command fastboot flash boot <> and hit Enter. Once successfully transferred, run fastboot reboot

  10. The phone will restart and you are now rooted with Magisk! ### To remove Magisk root, select Uninstall > Complete uninstall in the Magisk Manager app.

2. With KernelSU

🚫 ONLY WORKS ON CUSTOM ROMS (DO NOT ATTEMPT on RealmeUI)

You will need

⚠️ If you get a “Signature verification error” on your phone, click Yes to continue anyways, this goes the same to any other ZIPs you flash.

  1. You need to be in recovery mode; run adb reboot recovery

  2. In recovery select Apply update > Apply from ADB and run adb sideload kernelsu.zip.

  3. When completed tap Reboot system now. Your phone will restart. Navigate to where you donwnloaded the KernelSu Manager apk file and install it.

  4. The app should show like this indicating thaat everything has been done correctly:

  5. If you want to remove KernelSU root, extract the custom-rom.zip you downloaded to flash the ROM, find and move the boot.img to the folder where adb is and run these commands in a command prompt:

🎴 More extras in WIKI

Special thanks & credits

Ben - Made everything possible by making the kernel for Realme 8
bkerler - developer of MtkClient
Roger - creator of oplus-unlock
Haadi - RUI2 firmware
SGtriangle - RUI3 firmware
HowWof - A lot of help, Leaf OS 2 for RMX3085 developer
Ripper_Hybrid - provided KSU zip file, helped with wiki guides
MrPotato6 - Info and screenshots for Magisk rooting
Nand kumar - original poster of backup guide
Zako Chan - Information about walkthrough with downgrade
Tony stark - RUI2 unlock guide
Original Custom ROM Guide
Magisk & Developers
KernelSU & Developers
Banner and others via Canva - Refer to Canva’s CLA for more info
Text images made in Drawing
Telegram: Realme 8 AOSP Witten by me with 🫶.

No guarantees are given at any point. Use with caution. Neither me nor contributors are responsible for any damage you do to your device(s).