Hey Guys,
Before you dive in, irrespective of your reading speed read this carefully and slowly for better understanding but if you cannot focus and read it slowly then you better give up music for a few weeks.
About the Device
Before you jump in and get your hands dirty.. you should know that what you will be installing is Generic System Image, It is not specifically made for your device so if you are going to install some other GSI other than this, you might face some issues.
If you are a beginner, you should Go Through Project Treble, just for the sake of knowledge.
Also Galaxy A51 has A/B partition and Supports Project Treble though remember that Treble Devices are not same as A/B devices and Vice Versa.
Things You’ll Need
A Computer (not an iPad)
Internet [requirement around 6 gigs (4.8 gigs optional, for downloading stock Firmware, Highly Recommended)]
Samsung Galaxy A51 (will not work on A50)
Patience and a madcap attitude.
Resources
Download Odin from the link given below and extract it in a folder.
https://odindownload.com/download/Odin3_v3.13.3.zip
Adb and Fastboot Drivers
https://gsmusbdrivers.com/download/adb-fastboot-drivers/#
Samsung Drivers
https://developer.samsung.com/mobile/file/68b2dc40-3833-4a8b-b58e-32f7aca25c00
Havoc OS GSI
Havoc-OS - Browse /arm64-ab at SourceForge.net
Don’t forget to check that there is “arm64” and “ab” written on the name of the file
Other option is with Gapps (it means the rom will come with Google Play services built in
otherwise it is Vanilla Android.
GSI Flasher
(It is used for converting your img file into flashable Zip)
https://drive.google.com/file/d/1J8OlI2CCXpvAJ5FhFlR2b_y58eHQERGs/view?usp=sharing
Extract it you’ll find three folders gsi, META-INF, scripts, keep all of them inside the GSI
Flasher extracted folder.
Twerp Recovery
twrp-a51-3.5.0_10-1_ianmacd.tar | by androidhowto for Utilities (androidfilehost.com)
Do not use any other in this case you might get mounting errors.
Encryption Disabler
Disable_Dm-Verity_ForceEncrypt_03.04.2020.zip | by androidhowto for Utilities (androidfilehost.com)
Its Show time
1. Go to settings and go to about phone, tap build number 7 times and a dialog will appear, you are now a developer.
2. Go to additional setting or search developer options in the settings search bar
3. Once in the developer settings find OEM unlock and turn in on, scroll down and also turn on USB debugging, your phone will ask the permission for accessing the data by your computer.
4. Turn off your device. Get a usb cable and connect it to your computer.
5. While phone is off first press Volume UP and Volume Down together, and then then insert the usb cable into the phone while holding the buttons wait for two seconds. a blue screen will come up telling you about consequences and life choices.
6. Long press the Volume Up Button and a new blue screen will show up asking you for unlocking the bootloader. Press Volume Up to confirm. You device will erase everything and reset itself ( Don’t forget to take backup of your Data).
7. After the setup screen appears skip everything in the setup and enable developers option and enable USB debugging in the developer options.
8. Turn off your device again and Repeat step 5.
9. Press Volume up for entering the download mode
10. Now in your computer, Install Odin and open Odin.exe you’ll find your device as comm: xx
Now click on the AP button and select the twerp you downloaded.
Press start and twerp will be installed in your device. Your device will reboot don’t let it boot to one ui, press all three buttons together and hold, as soon as the screen goes black release only the volume down button. Keep holding the Volume UP and power buttons for 3 seconds and then release, you find yourself in twerp. If you miss it repeat the process again but don’t let it boot to One Ui.
In twerp press wipe => format data =>type yes. Press home button and again go to wipe advanced select Data, Cache and Dalvik and swipe to clear.
Press home again. Go to reboot and select recovery, twerp wil reboot. Once it reboots transfer the encryption disabler to your phone and in twerp press install select the storage, sdcard or internal storage, where you have stored the file, select it and swipe to install.
Now in your computer extract the Havoc os image and rename it as “system.img”.
Extract the GSI flasher, copy system.img and paste it in the gsi folder of the GSI Flasher.
Select gsi, Meta-inf, scripts and compress them into a zip and transfer into the phone.
Now in twerp Press install, select the zip file and swipe to install. Also install Gapps or Magisk if you want (though normal magisk will have problem try install phh_magisk, discussed later).
Reboot and KABLAMO You have installed Havoc OS.
Bugs
A small random issue in Auto Brightness
If you root with magisk and install modules, after you reboot your phone will get into a bootloop. Use Phh_Magisk but I aint sure if it’ll work or not Your call madcap.
NONE OF THE FILES IN THIS TUTORIAL HAVE ANYTHING TO DO WITH ME. If SOMETIHING HAPPENS I AM NOT RESPONSIBLE. ONLY DO IT AT YOUR OWN RISK.
Troubleshooting.
If you find errors in twerp, such as unable to mount vendor or system_root, or data. Then you got to install the stock One Ui Back again, therefore it is highly recommended to keep with yourself the stock firmware. You will need It. And it is 4.78 gigs. You can download it from
Model : SM-A515F - Galaxy A51 — Samfrew.com
To reinstall the stock firmware first extract it and the open odin and repeat steps 8 and 9, once your device is detected in Odin press the respective buttons and select the respective files such as for BL button select the file With BL in the name. Do it for buttons, BL, AP(once you select the file it will take long for it load into odin so do not panic and let it load, it might become unresponsive but use patience and wait.)CP , CSC. Click on start and you’ll have ONE Ui back on your device.
To Lock the bootloader repeat steps 5 and 6.
If you still want more stability and Control You can install a different Kernel NDataX from (@Hendamanu) https://forum.xda-developers.com/m/hendramanu.11224917/
Thanks for your contribution
Related
I have been derailing the internet trying to figure out some way to root my device with and without usb connecting it to my mac. Frankly, as far as I can tell my mac and my phone won't support mass storage of android so odin etc seems out of the question. I just want to find a way to get my phone rooted (tried kingroot and it asked for computer and I've a mac so there you have it). Please if anyone could help me find a simple, maybe even complicated way to root my s6 (it's updated fully).
Define without USB? Like no OTG USB Storage or no USB cable? If that's the case then you're asking how to root the device without a computer which afaik with Samsung isn't an easy deed (perhaps not possible).
-------------------------------------------------------------------------------------------------
Firstly, you do this at your own risk. Js.
However.. If you can get it up and going on your Mac then try out Heimdall (the Mac/Linux Odin alternative some whiz managed to reverse engineer).
P.S. I have Linux but I've seen Heimdall is available on Mac, unfortunately I can't step you through installation.
https://forum.xda-developers.com/showthread.php?t=2118100
Go to the TWRP.ME site and locate your device and download the latest TWRP image (should be 3.1.1.0)
https://dl.twrp.me/zerofltetmo/
Download dm-verity encryption disabler (without this, it's likely things won't go as planned, it ensures you haven't modified system files etc)
https://androidfilebox.com/miscellaneous/dm-verity-and-forced-encryption-disabler/
Choose a Root method (personally I prefer Magisk but for a first time superuser provider I would recommend SuperSu:
https://download.chainfire.eu/1114/SuperSU/SR1-SuperSU-v2.82-SR1-20170608224931.zip
[ PLACE PHONE IN DOWNLOAD MODE: Hold VOL-DOWN + HOME + LOCK, then press VOL-UP ]
1. Go to Utilities Tab
2. Click Detect Device; if it is not detected you have a problem (find fix then go to Step 3)
3. Output reads Device detected; beneath Download PIT save the file somewhere (e.g. Documents/s6.pit)
4. Go to Flash Tab
5. Beneath Options > PIT, browse for the .pit file you saved in Step 3
6. On the right hand side, beneath Partitions (Files) click > Add, on the left change the partition name to Recovery (where it will ask for a recovery.img file)
--- READ STEPS 7-9 BEFORE YOU DO THEM ---
7. Select the TWRP.img you downloaded earlier
8. Click Start, pick your phone up (be careful not to disconnect it)
9. AS SOON AS THE SCREEN GOES BLACK, HOLD: VOL-UP + HOME + LOCK
--- READ STEPS 7-9 BEFORE YOU DO THEM ---
10. If done correctly (and your bootloader is unlocked, and your RA lock is disabled) you will be in TWRP Recovery. Swipe to allow system modifications (you can always come back here later, you asked for Root so this will suffice).
11. Use Finder (File Browser) to navigate onto the phone from your Mac and copy SuperSU and no-verity onto the Internal Storage
12. From TWRP (on the phone) tap on the Install tab and if you aren't able to see the two .zip files you copied over, you're probably in the / directory; navigate to /sdcard
13. Tap on the no-verity.zip first, continue through, don't worry about using multiple .zips just install and go back when it is complete
14. Tap on the SuperSU.zip. Continue through, same as previous step, this time backing out to the TWRP menu and tap on the Reboot Tab > Choose System
15. If prompted to install anything (TWRP) untick the boxes and tap do not install.
16. Your device should be rooted. Don't turn the phone off, don't panic. SuperSU can cause the first one or so boots to end prematurely and the device will reboot (don't be alarmed if it cuts out).
Note:
On the odd chance that your device is stuck in a bootloop or you are worried about 'bricking' the phone, the only way that can happen (afaik) is if you disconnect during important installations such as during the Odin/Heimdall flash process or TWRP (under certain circumstances, even during Odin/Heimdall you can normally pull through). Otherwise, you'll just end up with a soft-brick (99.9% of the time this is the only thing that happens)
glgl
I finally succeeded it, after literally months of trial and error! So, I am writing this post in hope that someone who wants to install Oreo on Life One X in the future would find this post through Google search.
Here are the steps.
0. From this page (https://forum.xda-developers.com/android/development/rom-official-mados-wiko-fever-clones-t3762800), download the TWRP recovery and the madOS Oreo ROM.
1. Download the BLUEFEVER ROM from this page (https://www.npcglib.org/~stathis/blog/2016/04/13/turned-blu-life-one-x-wiko-fever-4g/).
2. Download the SP Flash Tool from the page above or through Google search. The version I used was 5.1812, which seemed to be the latest version.
3. Download the Universal ROM from this page (https://forum.xda-developers.com/android/development/flashable-wiko-fever-stock-marshmallow-t3720484)
4. The critical things is you should not flash the Universal ROM as it is, because that bricked my One X. You need to copy "preloader_l5460.bin" and "secro.img" from BLUEFEVER in step 1 and overwrite them to the Universal ROM.
5. You need to install the Mediatek Driver. I used "MT65XX USB VCOM" driver. I found it using Google search, but forgot where I got it from. But with that name, I think you can find it.
6. Now start the Flash Tool, and and select the download agent in the Flash Tool directory (MTK_AllInOne_DA.bin), and select the scatter file in the Universal rom (MMX BLU), and then select "Format all + Download". Then, this is very important, press the download button BEFORE connecting the phone, otherwise it will not work.
7. Now, turn off the phone (I mean, power off, not just screen off) and then connect it to the PC. If the tool does not recognise the phone, press volume up + down at the same time when you connect it until the device connected sound comes from Windows.
8. Now the tool flashs the rom. Wait. It may take a few minutes.
9. If it is bricked, just leave it for a month until the battery drains and completely turns off, and then try flashing again.
10. Now, boot up the phone, go to Settings -> About and hit the build number several times to enable the developer menu.
11. In the developer menu, enable OEM unlocking.
12. Now, install the Google USB Driver. This can be easily found through a Google search. You need to get the "platform-tools" directory of the Android SDK, which can also be easily found.
13. Now, turn off the phone, and hold volume up + power button. The phone shows tiny menu (really tiny...). The first is recovery, the second is fast boot, and the third is normal. Choose fast boot. Type "fastboot oem unlock". You need to press the volume up button on the phone now.
14. Now the phone is unlocked. Type "fastboot.exe flash recovery twrp_wiko_fever_oreo.img" to flash the recovery.
15. Restart in the recovery using the 13th step.
16. Go to Wipe -> Format data and format the data, otherwise the recovery will not recognise the storage and will not boot.
17. Go to Open Gapps and get ARM64, 8.1, micro. Editions above micro will NOT install with an error message that says insufficient storage.
18. Now connect the phone to the PC. The TWRP recovery automatically mounts the storage to the PC so that you can copy files into it. Copy the mad OS rom ZIP from step 0 and the OpenGapps from step 17.
19. Flash the two using the install menu of TWRP.
20. Done.
I do not use One X as a phone, so I skipped the radio flashing steps. It currently shows the baseband is unknown. If you want to use the phone feature, I think you need to flash the radio img or something using the instructions somewhere in the linked posts.
Find here SP Flash Tool
THIS WILL VOID YOUR WARRANTY OR MAY BRICK YOUR PHONE IF NOT DONE CORRECTLY.
I made this because i wanted to play AR games on an unsupported phone, so i want to help other people.
Follow this tutorial CLOSELY, or you'll mess up your phone
WARNING: THIS POST IS DIVIDED IN TO PARTS, IF YOU'RE HERE FOR THE A20e ROOT GUIDE, PLEASE CLICK (Coming soon)
1.0: Preparing.
1. Get your firmware from Sammobile or other sites
Get the NEWEST firmware that is from YOUR COUNTRY.
2. Download and install samsung mobile drivers.
3. Download ODIN Flash tool.
1.1: Unlocking your bootloader.
From this point on, you are taking a risk. You will void your warranty if you continue, i cant stress this enough.
1. Open the settings app, and navigate to: Device Info>Software Information and press Build number 7 times in a row. You will now have access to the developer settings.
2. Navigate back to settings, scroll down and press on "Developer settings"
3. Now, you should see a button called "OEM Unlock". PRESSING THIS WILL WIPE ALL OF YOUR DATA. (Which is normal.)
4. Go through the inital setup, and dont enter your data YET. Dont turn on wifi aswell, since youre going to wipe your data again later.
5. Now, turn off your phone.
6. When your phone is turned off, hold the Volume UP and DOWN button, and plug in your USB-Type C cable.
7. Now, hold the volume UP button for 8 seconds, until the screen changes. Press the volume UP button afterwards. Your data will get wiped again.
8. Go through the initial setup AGAIN, connect to wifi, but DONT enter your google/samsung account data just yet.
You have now unlocked your bootloader.
1.2: Unpacking your boot image.
1. Once you have the firmware, extract it using 7-Zip (Or any other extraction program).
2. You should now have a file called "boot.img.lz4"
3. Download the LZ4 Program on Github.
4. -Extract the zip in any EMPTY folder.
-Put the "boot.img.lz4" into the folder.
-Open CMD. Navigate to the folder you extracted LZ4 into.
- use this command to extract it: "lz4.exe -d boot.img.lz4 boot.img
- Done, now put the "boot.img" to your phone storage.
1.3: Patching the boot image.
1. After you copied the "boot.img" to your phone storage, open magisk manager.
2. Now, select the Install button on the TOP. Press "Patch an image"
3. Select the "boot.img" file you copied from your PC.
4. Wait.
5. Done. Copy the "magisk_patched.img" file to your computer.
6. Convert the ".img" file into a ".tar" file.
2.0: Rooting: Flashing the .tar to your phone.
Follow closely.
1. Turn off your phone, and hold the volume UP and Power button at the same time. After you booted into the recovery, select "reboot into bootloader".
2. Open odin, and firstly go to "options" and untick "Auto reboot". Then, press the "AP" Slot, and select the "magisk_patched.tar" file.
3. Connect your USB Cable, and press "start".
4. it should now say "PASS"
2.1: Rooting
1. hold the volume DOWN and Power button for 7 seconds.
2. QUICKLY hold the volume UP and Power button
3. Select "Wipe data". Press yes.
3. Now, go through the initial setup. You can now enter your data, since we arent wiping our phone anymore.
3. Final Touches
1. Download Magisk Manager again. Open it, and it will install a zip. It will automatically restart.
2. Open magisk manager. If there is a GREEN tick on the top, Well done! You've made it!
You are done with rooting your phone! you can now leave, or continue if you want to play AR games.
Other: AR Compatibility
1. Open magisk manager, press the 3 lines on the top left, and select "downloads"
2. Search "ARCore"
3. Install it, and reset your phone.
4. Now, go to the play store and install "ARCore"
5. You have AR access! Download games like "FNaF AR" or anything else.
This guide will get updated every week.
anyone can confirm this'll work?
Chiryn said:
anyone can confirm this'll work?
Click to expand...
Click to collapse
I tried it, but it didn't work. I think I downloaded a bad firmware tho. I am going to try it now. Btw. if you want an easy firm download I highly recomend Frija v.1.3.0. - only easy, fast and WORKING (at least for me) firmware downloader.
I am stuck at odin saying NAND Write Start!!.
Could anyone help me?
(EDIT)
OneUI 4.1 has finally arrived, if you haven't got your Tab s6 rooted, you can just follow the instructions below. This new part is for the people who followed the guide to root their Tab s6 and now want to update to the new firmware version without losing their data. This guide is inspired in https://forum.xda-developers.com/t/...te-rooted-device-whilst-keeping-data.4245989/. But for simplicity of search I have decided to place it here
(END OF EDIT)
I ran into some problems and took some time to figure out how to install TWRP and root the tablet. The normal procedure by which you flash TWRP and then flash Magisk doesn't work as the download mode won't accept non-official files.
Then, once I got my tablet rooted by the patching method of Magisk, I installed TWRP with their app and got stuck in the logo due to not formatting the data.
After some research and quite a lot of time, I managed to get around that and be able to do everything.
Here is a step by step detailed guide of how to do so.
ATTENTION: These modifications void your warranty and may brick your device. I am in no way responsible for any damage you may cause. Follow this guide at your own risk
Requirements:
-> Latest version of the firmware of your model (I used this site which had the latest version and decent download speeds https://galaxyfirmware.com/model/SM-T860)
(To find which version to download, go into the Phone app, and type *#1234#)
-> Latest Magisk.apk file (https://github.com/topjohnwu/Magisk/releases)
-> Disbale_Dm-Verity_ForceEncrypt zip file (https://zackptg5.com/android.php#disverfe)
-> Latest TWRP img (https://eu.dl.twrp.me/gts6l (europe) or https://dl.twrp.me/gts6l (americas))
-> Official TWRP tool (Play Store)
-> Samsung drivers (https://developer.samsung.com/android-usb-driver)
-> Latest Version of Odin (https://odindownload.com/SamsungOdin)
-> SD Card or Minimal ADB and Fastboot (https://forum.xda-developers.com/t/tool-minimal-adb-and-fastboot-2-9-18.2317790)
(If SD card)
Copy Magisk, AP file from the firmware zip, Disable_dm zip and TWRP img into the SD card, else, you will have to use adb sideload
0. Create a backup of all your data (we are going to wipe the data of the tablet)
(Tablet)
1. Activate developer settings (go to Settings->About Tablet->Software information, and tap 5 times on build number).
2. Go into developer settings and activate OEM unlocking and USB debugging.
3. Turn off the tablet and turn it back on pressing Power + Vol. Down buttons to enter Device Unlock Mode.
4. Press and hold Vol. Up and in the next menu, press Vol. Up to unlock the bootloader (attention, this will erase all of your data)
5. Run through the setup, but be sure to activate the internet (this will prevent the tablet from relocking).
6. Activate developer settings again, and go into it to check that OEM unlocking is greyed out.
7. Install Magisk
(PC)
8. (No SD) Copy the AP file to the Tablet.
(Tablet)
9. Go into Magisk, press Install->Patch a file->Recovery mode (on)->Select file (The AP file).
10. Copy the patched file back into your computer.
11. Shut down the tablet.
12. Press Vol. Up + Vol. Down and connect the tablet to your computer with a USB to enter download mode.
(PC)
13. Open Odin, it should show that your device is connected.
14. Go to the settings tab and uncheck the Auto-Reboot option.
15. Flash all the files of the latest firmware, using CSC (not HOME_CSC) but substituting the AP file with the patched one. (With the WiFi version, you might not have a CP file, don't worry)
CRITICAL STEP (if not followed correctly, may lead to bootloop)
(Tablet)
16. Once the flashing is complete, press Vol. Down + Power during 7 seconds to restart the tablet. As soon as the screen blacks out, swap to Vol. Up + Power (and keep pressing even though it asks to press power) to enter the recovery.
17. In the recovery, navigate to Wipe data/factory reset with the volume buttons and press power button to select. Confirm and reboot.
18. While rebooting, you need to press Vol. Up + Power during 3 seconds (Until the press power to continue appears). This is due to Magisk being installed in the recovery partition.
19. Run through the setup again, but this time you need to login into your google account to enter the Play Store.
20. You should have the Magisk app installed. Open it and it will configure itself.
21. When it reboots, press again Vol. Up + Power for 3 sec.
22. Download the Official TWRP app.
(PC)
23. (No SD) Copy the latest TWRP image previously downloaded into the tablet.
(Tablet)
24. Go into the TWRP app and give it root permissions.
25. Enter TWRP flash and select the latest TWRP img
26. Go into the reboot menu and select reboot recovery.
27. The phone will reboot into TWRP.
28. Tick don't show this message again and slide to allow modifications.
29. Wipe -> Wipe data, Cache and Dalvik and Format data.
30. Reboot -> Recovery.
31. (SD) Flash Disable_DM-Verity zip, and then flash Magisk zip.
32. (No SD) enter the advanced menu and open adb sideload. Connect to the PC, open Minimal adb and fastboot and adb sideload the zip files.
33. Reboot system
Congrats, you have a rooted Samsung Galaxy tab S6 with TWRP installed!
FAQ:
1) Ok, I f* up, I am now stuck in the Samsung logo, what do I do?
Press Power and Vol. Down for 7 seconds, this will auto reboot your tablet. Then, as soon as the screen goes off, try to press Vol. Down + Vol. Up and connect through USB to the PC. With some luck, you manage to get into download mode. If you don't, repeat.
Flash the files with the Magisk modified AP, reboot into recovery and factory reset (follow the next instructions if you want to install TWRP), or else flash the stock rom.
2) I am seeing some screens with some warning messages, is that Ok?
Yes, it is normal, Samsung does that to scare people off from installing modifications on their devices. Can I take them off? Yes, but it is not a simple process. If you really want to, follow this guide, but adapting to the device (https://forum.xda-developers.com/t/...sage-on-samsung-a30-after-root-device.3954589). Another important thing is, when you want to enter recovery, you need to keep pressing Vol. Up + Power, even when the tablet displays the message that asks to press the power button.
3) Don't know... You ask
Works perfectly, thank you!
I have a question: to decrypt the internal memory which files can I flash?
Hello, I'm new here, I've been dealing with certain ROM mods for a little while. My test device is an old Samsung Galaxy S4 mini (GTI9195). Now I've been sitting for a few days trying to figure out how to bring my device up to date as best as possible. Lineage OS seemed the best to me. Unfortunately there is no officially confirmed software for my device directly from Lineage, which is why I looked elsewhere. I came across this thread on XDA: https://forum.xda-developers.com/t/...520-r890-unofficial-11-0-0-lineageos-18-1-for -s4-mini.4189967/ . The user arco68 is, so to speak, the boss among S4 mini modifications. Unfortunately, I can't find exact instructions anywhere (especially for the recovery) on how to install all the packages correctly. That's why I researched. I was able to record various steps, but cannot determine if they are correct. Can someone on this forum please help me? My steps:
1. Turn on developer options
2. Turn off OEM encryption (if available)
3. USB debugging on.
4. Download and install Android platform tools in Path
5. Download and zip Magisc
7. Put the phone in bootloader/fastboot/download mode (volume down + home)
8. Flash Team Win Recovery Project (or other custom recovery).
9. Restart phone and boot into recovery mode (volume up + home + power)
10. Erase all data
11. Copy Google Apps to Phone (Optional)
12. Copy Lineage OS (or other custom rom) to phone
13. Install packages one by one (OS first)
14. Reboot device
15. Wait and set up
Okay, First of all requirement-
A portable sd card- Because after flashing twrp, you might face issue where you can't access internal storage from twrp. That's because the phone might be encrypted. You have to decrypt it by flashing a "disable dm verity- forceencrypt.zip". In this case, you might not be able to transfer files from pc when booted into twrp. So, It's a smart move to insert a sd card containing all required files before to avoid these problems.
Another requirement is samsung drivers installed in pc. I will attach that file.
Follow these steps -
1/Unlock bootloader -Go to developer options. Turn on oem unlocking. It will tell you that you're going to loss all data. Proceed. If it doesn’t tell you anything, then there is definitely some extra process to unlock bootloader of your device.(search on internet)
2/Download your phone's official firmware in pc- it will help you if anything goes wrong. Search " Sm fw" on google. Go to first site. Create an account. Search the model number, Download a firmware that matches with all your device's information in "About phone".
3/ Download the lineageos rom and twrp recovery for your model. Then install device info hw from play store to check bits(32/64). Search open gapps. Go to the website. "arm" is for 32 bit & "arm64" is for 64 bit. Select which matches to your device’s bit. Then select the android version of the custom rom. Then select "Pico". Download the file. Next, download latest magisk 25.2 from github page. Rename the apk file to "magisk.zip" Move rom,gapps, magisk.zip to SD CARD. Keep twrp in pc.
4/In pc, download latest odin software. It's an special software for samsung download mode. (There is no fastboot mode in samsung)
5/Boot your device into download mode. And connect with pc.
6/In pc, extract the twrp file(If It's in zip format). Open odin software, Go to options, turn off auto reboot. Now select "AP" & select that extracted twrp file. Click open. Then hit start button.
(Note that most of the samsung devices can't boot stock rom after flashing twrp. So you have to flash custom rom to boot your device. Follow the next step)
7/Boot into twrp wipe>format data>type "yes". Press home button. Install>Select storage>SD card>select the rom.zip. Then add more zips> select the gapps.zip. Again, add more zips> select magisk.zip. After all, swipe to flash.
After installation, reboot device.
What if anything goes wrong?
Extract the stock firmware that you downloaded from sm fw. Connect device in download mode. Open odin, select AP,BL,CP,CSC file one by one. Start flashing. You device will be alive again.