Install TWRP via official app after you have root with magisk?

Search This thread

veso266

Member
Feb 27, 2019
33
7
Hello there, back in the day (2019 in March or April the phone shipped with Android 9) I rooted my galaxy S10+ Exynos with Magisk and stock recovery (because TWRP method did not exist yet or did but non twrp method looked safer, I forgot the reason)


Then I forgot about TWRP and even upgraded to Android 10 like this:
(standard procedure, download android with Friya, then patch ap file with magisk, then flash it with odin)


Well I used my phone as always, forgot about twrp, but always had a little voice in my head telling me, that twrp is good idea, what if something happens, I would at least be able to copy my data)


So I decided to flash twrp, to ease my mind a bit, and also be able to copy apps to /system/priv-app

So I am using Android 10 (see no reason to upgrade, what I need is there I prefer OneUI 2.0 over later versions and I dont want to make my device slower or loose some obscure api function that I dont even know exists until I need it)


Now, can I just use official twrp app and let it do its thing (I have root), or do I need to download twrp with the app, but prepatch it with magisk before I install it? (I read conflicting info, on xda they say you need to prepatch it, while on twrp guide: https://twrp.me/samsung/samsunggalaxys10plus.html

They say to just use the app if you already have root, so I am confused now

It seams using the app is the easiest and most safe method


Thanks for Anwsering and Best Regards
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
4,223
6
2,883
gitlab.com
only in case recovery and boot share the same partition, you will lose magisk after flashing TWRP (does not apply)
 

veso266

Member
Feb 27, 2019
33
7
only in case recovery and boot share the same partition, you will lose magisk after flashing TWRP (does not apply)
well, I gues this did apply to me, because I tried to flash TWRP with the app (latest version: twrp-3.7.0_9-2 that the app offered, it offered 2 files .img or .img.tar, and I chose to flash .img), and now my phone cannot boot, its stuck in download mode it says with red letters

kernel: Could not do normal boot, (DT LOAD failed)

I don't know know what happened, I only flashed recovery, and bootloader is unlocked

adb doesn't work
I cannot even get to recovery

So what now? Can at least flash TWRP somehow back so I can get ot my files (I have most of my videos on an SD card, but 2 or 3 are on internal storage :( )

I would reflash Android 10 anyway if it wasn't for the files :)
 
Last edited:

alecxs

Forum Moderator
Staff member
Feb 17, 2016
4,223
6
2,883
gitlab.com
you can flash recovery.img as tar file but that is useless for backup stock ROM userdata. if you still have the magisk_patched.tar you can flash it to get your data back. don't flash unpatched stock boot.img this will most likely result in data loss.

I would first try older TWRP as DT LOAD failed (device tree) looks like TWRP problem to me.
 
Last edited:

veso266

Member
Feb 27, 2019
33
7
you can flash recovery.img as tar file but that is useless for backup stock ROM userdata. if you still have the magisk_patched.tar you can flash it to get your data back. don't flash unpatched stock boot.img this will most likely result in data loss.
OK

after installing TWRMP

3.4.0 I got into recovery​


I guess the latest version twrp-3.7.0_9-2 is broken (because I tried flashing from Odin and I got the same error

but 3.4.0 works now

Well then I got into a non rooted android state (I couldnt boot into the rooted one because if I held volume up I just got into TWRMP)

I do have my magisk patched AP file (I did keep that), so I tried flashing it by odin to get into rooted state again, but then got scared because I was aftaid it would delete my data, so pulled the plug out, immediately after I discovered its flashing system.img (it just started)

thats where I interupted it
<ID:0/035> SingleDownload.
<ID:0/035> dt.img
<ID:0/035> dtbo.img
<ID:0/035> system.img
<ID:0/035> __XmitData_Write
<ID:0/035> Complete(Write) operation failed.
<OSM> All threads completed. (succeed 0 / failed 1)

So then phone would not boot, not in TWRMP not in android anymore, so I flashed TWRMP again and now at least

I am in TWRMP (I can see my files, but they are encrypted (they have wierd names but size does seam to match my files)

So how do I reflash android now, without messing with /data partition?
or can I somehow backup just data partition, reflash android and flash /data back?
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
4,223
6
2,883
gitlab.com
let the magisk_patched.tar flash, just make sure you don't flash CSC (HOME_CSC is fine it won't erase userdata)
 

veso266

Member
Feb 27, 2019
33
7
let the magisk_patched.tar flash, just make sure you don't flash CSC (HOME_CSC is fine it won't erase userdata)
Yey, that did it (that was scarry), now root works, as well as android 10 (for some reason Magisk Manager does not open (but all the magisk modules work)

Now, I did patch this ap file back in the day I updated android to 10 so
I used Magisk Manager 7.4.1.291c718b

and if I remember corecly (thanks got I recorded everything) I patched the AP file for Magisk 20.2-11b7076a)

Now I have Magisk Manager 8.0.7 installed

So after I downgraded my Magisk manager to 7.5.0 it opened

Now I just have to figure out how to install Magisk v21.4 which is the version that belongs to my Magisk Manager 8.0.7, because Magisk Manager won't let me install a custom magisk, it only wants to download the latest version
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
4,223
6
2,883
gitlab.com
you can install latest Magisk apk and patch stock boot.img again. Anyway I would do a backup with Migrate and adb pull -a /sdcard first.

or you can paste this url as custom channel and install older magisk if you want to.
https://raw.githubusercontent.com/topjohnwu/magisk_files/b0694fad86/stable.json
 

veso266

Member
Feb 27, 2019
33
7
you can install latest Magisk apk and patch stock boot.img again. Anyway I would do a backup with Migrate and adb pull -a /sdcard first.
aha, I see

is there any other way besides patching my AP file again? (I mean Magisk can clearly update itself somehow)

I mean, Magisk Manager does open (but only version 7.5.0, not version 8.0.7), and I have root its just that I don't have Magisk Manager 8.0.7

So how do I install a specific Magisk version from Manager? (I did try to install like a Magisk module, but now I am stuck in download mode again, so lets install Android 10 again :) )
 

veso266

Member
Feb 27, 2019
33
7
OK, after I installed Android again (with my older prepatched magisk)

Not sure what happened but now Magisk Manager 8.0.7 opens and says I have 20.2-11b7076a installed

of course as this combo should not exist, magisk Manager cannot see any modules (modules are there in /data/adb/modules and they do work, its just that Magisk Manager cannot see them installed, which means you can not easly delete them and you could install them over and over again, since Manager would not know that they are there)

So now I need to find a way to update to Magisk 21.4

So how would I do that (I tried the module install method before (I downloaded 21.4 from official github release pages) , but that just got me stuck into download mode again, so any other way, is there a patcher for computer maybe?

I mean I can only install the latest version, even if I disable internet, I cannot select a specific version
 

veso266

Member
Feb 27, 2019
33
7
Thanks, after spending 3hours to get into magisk I decided to share my procedure (because I forget it a lot)

FIrst: make sure your phones last state was power off (you can eather power off from red button or from recovery)

Then turn phone on and start holding power button + bixby + volume up, and count to 10 then release (not 11, 10, if you count to 11 you will get to recovery)

To try out if you are in magisk mode (without ruining your saved wifi passwords), you can plug the phone into the charger, if it turn on normaly, you are in magisk, if it shows battery charging, then you are not in magisk mode)

OK, I tried updating Magisk with https://raw.githubusercontent.com/topjohnwu/magisk_files/b0694fad86/stable.json

but for some wierd reason, it doesn't want to update, its stuck on 20.2-1


OK,. I tried installing Magisk Manager v7.4.1 and when launching it, it said that it patched dtbo.img and it needs reboot, so after I reboot, I am stuck on download mode again :(

It sayd: DT table header check fail

well, lets install Android 10 a third time :)
 
Last edited:

veso266

Member
Feb 27, 2019
33
7
wait, you're booting into recovery to get into Magisk? you can use Nemesis kernel to skip this.
https://forum.xda-developers.com/posts/81316371
Yes I am, but its allright, I am used to this

one day I will have to compile my own kernel anyway (to add some drivers to the phone)

Now I have to figure out why Magisk 21.4 won't install

I tried patching my AP file with it, but no matter what I do, I cannot get into it for some reason? (even my trust and tried method does not get me into it, while it got me into 20 all the time)

Is this version broken?

Whats the latest magisk version that still supports Magisk Hide (usefull thing that always worked for me)
 

alecxs

Forum Moderator
Staff member
Feb 17, 2016
4,223
6
2,883
gitlab.com
With Nemesis kernel no need for button dance, it boots straight into Magisk. Magisk Hide exist up to v23 but there is also unofficial Magisk v25
 

veso266

Member
Feb 27, 2019
33
7
Magisk needs the ramdisk of the recovery/TWRP to patch it. If flashing a non-prepatched image you will lose root.
Yea, I discovered that already :)

Now I am trying to get it back and failing :(

UPDATE: after installing Magisk 23 (last version that has Magisk Hide), prepatching AP file, and flashing it like 10th time, I finaly have root :) :)

Do I dare to try TWRP again? (I guess I need to prepatch it with Magisk before I install it with odin? (but which file do I install there are 2 files provided (twrp-3.4.0-2-beyond2lte.img.tar or twrp-3.4.0-2-beyond2lte.img)?
 
Last edited: