[Guide] How to install Magisk on MIUI and How to install GSI roms

Search This thread

Ga_hap_la_chanh

Senior Member
May 15, 2016
81
20
Hello everyone, firstly, i'm not a dev. I'm just someone who really enjoying tweaking phones, Windows... So, in this post i'll show you how to install Magisk and GSI rom. Most of resources i took from 4PDA forum. Redmi 8A section on their forum is very active. My phone is Chinese variant (4-64), using MIUI 11 Xiaomi.eu rom / Havoc OS 3.1 GSI
Backup your data before doing anything!!!
Code:
#include <std/disclaimer.h>
/*
 * I am not responsible for bricked devices, dead SD cards, thermonuclear
 * war, or the current economic crisis caused by you following these
 * directions. YOU are choosing to make these modificiations, and
 * if you point your finger at me for messing up your device, I will
 * laugh at you.
 */

#1. Install TWRP

- First, you must unlock phone with Mi Unlock tool. Which can be download from http://en.miui.com/unlock/download_en.html The unlocking process normally will take about 14 days.
- After unlock the phone, flash twrp from @milankragujevic thread. https://xdaforums.com/xiaomi-redmi-8a/help/twrp-redmi-8a-olivelite-global-miui-10-t4006827
Now you'll have a working twrp.

#2 Install Magisk

1. Download lastest Magisk Flashable Zip from @topjohnwu thread: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
2. Download patcher tool (thanks to @YaAlex3): http://files.yaalex.tk/patcher.7z
3. Reboot the phone to TWRP, on the computer, open adb and type command:
Code:
adb shell dd if=/dev/block/by-name/boot of=/sdcard/boot.img
This'll pull your current boot image to sdcard
4. Unpack patcher.7z, copy boot.img to this folder. Open boot-patch.exe.
5. You'll have new_boot.img, flash this to boot partition using TWRP.
6. Flash Magisk you download at step 1
Caution: If bootloop happens, you may have to WIPE DATA.
7. Now you should have Magisk installed and working

If you can't patch the boot image file for some reasons, you can download here, choose the correct version, unzip and flash. If bootloop happens, wipe data in TWRP.
GLOBAL 11.0.3.0. PCPMIXM_20191219: Here
GLOBAL 11.0.1.0. PCPMIXM_20191121: Here
INDIA 11.0.3.0 .PCPINXM_20191119: Here
INDIA 11.0.1.0 .PCPINXM_20191105: Here
XIAOMI.EU 11.0.4.0 .PCPCNXM: Here
XIAOMI.EU 11.0.7.0. PCPCNXM: Here

#3 Install GSI Roms

Our phone is arm32binder64, so we'll download A64 A/B GSI rom to flash. In github of @phhusson, there is a list of GSI roms: https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list
After you choose a rom, we'll follow these steps to flash a GSI rom:
1. Unzip the rom you choose and you'll have image file (.img)
2. Copy to your phone, Flash Disable_Dm-Verity_ForceEncrypt_10.20.2019.zip to stay encrypted (optional, you can backup the /data but you can't setup password)
3. Make a factory reset and flash your unpacked image to system partition using TWRP or Orange Fox.
4. If you like Gapps, you can download Bitgapps or Opengapps (Arm) and flash (optional). But you must resize system partition first (advanced wipe -> repair or change file system -> resize system partition)
5. Flash Permissiver_v5.zip and Certification+Patch.zip
6. Go to Reboot and reboot to bootloader. Flash vbmeta using command:
Code:
fastboot flash vbmeta vbmeta.img 
fastboot reboot
Otherwise, you can flash vbmeta.img directly to vbmeta partition, no difference though.
7. Now your phone should be reboot.

After trying some GSI rom like Pixel, RR, Lineage OS, AOSP... There're some bug like:
- D2TW is present in phhusson setting but not working. Use Magisk module: magisk_force-d2tw.zip to fix
- Auto brightness
- Brightness Slider: Can be fixed using adb:
Code:
adb shell su -c setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
or using Terminal:
Code:
su
setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
- Camera Recording: You can use 3rd camera apps if bug occurs.
- When set password (pattern, etc...), next time you enter password, password will be wrong. (if you flash disable_dm... above), temp fix: boot to TWRP and remove some files in /data/system then reboot, password will be removed
Code:
locksettings.db-wal
locksettings.db-shm
locksettings.db
- Fix auto brightness, power consumtion... : copy treble-overlay-xiaomi-redmi8a.apk to /system/overlay then set permission 644, reboot.
- No Mac, IP address? Install the correct boot image.
- Some rom specific bugs...

UPDATE: On Havoc OS 3.1 from ExpressLuke, all the bugs are fixed, if any still present, just follow instructions above.

That is. I don't know why our device development is so slow after 2 months... So i decided to write this post. My main language is Vietnamese so if there's a grammar error, feel free to comment below. Thanks.
 

Attachments

  • Disable_Dm-Verity_ForceEncrypt_10.20.2019.zip
    2.7 MB · Views: 2,132
  • Certification+Patch.zip
    1.5 KB · Views: 1,312
  • treble-overlay-xiaomi-redmi8a.apk
    14.7 KB · Views: 1,172
  • Permissiver_v5.zip
    1.2 MB · Views: 1,077
  • magisk_force-dt2w.zip
    6.5 KB · Views: 904
Last edited:

arana1

Senior Member
Oct 27, 2011
262
38
Redmi Note 9
I get an error
C:\aaa\patcher>boot-patch.exe

Developer: YaAlex (yaalex.tk)
Thanks to:
acdev for zimage packer concept
And_PDA for AndImgTool
Igor Pavlov for 7zip
topjohnwu for magisk and all it's parts used here
Report any issues to t.me/yaalex3

UPDATER: Latest version is: 0.4

UPDATER: Current version is: 0.4
UPDATER: You have latest version!
INFO: Unpacking boot image....

ERROR: Can't find file: kernel.img
Press any key to continue . . .
Traceback (most recent call last):
File "C:\aaa\patcher\boot-patch.py", line 244, in <module>
File "C:\aaa\patcher\boot-patch.py", line 68, in die
NameError: global name 'quit' is not defined
 

Ga_hap_la_chanh

Senior Member
May 15, 2016
81
20
I am fixing patched boot.img from different firmware on 4pd, but if you want I will do it for you. Just take a screenshot of the phone settings where the firmware version is indicated and post your boot.img

Отправлено с моего Redmi 8A через Tapatalk

Can i add your patched boot.img from your post on 4PDA to my thread? Thanks.
 

Zeus Revolution

Senior Member
Feb 11, 2016
202
37
Caracas
Hello everyone, firstly, i'm not a dev. I'm just someone who really enjoying tweaking phones, Windows... So, in this post i'll show you how to install Magisk and GSI rom. Most of resources i took from 4PDA forum. Redmi 8A section on their forum is very active. My phone is Chinese variant (4-64), using MIUI 11 Xiaomi.eu rom.
Backup your data before doing anything!!!
Code:
#include <std/disclaimer.h>
/*
 * I am not responsible for bricked devices, dead SD cards, thermonuclear
 * war, or the current economic crisis caused by you following these
 * directions. YOU are choosing to make these modificiations, and
 * if you point your finger at me for messing up your device, I will
 * laugh at you.
 */

#1. Install TWRP

- First, you must unlock phone with Mi Unlock tool. Which can be download from http://en.miui.com/unlock/download_en.html The unlocking process normally will take about 14 days.
- After unlock the phone, flash twrp from @milankragujevic thread. https://xdaforums.com/xiaomi-redmi-8a/help/twrp-redmi-8a-olivelite-global-miui-10-t4006827
Now you'll have a working twrp.

#2 Install Magisk

1. Download lastest Magisk Flashable Zip from @topjohnwu thread: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
2. Download patcher tool (thanks to @YaAlex3): http://files.yaalex.tk/patcher.7z
3. Reboot the phone to TWRP, on the computer, open adb and type command:
Code:
adb shell dd if=/dev/block/by-name/boot of=/sdcard/boot.img
This'll pull your current boot image to sdcard
4. Unpack patcher.7z, copy boot.img to this folder. Open boot-patch.exe.
5. You'll have new_boot.img, flash this to boot partition using TWRP.
6. Flash Magisk you download at step 1
Caution: If bootloop happens, you may have to WIPE DATA.
7. Now you should have Magisk installed and working

If you can't patch the boot image file for some reasons, you can download here, choose the correct version, unzip and flash. If bootloop happens, wipe data in TWRP.
GLOBAL 11.0.3.0. PCPMIXM_20191219: Here
GLOBAL 11.0.1.0. PCPMIXM_20191121: Here
INDIA 11.0.3.0 .PCPINXM_20191119: Here
INDIA 11.0.1.0 .PCPINXM_20191105: Here
XIAOMI.EU 11.0.4.0 .PCPCNXM: Here

#3 Install GSI Roms

Our phone is arm32binder64, so we'll download A64 A/B GSI rom to flash. In github of @phhusson, there is a list of GSI roms: https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list
After you choose a rom, we'll follow these steps to flash a GSI rom:
1. Unzip the rom you choose and you'll have image file (.img)
2. Copy to your phone, Flash Disable_Dm-Verity_ForceEncrypt_10.20.2019.zip to stay encrypted (optional)
3. Make a factory reset and flash your unpacked image to system partition using TWRP.
4. If you like Gapps, you can download Bitgapps or Opengapps (Arm) and flash (optional)
5. Flash Permissiver_v4.zip and Certification+Patch.zip
6. Go to Reboot and reboot to bootloader. Flash vbmeta using command:
Code:
fastboot flash vbmeta vbmeta.img 
fastboot reboot
7. Now your phone should be reboot.

After trying some GSI rom like Pixel, RR, Lineage OS, AOSP... There're some bug like:
- Auto brightness
- Brightness Slider: Can be fixed using adb:
Code:
adb shell su -c setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
or using Terminal:
Code:
su
setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
- Camera Recording: You can use 3rd camera apps if bug occurs.
- When set password (pattern, etc...), next time you enter password, password will be wrong. (some case), temp fix: boot to TWRP and remove some files in /data/system then reboot, password will be removed
Code:
locksettings.db-wal
locksettings.db-shm
locksettings.db
- Some rom specific bugs...

That is. I don't know why our device development is so slow after 2 months... So i decided to write this post. My main language is Vietnamese so if there's a grammar error, feel free to comment below. Thanks.

Thanks!
 

ways2

Senior Member
Dec 21, 2019
123
29
OnePlus Nord
OnePlus Nord N100
Edit: was having problems at first and ended up in a bootloop but eventually got Magisk and Root working finally. Thanks a lot for your help!
 

Attachments

  • https___i.imgur.com_BxUsRg2.jpg
    https___i.imgur.com_BxUsRg2.jpg
    63.8 KB · Views: 1,262
  • https___i.imgur.com_X9uGKrP.jpg
    https___i.imgur.com_X9uGKrP.jpg
    106.2 KB · Views: 1,259
Last edited:

marcachas

Senior Member
Apr 18, 2016
70
13
Hello everyone, I send you my best regards.
I comment. -
I have a global 8th redmi (olivelite), I unlocked the bootloader and continued to install the unofficial TWRP, but there is a problem, my touch screen does not work.
That's why I tried Orangefox and the touch panel worked without problems, I could erase everything except the micro SD, and continued to install Mi Globe 11.0.7, the most recent.

But at the time of finishing and restarting, restart only in recovery, no more, again and again.
Try once installed the rom my globe, flash twrp and force start by fastboor reboot, but it didn't work either.
Also install by fastboot, boot.img of the rom eu, of the global and also the patched by magysk and it didn't work either.
I am NOT looking for root, I am NOT looking for magysk, just install rom MY GLOBE clean, as in all my xiaomis, then I ask.

Has anyone been able to install Xiaomi.eu successfully on your device? With orangefox what was your process? With TWRP and the OTG, do you think I can start?

I would greatly appreciate your response. ):
 

Ga_hap_la_chanh

Senior Member
May 15, 2016
81
20
Hello everyone, I send you my best regards.
I comment. -
I have a global 8th redmi (olivelite), I unlocked the bootloader and continued to install the unofficial TWRP, but there is a problem, my touch screen does not work.
That's why I tried Orangefox and the touch panel worked without problems, I could erase everything except the micro SD, and continued to install Mi Globe 11.0.7, the most recent.

But at the time of finishing and restarting, restart only in recovery, no more, again and again.
Try once installed the rom my globe, flash twrp and force start by fastboor reboot, but it didn't work either.
Also install by fastboot, boot.img of the rom eu, of the global and also the patched by magysk and it didn't work either.
I am NOT looking for root, I am NOT looking for magysk, just install rom MY GLOBE clean, as in all my xiaomis, then I ask.

Has anyone been able to install Xiaomi.eu successfully on your device? With orangefox what was your process? With TWRP and the OTG, do you think I can start?

I would greatly appreciate your response. ):
Hi, have you try to wipe yet? Or try to wipe internal storage? I don't use miglobe but i'm using xiaomi.eu rom and this rom works great for me. And don't flash boot.img because each version is different.
 

dmitrypershin2015

Senior Member
Mar 14, 2016
340
143
37
rechitsa
Hi, have you try to wipe yet? Or try to wipe internal storage? I don't use miglobe but i'm using xiaomi.eu rom and this rom works great for me. And don't flash boot.img because each version is different.
Miui 11.0.7 is not global, it apparently flashed either Chinese, or xiaomi.eu .
I posted the patched boot.img for xiaomi.ue 11.0.7 on 4pda

Sorry for my bad english. I am not literate and in Russian )))
 
  • Like
Reactions: Ali.imran900

Ga_hap_la_chanh

Senior Member
May 15, 2016
81
20
Miui 11.0.7 is not global, it apparently flashed either Chinese, or xiaomi.eu .
I posted the patched boot.img for xiaomi.ue 11.0.7 on 4pda

Sorry for my bad english. I am not literate and in Russian )))

He wrote mi-globe which is a rom modified from xiaomi.eu rom. I haven't updated the post yet. By the way i feel somehow MIUI is bad at wifi compare to GSIs. But GSIs have many bug, sometimes they won't boot at all. I noticed that you installed havoc os before, does it have double tab to wake device?
 

dmitrypershin2015

Senior Member
Mar 14, 2016
340
143
37
rechitsa
He wrote mi-globe which is a rom modified from xiaomi.eu rom. I haven't updated the post yet. By the way i feel somehow MIUI is bad at wifi compare to GSIs. But GSIs have many bug, sometimes they won't boot at all. I noticed that you installed havoc os before, does it have double tab to wake device?
I have all the gsi loaded which I tried. Double tap does not work

Sorry for my bad english. I am not literate and in Russian )))
 

ways2

Senior Member
Dec 21, 2019
123
29
OnePlus Nord
OnePlus Nord N100
I've been using havoc os 10 for the past day and so far I really like it. MIUI is really sluggish compared to havoc. So far I have not really noticed any bugs besides the brightness which was easily fixed using the command in the original post and not being able to apply a screenlock.
 

Attachments

  • IMX3fir.jpg
    IMX3fir.jpg
    68 KB · Views: 256
Last edited:

dmitrypershin2015

Senior Member
Mar 14, 2016
340
143
37
rechitsa
I've been using havoc os 10 for the past day and so far I really like it. MIUI is really sluggish compared to havoc. So far I have not really noticed any bugs besides the brightness which was easily fixed using the command in the original post and not being able to apply a screenlock.
I have a dialer for havoc os with recording calls (but it doesn’t work very loudly) and a patch for increasing the volume in the headphones + libraries from the Samsung. I can give

Sorry for my bad english. I am not literate and in Russian )))
View attachment 4931461
 

marcachas

Senior Member
Apr 18, 2016
70
13
Hi, have you try to wipe yet? Or try to wipe internal storage? I don't use miglobe but i'm using xiaomi.eu rom and this rom works great for me. And don't flash boot.img because each version is different.



Excellent, thanks for your reply.
Could you be a little more specific about the steps you took?
Formatting before installing the ROM, or after?
For example, I followed these steps.

Unlock the bootloader.
Fastboot, install the vbmeta first (or something like that).
install the Orange fox recovery, then the orangefox zip.
Clean EVERYTHING (dalvik cache, intertnal storage, etc), except SD.
Install MY GLobe ROm Olivelite.
Start in recovery, restart again, without changes, continue to start in recovery, and so, for eternity.

I did not do the formatting, and I do not use TWRP because the touch panel does not work with that, so I only have Orangefox as an alternative, could you try to install the MI Globe ROM please? https://mi-globe.com/miui-firmware-rom-builder-features/41/
Thanks for everything.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    Hello everyone, firstly, i'm not a dev. I'm just someone who really enjoying tweaking phones, Windows... So, in this post i'll show you how to install Magisk and GSI rom. Most of resources i took from 4PDA forum. Redmi 8A section on their forum is very active. My phone is Chinese variant (4-64), using MIUI 11 Xiaomi.eu rom / Havoc OS 3.1 GSI
    Backup your data before doing anything!!!
    Code:
    #include <std/disclaimer.h>
    /*
     * I am not responsible for bricked devices, dead SD cards, thermonuclear
     * war, or the current economic crisis caused by you following these
     * directions. YOU are choosing to make these modificiations, and
     * if you point your finger at me for messing up your device, I will
     * laugh at you.
     */

    #1. Install TWRP

    - First, you must unlock phone with Mi Unlock tool. Which can be download from http://en.miui.com/unlock/download_en.html The unlocking process normally will take about 14 days.
    - After unlock the phone, flash twrp from @milankragujevic thread. https://xdaforums.com/xiaomi-redmi-8a/help/twrp-redmi-8a-olivelite-global-miui-10-t4006827
    Now you'll have a working twrp.

    #2 Install Magisk

    1. Download lastest Magisk Flashable Zip from @topjohnwu thread: https://xdaforums.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
    2. Download patcher tool (thanks to @YaAlex3): http://files.yaalex.tk/patcher.7z
    3. Reboot the phone to TWRP, on the computer, open adb and type command:
    Code:
    adb shell dd if=/dev/block/by-name/boot of=/sdcard/boot.img
    This'll pull your current boot image to sdcard
    4. Unpack patcher.7z, copy boot.img to this folder. Open boot-patch.exe.
    5. You'll have new_boot.img, flash this to boot partition using TWRP.
    6. Flash Magisk you download at step 1
    Caution: If bootloop happens, you may have to WIPE DATA.
    7. Now you should have Magisk installed and working

    If you can't patch the boot image file for some reasons, you can download here, choose the correct version, unzip and flash. If bootloop happens, wipe data in TWRP.
    GLOBAL 11.0.3.0. PCPMIXM_20191219: Here
    GLOBAL 11.0.1.0. PCPMIXM_20191121: Here
    INDIA 11.0.3.0 .PCPINXM_20191119: Here
    INDIA 11.0.1.0 .PCPINXM_20191105: Here
    XIAOMI.EU 11.0.4.0 .PCPCNXM: Here
    XIAOMI.EU 11.0.7.0. PCPCNXM: Here

    #3 Install GSI Roms

    Our phone is arm32binder64, so we'll download A64 A/B GSI rom to flash. In github of @phhusson, there is a list of GSI roms: https://github.com/phhusson/treble_experimentations/wiki/Generic-System-Image-%28GSI%29-list
    After you choose a rom, we'll follow these steps to flash a GSI rom:
    1. Unzip the rom you choose and you'll have image file (.img)
    2. Copy to your phone, Flash Disable_Dm-Verity_ForceEncrypt_10.20.2019.zip to stay encrypted (optional, you can backup the /data but you can't setup password)
    3. Make a factory reset and flash your unpacked image to system partition using TWRP or Orange Fox.
    4. If you like Gapps, you can download Bitgapps or Opengapps (Arm) and flash (optional). But you must resize system partition first (advanced wipe -> repair or change file system -> resize system partition)
    5. Flash Permissiver_v5.zip and Certification+Patch.zip
    6. Go to Reboot and reboot to bootloader. Flash vbmeta using command:
    Code:
    fastboot flash vbmeta vbmeta.img 
    fastboot reboot
    Otherwise, you can flash vbmeta.img directly to vbmeta partition, no difference though.
    7. Now your phone should be reboot.

    After trying some GSI rom like Pixel, RR, Lineage OS, AOSP... There're some bug like:
    - D2TW is present in phhusson setting but not working. Use Magisk module: magisk_force-d2tw.zip to fix
    - Auto brightness
    - Brightness Slider: Can be fixed using adb:
    Code:
    adb shell su -c setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
    or using Terminal:
    Code:
    su
    setprop persist.sys.qcom-brightness $(cat /sys/class/leds/lcd-backlight/max_brightness)
    - Camera Recording: You can use 3rd camera apps if bug occurs.
    - When set password (pattern, etc...), next time you enter password, password will be wrong. (if you flash disable_dm... above), temp fix: boot to TWRP and remove some files in /data/system then reboot, password will be removed
    Code:
    locksettings.db-wal
    locksettings.db-shm
    locksettings.db
    - Fix auto brightness, power consumtion... : copy treble-overlay-xiaomi-redmi8a.apk to /system/overlay then set permission 644, reboot.
    - No Mac, IP address? Install the correct boot image.
    - Some rom specific bugs...

    UPDATE: On Havoc OS 3.1 from ExpressLuke, all the bugs are fixed, if any still present, just follow instructions above.

    That is. I don't know why our device development is so slow after 2 months... So i decided to write this post. My main language is Vietnamese so if there's a grammar error, feel free to comment below. Thanks.
    2
    is your boot patch tools different from magisk app‘s boot patch?
    it is
    2
    Doing something wrong. Or try a different version of magisk. 20.1

    Sorry for my bad english. I am not literate and in Russian )))

    It seems my boot image is a mess. I need to flash patched boot image befor flashing magisk zip. Trouble is I am unable to use the site that patches boot image. It says internal system error... I have a friend wo said he'll patch and send me the image file.
    2
    @YaAlex3 http://files.yaalex.tk/patcher.7z is down, can you please update it?
    http://patcher.yaalex.tk
    web version
    update guide with that too please.
    2
    That's good to hear. I'd be curious to know if you decide to use Gapps or not?

    The reason I ask is because I found installing Gapps to be a little tricky. Most instructions say to install Gapps before you initially boot into the system for the first time but whenever I would do this I would be stuck in a bootloop and would absolutely have to restore a back up.

    Only thing that would work for me is installing Gapps after booting into the system and using it a little bit. I was able to successfully install Gapps using opengapps.org (nano package then install what I need later.) and so far it's working well

    I installed Gapps [pico gapps] while I was installing the system. It bootlooped so I just forced a shutdown, went to TWPR, formatted data and it booted up fine.

    The whole things seems a little bit of hit-or-miss but everything is going pretty smooth here so far now.

    Thanks for the help.