In this guide, we will show you the steps to root your Samsung device, running the latest One UI 4.0 based on Android 12, via Magisk. The latest iteration of the OS build has bought in a plethora of goodies for the end-users. These include the likes of a new Material You UI and Wallpaper based theming engine that automatically picks up the major color from the wallpaper and applies it as the device theme. Apart from that, you would also get a new Privacy Dashboard, improvements to the camera app design, and a new widget selection screen.
However, this is what the OS has to offer. You always have the option to extract the maximum potential of your device by stepping into the realms of custom development. Be it for flashing Custom ROMs or installing a custom recovery like TWRP, the possibilities stand endless. Along the same lines, you could also gain administrative privileges and access to the system partition by rooting your device. And in this guide, we will help you with just that. Given here are the detailed instructions to root Samsung devices running One UI 4.0 Android 12 via Magisk. Follow along.
- Downgrade Samsung One UI 4.0 to One UI 3.1 (Android 12 to 11) via Odin
- Manually Install One UI 4.0 Beta Android 12 on Samsung
- OTA Download Link for Samsung One UI 4.0 Android 12 Beta
- Google Pay not working in One UI 4.0 Beta Android 12 [Fixed]
Table of Contents
Benefits and Risks of Rooting
Once you root your device by flashing the Magisk patched boot.img via Fastboot Commands, you will be in a position to try out a plethora of customizations on your device. These include the likes of flashing custom ROMs, installing a custom recovery like TWRP, or flashing a custom kernel. Along the same lines, you could also flash Magisk Modules, Xposed Framework, Substratum Themes, Viper4Android, and the likes. However, this is just one side of the story.
Carrying out this process also has its downsides. The first prerequisite in rooting calls for an unlocked bootloader. Doing so will wipe off all the data on your device and make the warranty null and void. Likewise, rooting will trip the Knox, and apps dependent on it might not function. Then the SafetyNet will be triggered, which might cause issues with banking apps [FIXED]. So if all that’s well and good, then let’s get started with the steps to root Samsung devices running One UI 4.0 Android 12 via Magisk.
How to Root Samsung One UI 4.0 Android 12 via Magisk
The below instructions are listed under separate sections for ease of understanding. Make sure to follow in the exact same sequence as mentioned below. Droidwin and its members wouldn’t be held responsible in case of a thermonuclear war, your alarm doesn’t wake you up, or if anything happens to your device and data by performing the below steps.
STEP 1: Unlock Bootloader
First and foremost, you will have to unlock the device’s bootloader. Please take a complete device backup beforehand and then refer to our guide on How to Unlock the Bootloader on any Samsung Device [New VaultKeeper Method]. In short, here’s what you need to do
- To begin with, enable Developer Options followed by OEM Unlocking on your device.
- Then boot it to the Download Mode.
- After this, press and hold the Volume Up key for a few seconds, until you are taken to the Device Unlock Mode.
- Finally, hit the Volume Up button to confirm the unlocking of the bootloader.
- When your device boots up, connect it to the Internet and verify the OEM Unlocking is enabled.
- NOTE: Do not restore the data now as your device will have to undergo a factory reset in the subsequent steps.
STEP 2: Download Samsung One UI 4.0 Stock Firmware
Next up, you will have to download the stock firmware for your device. There are quite a few ways of doing so. For example, you could use the Frija Tool, SamLoader Tool, or websites such as SamMobile. As for this guide, let’s proceed with the Frija Tool. So you may check out our comprehensive guide on How to Download Samsung Stock Firmware/ROM via Frija Tool. Or refer to the below instructions:
- To begin with, download the Frija Tool and extract it to any convenient location on your PC.
- Then launch the tool and type in your device’s Model Numer and CSC Code. [Read: How to Find My Device’s CSC Code].
- Now click on the Check Update button and it shall bring up the latest Android 12 firmware.
- Finally, click on the Download button, select the directory where you wish to download the firmware, and hit Save.
- The downloading process will now begin. Once done, the tool will then decrypt the firmware.
- Once the decryption is complete, it shall spell out the Download Complete message.
- Now go to the folder where you have downloaded the firmware and extract it. Upon extraction, you should get the AP, BL, CP, CSC, and Home CSC files. We will be using these files to root your Samsung device running One UI 4.0 Android 12 via Magisk.
STEP 3: Install Magisk and Check Ramdisk
- To begin with, download and install the Magisk App onto your device.
- As of now, it is recommended to try out the Canary build.
- Once installed, launch the app and note down the value next to Ramdisk [whether YES or NO].
- This value will come in handy later on in this guide.
STEP 4: Patch Samsung AP File
We will now be patching the AP file via Magisk which will subsequently be flashed onto your Samsung device running One UI 4.0 Android 12 to root it. So either refer to our detailed guide on How to Patch Samsung AP Firmware via Magisk or check out the below direct instructions:
- Head over to the folder where you have extracted the firmware files.
- Then transfer the AP TAR file from there over to your device.
- After that, launch the Magisk App and tap on the Install button next to Magisk.
- If your device doesn’t have Ramdisk, then make sure that the Recovery Mode option is checked.
- Moving on, now choose Select and Patch a File, navigate to the AP TAR file and select it.
- Then tap on the Let’s Go button situated at the top right and wait for the patching to complete.
- Once done, you should get the patched AP file named magisk_patched_[random_number].tar under the Downloads folder.
STEP 5: Send Patched AP TAR to PC via ADB Pull
You will now have to transfer this patched AP file to your PC. However, the normal USB method is known to cause some issues. Therefore, you should instead opt for the ADB Sideload method. Here’s how:
- To begin with, download Android SDK Platform Tools and extract it to any convenient location on your PC.
- Then head over to this platform-tools folder, type in CMD in its address bar, and hit Enter. This shall launch the CMD window.
- Now connect your device to the PC via USB cable. Make sure to enable USB Debugging from Developer Options.
- Next up, use the below command to transfer the patched AP file to your PC (make sure to replace the random strings accordingly)
adb pull /sdcard/Download/magisk_patched_[random_strings].tar
STEP 6: Boot your Samsung Device to Download Mode
You will now have to boot your S21 device to Download Mode so that Odin is able to identify it and carry out the flashing of the patched AP file. So refer to our guide to Boot any Samsung Device to Download Mode. Or refer to our below direct instructions:
- To begin with, power off your device.
- Then press and hold the Volume Up and Volume Down keys together.
- While pressing both these keys connect your device to the PC via USB cable.
- Finally, leave both these buttons and hit the Volum Up key to boot to Download Mode.
STEP 7: Install Odin
- To begin with, download the Odin Tool from this link.
- Then extract it to a convenient location on your PC.
- After that, head over to the folder where you have extracted the tool.
- Finally, double-click on the Odin3_v3.14.4 EXE file to launch the tool.
STEP 8: Flash Patched AP and Root Samsung One UI 4.0
- To begin with, launch the Odin tool on your PC.
- Then click on the BL button, navigate to the extracted firmware folder and select the BL file.
- After that, click on the AP button, navigate to the patched AP.tar file and select it.
- Next up, click on the CP button, navigate to the extracted firmware folder and select the CP file.
- Then click on the CSC button, navigate to the extracted firmware folder and select the CSC file.
- As of now, it is advised to flash the normal CSC file and not the Home_CSC file because there is a requirement for a factory reset.
- Once all the files have been loaded, click on the Start button. The flashing process will now begin and could take a few minutes.
- Once done, you should get the PASS!‘ message. Likewise, your device will automatically boot to the OS.
STEP 9: Boot to Stock Recovery to Enable Magisk
Now if your device doesn’t have Ramdisk (see STEP 3), then you will have to boot your Samsung device to Recovery Mode in order to enable magisk. This is because, in the absence of Ramdisk, Magisk had no choice but to install itself in the Recovery partition. So you will now have to boot to the stock recovery.
- For that, press the recovery key combination buttons that you use to boot your device to recovery.
- Then as soon as you see the splash screen, long-press the Volume Up key and you will be booted to the Recovery Mode.
- Once that is done, the Magisk is enabled and you may now reboot to the OS.
STEP 10: Complete Magisk Setup
- Once your device boots up, launch the Magisk App.
- It will ask for additional setup, tap OK.
- Magisk will now install the additional dependencies.
- Once done, it will automatically reboot your device.
So with this, we round off the guide on how you could root your Samsung device, running the latest One UI 4.0 based on Android 12, via Magisk. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.