[Magisk] Root for the Galaxy S10 Series

Search This thread

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
by the way, with my method, there is no need to connect to the computer to boot with root. Just go to phone settings and choose factory reset. it says the phone will be reset, but because I rooted the recovery mode, it opens with root :)
Since you are the one with the guts to click "factory reset" to see if it really will:
Is the phone not reset because you "rooted the recovery mode", or because you installed TWRP and TWRP does not honor the signal from Android settings?
 
Since you are the one with the guts to click "factory reset" to see if it really will:
Is the phone not reset because you "rooted the recovery mode", or because you installed TWRP and TWRP does not honor the signal from Android settings?
all i did was patch the twrp with magisk. that is, the first method for me to open with root normally: I have to press volume + / bixby / power keys until I see the bootloader open warning while connected to the computer. To reach twrp, I do the same process (volume+/bixby/power) until twrp is turned on.

The second method is: When it comes to the factory reset process, it starts again when you press that key and since there is no stock recovery, the reset command only forces the recovery mode and because there is root in the recovery partition, the rooted system is booted directly.

EDİT: actually I didn't try before patching it with root so I don't know the answer to your other question. If it comes to my mind before re-rooting the phone, I'll try that too.
 
  • Like
Reactions: J.Michael
Last edited:
D

Deleted member 4398224

Guest
Is there an order for the flashing of the images/ZIP ? for the vbmeta.**tar** (which I can't flash) is the idea just to extract the .img and flash it ? Or do you use Odin ?
TWRP.img I patched with Magisk. Version of Magisk is 25.1. After I patched .img with Magisk, I copy it on PC with ADB. After copy on PC, I convert patched .img to .tar and it install with ODIN.

First of all, transfer the patched TWRP image (magisk_patched.img) file from your phone’s storage to the PC.
Open the folder where the file was transferred.
Hold the SHIFT key on the keyboard and right-click on any empty space inside the folder.
Then select the ‘Open PowerShell window here’ option.
Now, enter the following command to rename the ‘magisk_patched.img’ to ‘recovery.img’:

mv magisk_patched.img recovery.img

Instead of magisk_patched.img, type the name you got when you patched the .img with Magisk and then Enter.

For me it looks like this:

Next command for Galaxy S10 is: tar cf twrp-beyond1lte.img.tar recovery.img

Now you can install TWRP with ODIN.

I installed TWRP.tar and vbmet.tar with ODIN.
 

Attachments

  • 2022-07-02 18_57_40-Install TWRP on Samsung Galaxy S10_S10+_S10e (Exynos).png
    2022-07-02 18_57_40-Install TWRP on Samsung Galaxy S10_S10+_S10e (Exynos).png
    31.4 KB · Views: 130
  • 2022-06-29 13_13_51-Windows PowerShell.png
    2022-06-29 13_13_51-Windows PowerShell.png
    9.2 KB · Views: 128
  • 2022-06-29 13_37_41-C__Users_zdrav_Documents_Rainmeter_Skins_GeoSans_Rainmeter_Skin_GeoSans Wh...png
    2022-06-29 13_37_41-C__Users_zdrav_Documents_Rainmeter_Skins_GeoSans_Rainmeter_Skin_GeoSans Wh...png
    73.9 KB · Views: 127
Last edited by a moderator:

Charles_LV

Member
Jul 20, 2009
31
2
Yesterday I rooted my S10 with instructions from Magisk:
  • Use either samfirm.js, Frija, or Samloader to download the latest firmware zip of your device directly from Samsung servers.
  • Unzip the firmware and copy the AP tar file to your device. It is normally named as AP_[device_model_sw_ver].tar.md5
  • Press the Install button in the Magisk card
  • If your device does NOT have boot ramdisk, check the “Recovery Mode” option
  • Choose “Select and Patch a File” in method, and select the AP tar file
  • Start the installation, and copy the patched tar file to your PC using ADB:
    adb pull /sdcard/Download/magisk_patched_[random_strings].tar
    DO NOT USE MTP as it is known to corrupt large files.
  • Reboot to download mode. Open Odin on your PC, and flash magisk_patched.tar as AP, together with BL, CP, and CSC (NOT HOME_CSC because we want to wipe data) from the original firmware.
  • Your device should reboot automatically once Odin finished flashing. Agree to do a factory reset if asked.
  • If your device does NOT have boot ramdisk, reboot to recovery now to enable Magisk (reason stated in Magisk in Recovery).
  • Install the Magisk app you’ve already downloaded and launch the app. It should show a dialog asking for additional setup.
  • Let the app do its job and automatically reboot the device. Voila!
Everything was working great until I got a huge message "Please activate KNOX licence" or something similar. Which I did, because that thing did not go away. Afterwards the root is gone.

Any idea how to avoid that?
 
Last edited:

casoaoshzo

Member
Mar 23, 2022
12
2
Hey folks!

I've just installed my first ever Custom ROM to a phone (S10+ Exynos) - Lineage 19.1 from here - and super stoked that I actually managed that without problems. :D Now I'm wanting to add Magisk, and feeling a bit confused by the installation instructions provided.

Specifically, my main question is whether I should follow the general section or the Samsung section , i.e. is that Samsung section hardware specific (so that I should use it) or software specific for phones running the Stock OneUI (so that I should not use it)?

What's causing me additional confusion is that when I was searching this thread and XDA overall for similar questions, among other things I found suggestions to install via recovery (e.g. here) which seems to be working for some people, yet also seems actively discouraged in the installation guide itself.

Would appreciate any pointers as to what the best practice would be, and apologies if that's a silly question and/or has been answered before - tried my best at searching this thread but couldn't locate an answer.

Cheers! :giggle:
 

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
Hey folks!

I've just installed my first ever Custom ROM to a phone (S10+ Exynos) - Lineage 19.1 from here - and super stoked that I actually managed that without problems. :D Now I'm wanting to add Magisk, and feeling a bit confused by the installation instructions provided.

Specifically, my main question is whether I should follow the general section or the Samsung section , i.e. is that Samsung section hardware specific (so that I should use it) or software specific for phones running the Stock OneUI (so that I should not use it)?

What's causing me additional confusion is that when I was searching this thread and XDA overall for similar questions, among other things I found suggestions to install via recovery (e.g. here) which seems to be working for some people, yet also seems actively discouraged in the installation guide itself.

Would appreciate any pointers as to what the best practice would be, and apologies if that's a silly question and/or has been answered before - tried my best at searching this thread but couldn't locate an answer.

Cheers! :giggle:
You still need to follow Samsung instructions, at least as far as using Odin -- you still won't have fastboot.

Whether to install in boot or recovery always depended on whether the bootloader and kernel would support an initrd in the boot image. That note on Magisk manager app front page "Ramdisk: yes/no" tells you whether the original boot image included a ramdisk. If there was a ramdisk, Magisk can patch it. If there was not, Magisk will add one, but it is not certain that it will be used.

It is possible that the stock boot image did not support a ramdisk, while the LineageOS boot image does.

I don't think patching recovery was actively discouraged, it just wasn't the first approach, and there is no reason to use it unless you have to.

Is LOS distributed as .tar files, suitable for Odin? If you hand AP.tar to Magisk, it will patch what it wants to. Why not try that?

Just don't waste time setting up the tablet every time it boots -- you will be wiping it a lot.
 
  • Like
Reactions: casoaoshzo

casoaoshzo

Member
Mar 23, 2022
12
2
Thank you J.Michael for the detailed response! Definitely helps my understanding along quite a bit.

You still need to follow Samsung instructions, at least as far as using Odin -- you still won't have fastboot.

Oh of course, that makes sense - I skimmed the instructions for the non-Samsung section and missed the reference to fastboot. 😅

Whether to install in boot or recovery always depended on whether the bootloader and kernel would support an initrd in the boot image. That note on Magisk manager app front page "Ramdisk: yes/no" tells you whether the original boot image included a ramdisk. If there was a ramdisk, Magisk can patch it. If there was not, Magisk will add one, but it is not certain that it will be used.

It is possible that the stock boot image did not support a ramdisk, while the LineageOS boot image does.

That indeed does appear to be the case, I have downloaded the Magisk .apk and checked, I am seeing "Ramdisk: yes" for Lineage. (And believe from a tutorial I saw running through the installation on a stock S10+ that it's a "no" for that.)

That was certainly one of the sources for my confusion, had assumed Ramdisk is a hardware property, but turns out that I assumed wrongly.

I don't think patching recovery was actively discouraged, it just wasn't the first approach, and there is no reason to use it unless you have to.

Yes maybe I was exaggerating by that choice of words. :D It does say 'deprecated' on the installation guide. In any case I'm probably feeling better following the image patching approach.

Is LOS distributed as .tar files, suitable for Odin? If you hand AP.tar to Magisk, it will patch what it wants to. Why not try that?

So I downloaded LOS from here and it's provided as a .zip file with a recovery image as an .img file. My understanding is that is can be made suitable for installing with Odin by simply renaming the recovery image to recovery.img and packing it into a tar archive (many people in the relevant thread for the ROM and more so the previous version report so, and the maintainer specifically says so), however I used Heimdall (following these instructions).

The main reason I got confused which path to follow was that the Samsung section specifically talks about using Frija or similar to donwload a Samsung firmware and I assumed some of the following steps are specific to it - namely, looking into that Lineage .zip archive there don't appear to be AP, BL, CP, CSC files inside it, so I'm not sure how exactly that would work with Odin – will need to read up on that, but it's definitely a thing people successfully do - so I'll attempt to educate myself and try that. :giggle:

(I think a similar question was asked earlier in this thread but don't think that was answered.)

Just don't waste time setting up the tablet every time it boots -- you will be wiping it a lot.

I'm not sure I follow this last sentence - what do you mean by the 'tablet'?
 

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
Thank you J.Michael for the detailed response! Definitely helps my understanding along quite a bit.



Oh of course, that makes sense - I skimmed the instructions for the non-Samsung section and missed the reference to fastboot. 😅



That indeed does appear to be the case, I have downloaded the Magisk .apk and checked, I am seeing "Ramdisk: yes" for Lineage. (And believe from a tutorial I saw running through the installation on a stock S10+ that it's a "no" for that.)

That was certainly one of the sources for my confusion, had assumed Ramdisk is a hardware property, but turns out that I assumed wrongly.



Yes maybe I was exaggerating by that choice of words. :D It does say 'deprecated' on the installation guide. In any case I'm probably feeling better following the image patching approach.



So I downloaded LOS from here and it's provided as a .zip file with a recovery image as an .img file. My understanding is that is can be made suitable for installing with Odin by simply renaming the recovery image to recovery.img and packing it into a tar archive (many people in the relevant thread for the ROM and more so the previous version report so, and the maintainer specifically says so), however I used Heimdall (following these instructions).

The main reason I got confused which path to follow was that the Samsung section specifically talks about using Frija or similar to donwload a Samsung firmware and I assumed some of the following steps are specific to it - namely, looking into that Lineage .zip archive there don't appear to be AP, BL, CP, CSC files inside it, so I'm not sure how exactly that would work with Odin – will need to read up on that, but it's definitely a thing people successfully do - so I'll attempt to educate myself and try that. :giggle:

(I think a similar question was asked earlier in this thread but don't think that was answered.)



I'm not sure I follow this last sentence - what do you mean by the 'tablet'?
Maybe I should have asked if you used Odin. Odin is the Windows program to download to a device. The device is supposed to be in "download mode". This is the "flashing" step.

Odin expects four tar files. John Wu's instructions emphasize the importance of always providing four files to Odin. They also emphasize the importance of not having too little in the AP.tar file. I think at some point he says if you want to make a smaller AP file, at least have boot, recovery, and vbmeta in it. Other posts I've read describe people successfully ignoring this advice. I don't know if the problems only occur on certain hardware, or if the problems used to occur but the real reason for the problem has since been corrected. I did this once, with a new tablet, got it to work, and will not be experimenting with that tablet ever again.

I said tablet because I have a tablet and I get tired of typing "device" to avoid offending people with phones.

If you were able to install LineageOS following instructions and using Heimdall, then just stick with what works. When I was doing this, Magisk manager app had an option checkbox "patch Recovery". I think I found that it did not matter when I handed the manager a tar file to patch. I do not know if that checkbox is still available. As I understand it, the manager displays only those options it thinks relevant. It will cost you nothing to perform the patching step -- you can always choose to delete the patched file.

Shirley somebody in a LineageOS oriented thread mentions which piece they patch, but if you say Magisk manager app now says "Ramdisk: Yes", I say patch the boot image. And don't change any names. Or be careful. I think I remember Heimdall having much more explicit specification of what goes where, so do not change the part that says "flash this to the recovery partition", but you are probably free to change the actual file being flashed; then again, why bother. Stick with what worked the first time you installed LineageOS, just use a patched boot image.

And read those instructions another four times. They have to read in a spiral to get the steps in the right order. And the special instructions for Samsung, like "don't let it boot after Odin finishes, but instead force it to boot to recovery so you can wipe the data", may still apply. Again, Lineage-focused threads probably have more reliable advice.
 
  • Like
Reactions: casoaoshzo

casoaoshzo

Member
Mar 23, 2022
12
2
Maybe I should have asked if you used Odin. Odin is the Windows program to download to a device. The device is supposed to be in "download mode". This is the "flashing" step.

No worries, I should have been more specific! Yep I'm slowly getting the hang of what I'm actually doing - Heimdall respectively Odin taking the role fastboot would have on a non-Samsung device here and those two Samsung tools (theoretically?) being able to do the same things. I'm a sticker to instructions I'm given, so I'm happy to familiarise myself with Odin if the instructions say Odin. ;)

Odin expects four tar files. John Wu's instructions emphasize the importance of always providing four files to Odin. They also emphasize the importance of not having too little in the AP.tar file. I think at some point he says if you want to make a smaller AP file, at least have boot, recovery, and vbmeta in it. Other posts I've read describe people successfully ignoring this advice. I don't know if the problems only occur on certain hardware, or if the problems used to occur but the real reason for the problem has since been corrected. I did this once, with a new tablet, got it to work, and will not be experimenting with that tablet ever again.

Yes, the importance of always providing four files was one of the stumbling blocks for me - the instructions that describe flashing Lineage recovery with Odin all only ever speak of using the provided .img file (zipped into a .tar archive) in the AP slot and leaving the other 3 slots free. Seems like a potentially dangerous thing to do here.. I'm starting to understand that it matters more to ask advice specific to ROM than specific to device, so I'll seek help in the relevant forum!

I said tablet because I have a tablet and I get tired of typing "device" to avoid offending people with phones.

Of course! I apologise, that was me being stupid, didn't think of tablet as a device type. :ROFLMAO: Thought that's some kind of software I am not familiar with.

If you were able to install LineageOS following instructions and using Heimdall, then just stick with what works. When I was doing this, Magisk manager app had an option checkbox "patch Recovery". I think I found that it did not matter when I handed the manager a tar file to patch. I do not know if that checkbox is still available. As I understand it, the manager displays only those options it thinks relevant. It will cost you nothing to perform the patching step -- you can always choose to delete the patched file.

Very good advice. :) I'll try the patching step to get a feel for it in any case and do some more reading up on what to do with the patched file (or discard otherwise). The only reason I really want to root is so I can get AFWall+ installed, but if the whole endeavour becomes to complex for me I may go with NetGuard for now while deciding whether to proceed reading up on stuff.

Shirley somebody in a LineageOS oriented thread mentions which piece they patch, but if you say Magisk manager app now says "Ramdisk: Yes", I say patch the boot image. And don't change any names. Or be careful. I think I remember Heimdall having much more explicit specification of what goes where, so do not change the part that says "flash this to the recovery partition", but you are probably free to change the actual file being flashed; then again, why bother. Stick with what worked the first time you installed LineageOS, just use a patched boot image.

Thanks for that, yeah I'm gonna go into the relevant LineageOS thread and see what people there know about it!

And read those instructions another four times. They have to read in a spiral to get the steps in the right order. And the special instructions for Samsung, like "don't let it boot after Odin finishes, but instead force it to boot to recovery so you can wipe the data", may still apply. Again, Lineage-focused threads probably have more reliable advice.

Not to worry, if there's one thing I do it's following instructions to the letter. ;) Took me three reads through the Lineage setup instructions plus a couple of YouTube videos before I dared that.

Thanks again J.Michael, that was tremendeously helpful!
 

casoaoshzo

Member
Mar 23, 2022
12
2
@J.Michael that sounds neat indeed. Not equivalent then, but the best replacement for fastboot we have I guess. :LOL: I've posted in the relevant forum for my ROM (here if anybody comes here in the future with the same question). Cheers again!
 
  • Like
Reactions: J.Michael

Shumafuk

Senior Member
Nov 6, 2013
106
10
I want IodéOS 3.1 on S10e with TWRP, root (Magisk) and encryption.

I was used to flash Magisk as zip file after flashing ROM, but it is not recommended now. So... I'm quite lost.

So I need...
  • Install Magisk apk
  • Pre-root TWRP in Magisk
  • Renaming modified img to tar via adb
  • Flash modified TWRP in Odin with avb disabled vbmeta .tar
  • Boot to TWRP and format data
  • Flash multidisabler-samsung-3.* zip
  • Flash custom ROM
  • Install Magisk apk again in fresh custom ROM (not flashing in TWRP)

... and that's it, system will be rooted? I'm not sure about last two steps. Also... Upgrading. For new Magisk version I need to repeat whole process? For upgrading OS with root I need to reinstall Magisk? I'm confused.
 
Last edited:

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
I want IodéOS 3.1 on S10e with TWRP, root (Magisk) and encryption.

I was used to flash Magisk as zip file after flashing ROM, but it is not recommended now. So... I'm quite lost.

So I need...
  • Install Magisk apk
  • Pre-root TWRP in Magisk
  • Renaming modified img to tar via adb
  • Flash modified TWRP in Odin with avb disabled vbmeta .tar
  • Boot to TWRP and format data
  • Flash multidisabler-samsung-3.* zip
  • Flash custom ROM
  • Install Magisk apk again in fresh custom ROM (not flashing in TWRP)

... and that's it, system will be rooted? I'm not sure about last two steps. Also... Upgrading. For new Magisk version I need to repeat whole process? For upgrading OS with root I need to reinstall Magisk? I'm confused.
Read the last few pages. @ZmisiS described his procedure in detail.

Do not rename .img to .tar. tar is an archive format, and the name of the program that manipulates that archive.

You probably have a tar in your Android. From a command prompt (terminal window) in Android, Linux, UNIX, even Windows if you downloaded a Windows-version
Code:
tar cvf new-tar-file.tar recovery.img
If "Pre-root TWRP in Magisk" means "use Magisk manager app to patch TWRP.img", then yes, but.

I am still waiting for someone to tell me how TWRP is "delivered" for this device.

If you started with a tar file, just tell Magisk to patch the tar file. Then tell Odin to use the patched tar file.

And yes, upgrading OS may mean doing the whole, miserable, process again.

Does "IodéOS" mean "LineageOS"?
 

Shumafuk

Senior Member
Nov 6, 2013
106
10
Do not rename .img to .tar. tar is an archive format, and the name of the program that manipulates that archive.

You probably have a tar in your Android. From a command prompt (terminal window) in Android, Linux, UNIX, even Windows if you downloaded a Windows-version
Code:
tar cvf new-tar-file.tar recovery.img
If "Pre-root TWRP in Magisk" means "use Magisk manager app to patch TWRP.img", then yes, but.

I am still waiting for someone to tell me how TWRP is "delivered" for this device.

If you started with a tar file, just tell Magisk to patch the tar file. Then tell Odin to use the patched tar file.
But Magisk wont accept tar files. It fails with finding recovery.img. Only img works.

And yes, upgrading OS may mean doing the whole, miserable, process again.
Why, after years of development, we make basic things as rooting devices more and more difficult?

Does "IodéOS" mean "LineageOS"?
Yes, basically there is no difference except few features, that saves me quite a lot of time (MicroG, F-Droid repos, Aurora Store, built in adblocker).
 

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
But Magisk wont accept tar files. It fails with finding recovery.img. Only img works.


Why, after years of development, we make basic things as rooting devices more and more difficult?


Yes, basically there is no difference except few features, that saves me quite a lot of time (MicroG, F-Droid repos, Aurora Store, built in adblocker).
Magisk *does* accept a tar file.
If you are saying Magisk said "unable to find recovery.img", that means the file in the tar file was not named "recovery.img".

Did you get TWRP originally in a tar file? How many files are in the tar file? What are their names?
Code:
tar tvf tar-file
will list the contents of a tar archive.

Have you read @ZmisiS's posts? If what he said differs from what I advised, follow his instructions. He has actually done this.
 

Shumafuk

Senior Member
Nov 6, 2013
106
10
Do I need to patch by Magisk any files from custom ROM pack to have root before flash it?

If I understand correctly, root is done by patched recovery, not by boot, right? So no need to patching any ROM files?

Magisk *does* accept a tar file.
If you are saying Magisk said "unable to find recovery.img", that means the file in the tar file was not named "recovery.img".

Did you get TWRP originally in a tar file? How many files are in the tar file? What are their names?
Code:
tar tvf tar-file
will list the contents of a tar archive.

Have you read @ZmisiS's posts? If what he said differs from what I advised, follow his instructions. He has actually done this.
I understand that part of patching, I'm just not sure about the last two points that I wrote in my list.

I have TWRP in tar and img. tar version have recovery.img in it. Btw, what is problem with renaming img to tar? According to this guide it should work.
 
Last edited:

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
Do I need to patch by Magisk any files from custom ROM pack to have root before flash it?

If I understand correctly, root is done by patched recovery, not by boot, right? So no need to patching any ROM files?


I understand that part of patching, I'm just not sure about the last two points that I wrote in my list.

I have TWRP in tar and img. tar version have recovery.img in it. Btw, what is problem with renaming img to tar? According to this guide it should work.
I am not even going to look at that guide. You cannot change a file into an archive containing the original file by just renaming the file. You have to run a program that creates an archive, and tell it what files you want in the archive.

Have you read John Wu's installation instructions? In the section for Samsung, he advises that if you want to work with a smaller tar file than the GB AP file distributed by Samsung, that, at the very least, yoj always have boot, recovery, and vbmeta in the tar file. While Magisk is injected into the recovery, there is some patching of boot and vbmeta. It may not be code injection, it may just be modifying some signatures, but it is still necessary. Or it was at some point.

You should always start from a working system that does not have Magisk. If that working system is a custom ROM, then whenever someone says "pull this piece from the stock ROM", for you it means "from the custom ROM".

I do not know if you need to install Magisk in recovery if you are using LineageOS. Can you find anyone who is using your ROM on your device with Magisk?

If your ROM cannot be installed with Odin, but rather you need to install TWRP and then use TWRP to install the custom ROM, maybe you should never use Odin. Except to reinstall the stock ROM.
 

knojap

Senior Member
Apr 18, 2011
605
69
So is why this answer, I know what I'm doing I'm rooted like you did without TRWP , just magisk and modified AP flashed with odin then once rooted flashed up-param with odi demarage rooted with no message

There is no way to do with ramdisk, I know some people don't have ramdisk like this S10 exynos yet lineage when I installed I had ramdisk yes in magisk.
Where did you put param.tar in Odin? AP?
 

J.Michael

Recognized Contributor
Jan 20, 2018
2,467
2,977
Samsung Galaxy Tab A series
Where did you put param.tar in Odin? AP?
It probably doesn't matter. I think Odin just downloads all the files of all the .tar files. Odin having four slots, each named after a file provided by Samsung, is probably just a convenience -- it helps you to keep track of what you're doing, and reminds you that Samsung ROMs usually come in four parts.

If you're feeling adventurous, give Odin both tar files (TWRP and up-param) and see what happens.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    I follow my previous post of Sept,21, 2023

    In these last months all is now running well with Wallet (Google Pay) working
    Actual environment:
    HWC1 Stock security patch 1March23 (last fw), root with magisk 26.1, Twrp 3.7.0_9.2
    Only Magisk Module PlayIntegrityfix 15.9.4 coming from
    https://xdaforums.com/t/module-play-integrity-fix-safetynet-fix.4607985/

    SafetyNetFix and MagiskHidePropsConfig are NO MORE necessary.
    I cannot remember if I flashed Multidisabler to retain bluetooth.

    Reset cache memory of ALL the following apps
    Google PlayStore
    Google Play Services
    Google Wallet
    Magisk

    REBOOT!

    Zygisk and DenyList enabled, insert in denylist:
    Google PlayStore
    Google Wallet
    optionally Google Play Services

    Magisk left visible (= not hidden)

    Results:
    In Play Store, settings, Play Protect Certification: device is certified
    SafetyNet Check app: all green
    RootBeerSample app : Only 4/12 are RED: SU binary, 2nd SU binary check, root via native check, Magisk specific checks
  • 249
    Here comes official Magisk support for the Galaxy S10!
    Let's get Magisk to kick start the development of these Samsung devices!

    Link to Instructions
    Carefully read through everything in the page linked above! Follow the instructions closely so you don't end up bricking your device

    Technical Details
    Google enforces all devices that ships with Android 9.0 to use system-as-root in part of "Project Treble", so Samsung finally introduced their own "flavor" of the implementation. More details regarding system-as-root can be found in the official Google dev site. Samsung is using the A-only system-as-root setup, meaning that its boot image will only contain the kernel binary without ramdisk included. Similar setup has already been deployed on many new devices, and the solutions for those devices are rather simple: add a new ramdisk section into the boot image and hexpatch the kernel to always use ramdisk as rootfs. However in Samsung's case, the bootloader simply does not load anything other than the kernel binary to the memory, meaning no matter what we do the kernel will always use the system partition as root directory. This leaves us no option but to install Magisk onto the recovery partition.

    Installing to the recovery partition have its own issues: first is that a service called "flash_recovery" will run when the system starts up, which will restore the recovery image back to stock on startup. This is unacceptable because not only does it uninstall Magisk in the process, the data encryption key will also be changed due to fact that Samsung's data encryption keys are tied to the bootloader status and boot/recovery image signatures, and thus causing the device unable to boot in following reboots unless factory reset. The solution to this problem is to simply repack the boot image to remove the binary integrity and also the signature of the partition. The second issue is that since Magisk and recovery shares the same partition, how can we actually boot into recovery? (e.g. to factory reset your device, or have custom recovery co-exist with Magisk) Fortunately a solution that detects button key presses is introduced, which details are already provided in instructions.

    To make matters even worse, Samsung introduced a "VaultKeeper" service, which adds another "lock" on top of the OEM lock of the bootloader. By default the service will "relock" the bootloader after data is wiped. Only after the initial setup will it verify the OEM lock option and changes the bootloader state accordingly. If you are running custom firmware with stock system, DO NOT try to wipe data or else you might end up bricking your device due to vaultkeeper locking your bootloader up, which will eventually lead to bootloader refusing to boot because unofficial partitions are detected.

    For custom ROM developers, the first few things you would want to remove is VaultKeeper to protect your users from bricking their devices. For stock ROM users, just make sure to always boot to Magisk after a data wipe, or never power off your device before finishing the initial setup and verify OEM lock is enabled.
    22
    OK guys, @PillowCake[/MENTI[SIZE="3"][/SIZE]ON] [MENTION=5902940]bininga59 @Norup58
    In the interests of accuracy for everyone, afterall this what XDA is all about isn't it, I am scrubbing previous post and re-worded a new one.

    ---------- Post added at 06:24 PM ---------- Previous post was at 06:14 PM ----------

    Firmware updates and keeping your data,
    for phones Magisk rooted without TWRP.

    Just download new firmware, copy the AP file of the new firmware to your phone.
    Open Magisk Manager, ensure Magisk is up to date, if not, update it.
    When Magisk is up to date, if you have any Magisk Modules running, go into Modules and disable them (no need to uninstall them). Then reboot and go back into Magisk Manager.
    Hit the top INSTALL, select INSTALL again then select 'Select and Patch a File'
    Locate the new AP file from your new firmware and patch it. Then copy the magisk_patched.tar back to your computer, preferably with ADB to minimize corruption during transfer.
    Power off phone and reboot to Download mode.
    Open Odin 3.13.1 on your computer, and
    deselect Reboot under Options tab. Now use the new magisk_patched file in the AP slot, the BL and CP from your new firmware into their respective slots and importantly HOME_CSC into the CSC slot. Press start and let Odin do it's stuff.

    When flashed, do not wipe. Press and hold Vol-down and Power, when screen goes off, quickly change to Vol-up, Bixby button and Power. As soon as screen appears, let go of all buttons.
    Within moments without any further user intervention your phone will reboot into your updated Magisk rooted mode, data intact.
    Just re-enable your previously disabled Magisk modules.
    16
    Hi guys!!
    Got a S10, rooted with magisk, no TWRP installed.
    I want to update to the latest Firmware with magisk, but without wipe everything , is it possible?
    What are the steps please?

    Galaxy S10 Firmware update.
    The Galaxy S10 May firmware update has started to appear and users will be wanting to update their firmware without losing their data and keep their Magisk root.

    For phones with Magisk root only without TWRP.
    The process is similar to when you first rooted your phone but you need all the firmware files and DO NOT wipe.
    Download your new firmwware using Frija or Samfirm, making absolutely sure it is the correct version for your phone model and region (csc), you can use an app such as 'Phone INFO' to help here.
    Unzip the downloaded file to an easy place to find on your computer.
    From this unzipped folder locate the file name beginning AP and copy this file to your phone.
    On your phone open Magisk Manager and hit INSTALL against Magisk, prompt will come up, hit INSTALL, Select Method - Select and Patch a File, then choose the AP file you have just copied to your phone. Let Magisk process complete.
    Copy the new magisk_patched file on your phone back to your computer, preferably the same folder you copied the AP from.
    Open Odin (use Odin3_v3.13.1) On Odin Option tab untick Auto Reboot.
    Power off your phone and connect it to your computer. Press and hold volume-down until Download screen appears then volume-up to continue. On Odin the box below ID:COM should turn blue.
    For the AP option select the magisk_patched file, then select the BL file and the CP file, then the HOME_CSC file.
    Click Start and let the process complete - several minutes.
    Now the nimble fingers bit, remember NO WIPE. Press and hold Bixby button, (Bixby is superfluous but convenient at this first point) Vol-down and Power, when screen goes off, quickly change to Vol-up button whilst still holding Bixby and Power. As soon as screen appears, let go of all buttons.
    Your phone will now reboot into Magisk rooted mode with all your data intact.
    14
    Hi John (@topjohnwu),

    Great job with this find & guide for it. It works flawlessly if all the steps are followed 100%. Thanks!

    I've made a full video tutorial (including ROM downloading and everything), maybe it'll help others who have had problems or just want to see the process while or before they perform it.

    Feel free to post it in the OP if you think it helps in any way.

    The video link is as follows: https://youtu.be/o3a8YnWT3yk

    Thanks!
    12
    Last night, I used Magisk Manager to patch the AP file from the ASD5 firmware. This is actually the first time I have upgraded in this way, and I must say that John has made life extremely easy for all of us.

    I just wanted to give a tip for anyone who is already running TWRP on their device at the time they need to update their firmware.

    Using John's procedure, you'll have to enter download mode a second time to re-install TWRP and re-disable encryption. Since I screw up getting into download mode once in a while, I find it a nerve-racking experience, since failing to boot into download mode at this juncture could initiate a system reboot that would re-encrypt /data.

    So, before you flash the patched AP, you can make a copy of your existing Magisk-rooted TWRP recovery. For example, a quick way to do it is by typing this in a root shell:

    Code:
    # dd if=/dev/block/sda15 of=recovery.img

    Next, replace the stock recovery image in the AP file that you patched using Magisk Manager. On Linux, that would look something like this. Adapt these commands for whichever platform you use.

    Code:
    $ tar f magisk_patched.tar --delete recovery.img
    $ tar rf magisk_patched.tar recovery.img

    Now, when you flash the resulting file in Odin and reboot, all you have to do is hold the recovery combo down until you reach TWRP. Then, simply disable encryption again (e.g. by flashing my own multidisabler zip) and reboot.

    I followed the above procedure myself last night and it worked like a charm.