Author Topic: Update Magisk v22.0 to v22.1 on rooted Android v25  (Read 7064 times)

Onkel Otto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Update Magisk v22.0 to v22.1 on rooted Android v25
« on: April 11, 2021, 08:00:05 pm »
I had managed, to install rooted Android from Planet following their instructions given here:
https://support.planetcom.co.uk/index.php/Rooted_Android_For_Cosmo
After installation of the rooted Android v25 the update of Magisk to version 22.0 also worked.

Today Magisk "told me", that an update to v22.1 is available.
I tapped on "Install" for the App itself in the Magisk Manager App. That worked well and Magisk on my Cosmo showed version 22.1 for the Magisk app.
Then I tapped "Install" for Magisk (the upper "Install).

This failed. At the required reboot the Cosmo showed a message like "Your device failed verification and will not work properly. You have to unlock the bootloader".
I had decided to install the Planet version of the rooted Android, because it does not require to unlock the bootloader.

After some searching and some thinking it became kind of obvious for me, that the Magisk Manager has modified the "normal boot.img" and not the rooted one. I think, this happened, because the rooted boot image is installed in partition 41 - labeled "EMPTY_NORMAL_BOOT_3" before the installation of the rooted boot image and renamed to "ROOTED_ANDROID" by the Planet recovery installer.

My way to fix the issue:
I restored the boot.img from a TWRP backup I had created before.
Reboot - the message regarding "verification / unlock bootloader" was gone.

I booted into the rooted Android. Luckily, this also worked.
Then I copied the "root-boot.img" from the "cosmo-customos-installer" folder on the SD card to /storage/emulated/0/download
I was using the "TotalCommander" file manager app, but this could have been done with every other file manager.
I opened the Magisk Manager and tapped on "Install" for Magisk (the upper "Install).
On the next page I left both checkboxes checked. I don't know, if the first one (Forced ...) is mandatory or important for the following task. But the second checkbox for "Recovery Mode" must be checked.
Then I tapped on "Next Step".
This opened the next section in Magisk Manager where I could choose "Select and Patch a File".
This immediately opened the Magisk file manager with the focus in the download folder. I tapped on the "root-boot.img" file and then on "Los geht's". I have the German localization of Magisk. In the English version this may be something like "go on" or "Do it".

Magisk Manager was patching the selected "root-boot.img".
The progress was shown in a text console.
The final message was:
Output file is written to
 /storage/emulated/0/Download/magisk_patched-22100_wvwcD.img 

I rebooted the Cosmo to rooted Android.
With the file manager (TotalCommander) I deleted "root-boot.img" in the "cosmo-customos-installer" folder on the SD card
Then I copied "magisk_patched-22100_wvwcD.img" to the the "cosmo-customos-installer" folder on the SD card and renamed it to "root-boot.img"
Next I rebooted to the Planet recovery.
There I selected
- Install Custom OS on your Cosmo
- Install Rooted Android for Firmware v25
- I selected "ROOTED_ANDROID" as destination
- Reboot system now

Again I booted the Cosmo to rooted Android.
It worked perfectly.
I opened the Magisk Manager app - and - voila - Magisk and the App were both on version 22.1.

I found the necessary background information on this site:
https://topjohnwu.github.io/Magisk/install.html#boot-image-patching

And I would be happy, if my text will help somebody to update Magisk on a rooted Cosmo.





paoloe

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #1 on: April 12, 2021, 06:24:02 pm »
Thanks, your post gave me a few pointers, but I have another problem: when I try to boot in Recovery I get an error "Your device failed verification and will not work properly. Please download recovery with correct signature or disable verified boot." This way I can't flash the patched boot image.

I still can boot in Rooted Android and Fastboot mode, so my guess is I should try flashing via Fastboot the official Cosmo Recovery, but I can't seem to find it anywhere, and I'm not sure which TWRP version I could install in its place.

Is there some Android Guru who can give a noob some help?

TIA

Okay, looks like I stumbled upon the solution (or was just plain lucky): I tried booting in Recovery from Normal Android and using the On+Volume Up key combo, and this time it just worked.
I flashed the newly patched Boot image and now Magisk is at 22.1.

All's well that ends well, I guess...
« Last Edit: April 12, 2021, 06:40:40 pm by paoloe »

LinuxGuy

  • Jr. Member
  • **
  • Posts: 89
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #2 on: April 14, 2021, 12:07:30 pm »
Huhh all these stories (and some "upating magisk" - experience will let me merely refrain from touching it! Thanks for your advice anyway!

oida

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #3 on: May 01, 2021, 01:24:34 pm »
Just rename the magisk  .img to .zip and flash with twrp. the restart fails going to fastboot first, but another off / on brings you to the boot loader as usual. no problems at all.

paoloe

  • Newbie
  • *
  • Posts: 42
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #4 on: May 12, 2021, 01:15:20 pm »
Just rename the magisk  .img to .zip and flash with twrp. the restart fails going to fastboot first, but another off / on brings you to the boot loader as usual. no problems at all.

To be fair, this is reported on Magisk topjohnwu page:

Quote
CUSTOM REVOVERY

This installation method is deprecated and is maintained with minimum effort. YOU HAVE BEEN WARNED!
It is very difficult to accurately detect the device’s information in custom recovery environments. Due to this reason, installing Magisk through custom recoveries on modern devices is no longer recommended. If you face any issues, please use the Patch Image method as it is guaranteed to work 100% of the time.

- Download the Magisk APK
- Rename the .apk file extension to .zip, for example: Magisk-v22.0.apk → Magisk-v22.0.zip. If you have trouble renaming the file extension (like on Windows), use a file manager on Android or the one included in TWRP to rename the file.
- Flash the zip just like any other ordinary flashable zip.
- Reboot and check whether the Magisk app is installed. If it isn’t installed automatically, manually install the APK.

Onkel Otto

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #5 on: May 17, 2021, 06:10:32 pm »
Just rename the magisk  .img to .zip and flash with twrp. the restart fails going to fastboot first, but another off / on brings you to the boot loader as usual. no problems at all.

I also tried to install Magisk this way. But it was installed in the normal Android partition. I did not find any way to install it to the rooted Android Partition with TWRP.

oida, how did you manage to install Magisk to the rooted Android partition with TWRP?

Have you locked the bootloader of your Cosmo?
If not you have probably installed Magisk into the normal Android partition. With open bootloader it does not matter. The Cosmo will boot and start Android. You just have rooted your "Normal Android" this way - assuming, that you used Planets way of rooting.

But with a locked bootloader it will show a message "Your device failed verification and will not work properly. You have to unlock the bootloader" or similar.
The Cosmo could not boot the "Normal Android" anymore. It could still boot the rooted Android, but Magisk was not updated in this partition.

The benefit of Planet Computers rooting solution is, that the device can have a locked bootloader plus a rooted Android. Planet has created a boot menu to choose between several boot options including "Normal Android" (= not rooted) and "rooted Android".
The disadvantage is, that i.e., updating Magisk requires some attention.

Digby

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #6 on: June 03, 2021, 12:57:16 pm »
Thanks Onkel, your patch image post #1 worked for me and now both Magisk and the App on my Cosmo are ver 23.0 (23000).
Cheers  :)
« Last Edit: June 03, 2021, 01:04:03 pm by Digby »

bolderz

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: Update Magisk v22.0 to v22.1 on rooted Android v25
« Reply #7 on: January 16, 2022, 01:12:04 pm »
Thanks again, Onkel, I have successfully updated Magisk in the rooted boot to V23 using the procedure detailed in the first post.  The updated version is now shown in both panels of the app and both normal and rooted Android boot run normally without failing verification.