Author Topic: How I installed latest Magisk on Rooted Android 8.1  (Read 1123 times)

amondo

  • Newbie
  • *
  • Posts: 2
    • View Profile
How I installed latest Magisk on Rooted Android 8.1
« on: March 19, 2023, 03:00:58 pm »
Introduction
Magisk is actually made of two parts. The first is an Android app that used to be called Magisk Manager (but now the Android app is just called Magisk). The second part of Magisk is a patch that is applied to the boot image, for example this can be installed using TWRP.

In the case of the Gemini, the "Rooted Android" boot image for Android 8.1 is already patched with Magisk, although it is quite an old version. If you install an old version of Magisk Manager (try for example v8.0.7 or older) then it will recognize the patched boot image, and Magisk Manager will make it possible to grant apps superuser permission. But this is probably all that it can be used for, because current Magisk Modules likely will no longer work. If you are you happy with this, and don't need Magisk Modules, then just disable checking for updates.

But if you want to use the latest Magisk, and be able to use recent Magisk Modules, you will need to patch the boot image. This guide will explain how I did that, as best as I can remember.

Pre-requisites
- You know how to use Gemini Partition Tool
- You know how to use FlashTool

Limitations
- Only tested on Gemini WIFI and no other variant.
- Only tested using the Android 8.1 Gemini firmware.
- Only tested with Rooted Android on Boot 1 and TWRP Recovery on Boot 2.

Warning
- You may lose data if you are not careful when flashing

Steps
1. Flash the Gemini with Rooted Android on Boot 1 and TWRP Recovery on Boot 2 using the Android 8.1 Gemini firmware. Keep a copy of the original root_boot.img from the gemini_WIFI_base.zip.
2. Download and install the latest Magisk APK from the Magisk official Github releases page
3. Launch Magisk and upgrade the app within the app itself by clicking "Install".
4. Reboot the device.
5. Copy the current root_boot.img onto the Gemini, for example in the Download folder.
6. Launch Magisk and head over to Update.
7. Under Options, accept the default options and press NEXT.
8. Under Method, choose Select and Patch a File.
9. Choose the root_boot.img file, and Magisk will patch it and print the path of the patched image, it will have a filename like magisk_patched-25200_gBTip.img. Keep a copy of this.
10. Copy the patched image from the Gemini to the computer that is doing the flashing. Overwrite the root_boot.img file in the unpacked firmware directory with the patched version. But check that the replacement file has file mode bits 0740 (ie. run: 'chmod 0740 root_boot.img').
11. In the FlashTool, go to the Download tab and only select boot and boot3 (the only rows that use root_boot.img). All other checkboxes should be unchecked.
12. Connect the Gemini, press the green Download button, and then reboot the Gemini to commence flashing.

In case Magisk app complains that it needs to perform "Additional Setup", this means you will need to re-flash the current boot image again. Repeat from step 5 using the patched image as the starting image. In my case, Magisk App 25.2 (25200) only upgraded the Magisk patch to version 22.1 (22100). Then after booting up on the patched boot image, it asked to upgrade again, and when I re-patched and re-flashed the root_boot.img, I was finally at the latest patch version 25.2 (25200) matching the App version.
« Last Edit: March 20, 2023, 03:16:41 pm by amondo »