2

I had a working Samsung S10 which was already rooted with Magisk (v20.*). Due to a Magisk update (v24.1) my root got broken... So I need the manual way.

I successfully patched the stock "recovery.img" trough Magisk "Select and Patch a file" method since the "Direct Install" is not working any more for some reason I don't understand ("Installation Failed. Unable to detect target image"). The official website recommends to flash the "recovery.img" trough "fastboot". But then I discovered fastboot is not available for Samsung phones. So I need to use Odin. But Odin is not accepting *.img files...

I do not want to loose my current Android installation because it's very customised. But I need my root back.. I searched and searched for days for a working solution to manage this. So this request is my last hope as I can really not find a way to manage this...

How can I safely flash this "magisk_patched" "recovery.img" to my "Samsung S10" without wiping any data? And does this Magisk patched "recovery.img" contains my existing TWRP recovery? Or do I need to reinstall it after the upgrade? I remember when I first rooted my phone it was quite complicated to do this since the Samsung S10 does not have a ramdisk so the recovery partition is shared with TWRP and the Magisk su.

Does anyone has any good advice how to manage this without losing my data (and Android10 installation)? Magisk delivered me a 6.2GB "magisk_patched-24300_8m9cQ.tar" file but I'm scared to flash it trough Odin as I don't want to loose my data on my "512GB sdcard" internal storage.

I know this is a complicated situation but any help would be highly appreciated as I really don't know what to do any more to manage this.

1
  • Comments are not for extended discussion; this conversation has been moved to chat.
    – Andrew T.
    Mar 26, 2022 at 22:30

1 Answer 1

2

After some great help from @alecxs I managed to fix the problem, without losing any data, all the googled tutorials tell to use fastboot, which is not available for Samsung devices, so this is the guide for Samsung S10 users who have a working twrp recovery installed but are unable to preform the automatic update from within the Magisk Manager app. (of course you need adb and developer mode enabled on your phone)

  • first of all, for just in case, make a backup of all your partitions in twrp, also make a backup of your personal data stored in /sdcard

  • in twrp, use the following adb commands to get an image from boot, recovery and vbmeta partitions from a terminal window on your computer:

    adb pull /dev/block/platform/13d60000.ufs/by-name/boot *:\Magisk\Unpatched\boot.img

    adb pull /dev/block/platform/13d60000.ufs/by-name/recovery *:\Magisk\Unpatched\recovery.img

    adb pull /dev/block/platform/13d60000.ufs/by-name/vbmeta *:\Magisk\Unpatched\vbmeta.img

  • make a tar archive of these 3 images (you can use 7zip for this)

  • boot back into Android, transfer the tar to your phone, start MagiskManager, next to Magisk, tap Install... with Options, be sure Recovery Mode is checked (since Magisk on Samsung S10 starts it deamon trough recovery as there is no ramdisk), tap Next, Select and Patch a File, select the tar, and let Magisc do its Magic.

  • check the log file, if it says: Magisk patched boot image detected you're good to go...

  • go find the magisk_patched*.tar in your ~/Download, copy it to your computer, extract the tarred images to a folder on your computer, for example: *:\Magisk\Patched\, remove the '.img' suffix from the three image files as adb can only manage them without the '.img' suffix!

  • boot back into twrp recovery, connect your phone trough usb and transfer the MagiskPatched images back to your phone trough the following adb commands:

    adb push *:\Magisk\Patched\boot /dev/block/platform/13d60000.ufs/by-name/boot

    adb push *:\Magisk\Patched\recovery /dev/block/platform/13d60000.ufs/by-name/recovery

    adb push *:\Magisk\Patched\vbmeta /dev/block/platform/13d60000.ufs/by-name/vbmeta

  • now, very important, delete the old Magisk configuration by removing the /data/adb directory, from within twrp terminal: rm -r /data/adb

  • wipe the cache partition from the twrp gui (advanced wipe)

  • boot back into Android and start the Magisk Manager app, it will tell you it needs to do some additional configuration and reboot your device... (if this step gives an error you did not succesfully delete the /data/adb folder)

  • once your device is rebooted, you'll have your root back!

  • have a good bottle of wine and reconfigure your Magisk settings/modules in Magisk Manager.

  • enjoy to be the owner of your own device again!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .