Before you move further, make clear that rooting device -
- Your warranty will be void
- Some of functions may not work on rooted device, some function may get back with un rooting, some may never.
- All your data on device will be lost
- Flashing custom binaries may brick (Usually soft but can be hard brick too) your device, so follow it on your own risk!
If you are ready with condition, move further -
A. Preparing Root files
You need to patch file to flash using Odin to root device.
1. Download stock firmware for your device (google search will give you many sites to download it) some common are e.g. Sammobile, Samfirmware tool)
you need to download file according your region and model (Dial *#1234# will give you details of existing firmware, download accordingly).
2. Once you finish download, extract files and keep all files on PC.
3. From extracted files a file with name AP_[device_model_sw_ver].tar.md5 and BL_[device_model_sw_ver].tar.md5 copy them to your device.
4. Download Latest Magisk Manager and Install to your device.
5. Open Magisk Manager - Magisk (first one) - Install - select to "Select and Patch file" - Navigate file you have copied to device (AP_[device_model_sw_ver].tar.md5).
6. Magisk Manager will patch the whole firmware file and store the output to [Internal Storage]/Download/magisk_patched.tar
7. Copy patched file magisk_patched.tar to Your PC and rename to AP_magisk_patched.tar
8. Rename BL_[device_model_sw_ver].tar.md5 to BL_patched.tar
9. OpenBL_patched.tar using 7zip and replace vbmeta.img.lz4 with patched vbmeta.img from AP_magisk_patched.tar
10. Download latest Odin (link) and extract to a folder on PC (I recommend on desktop).
Now next step is to modification on device.
B. Unlocking Bootloader
This is a basic step to root device. Go to settings - about phone - Software Information - tap multiple times on "Build number" - This will open developer option.
Now in settings at the end, you will have new option "Developer options" - look for OEM unlocking - Enable it.
(PS : If you don't see this option then you may need to wait up to 7 days or more to appear or may be on some operator you will get it never. Without this option you can not root your device, sorry!).
How to get OEM Unlock option back?
2. Use the toggle button to disable Automatic date and time.
3. Set date option will be enabled now. Tap on it, and set the date to about 10-20 days earlier.
4. Enable developer options.
4.a Go to your device Settings.
4.b Select ‘About phone’ » tap seven times on ‘Build number’.
└ This will enable Developer options under Settings.
4.c Go back to Settings » scroll down to the bottom and you’ll see Developer options menu.
5. Open developer options (in the Settings app itself), and find the option called ‘Auto update system‘. Use the toggle button to disable it.
6. Now, go back to the main screen of Setting, and then tap on Software update.
7. Disable the option ‘Download updates automatically‘.
8. Tap on ‘Download updates manually‘ option, but it will give you an error because of the wrong date, so it’s fine.
9. Restart the device.
10. Go to Settings > Developer options. The OEM unlock option should be enabled now.
Once you have enable OEM unlock option, switch off your device and reboot to download mode.
To put device in download mode - Press Volume Up & then Press Volume Down (Keep holding both) and connect device to PC with USB cable
When device start to download mode, long press volume up to unlock the bootloader. This will wipe your data and automatically reboot
Now let finish setup and again enable developer options (as said above), and confirm that the OEM unlocking option exists and grayed out!
If it is not then you can not root device!
Once you see this option and greyed out, you are ready to flash custom binary and root your device.
C. Installation (Flashing) custom binaries
1. Switch off the device and reboot to download mode (As said earlier) and select volume up to continue.
2. Open Odin (downloaded from above instruction) as administrator.
2.a Select AP_magisk_patched.tar file you have patched (as above instruction copied to PC) for AP tab of Odin.
2.b Select BL_patched.tar file you have patched (as above instruction copied to PC) for BL tab of Odin.
2.c Select CP and CSC file (Extract from stock firmware you have downloaded) with according respective tab of Odin (This is important, DON'T flash only AP_magisk_patched.tar).
3. From Odin option - uncheck Auto Reboot option.
4. Now start flashing and wait till it finish. When you see a PASS sign on Odin, disconnect device.
Now magisk is successfully finished but yet you need to follow instructions below.
D. Factory reset & Boot with magisk
After disconnecting device, keep holding Vol down + Power key to exit from download mode.
Here is very important - when you see device reboot As soon as the screen turns off, immediately press Volume Up + Power Key to boot to recovery partition. continue pressing the volume up button until you see the stock recovery screen.
In the stock recovery menu, use volume buttons to navigate through menus, and the power button to select the option. Select Wipe data/factory reset to wipe the data of the device.
Select Reboot system now, and immediately press Volume Up + Power Key. After seeing the bootloader warning screen, release all buttons so it can boot to the system.
The device will automatically reboot for the first time it boots. This is completely normal and done by design.After the device is booted up, do the usual initial setup. You shall see Magisk Manager in your app drawer; if not, manually install the APK you downloaded and continue to the next step. The app would be a stub and it shall automatically upgrade to the full Magisk Manager when you open it.
Magisk Manager will ask to do additional setups. Let it do its job and the app will automatically reboot your device.
Voila! Enjoy Magisk.
Once you have device with Root as said above, follow below guide to install TWRP.
1.Download TWRP for your device from here.
2. Use Magisk Manager to Select and Patch a File. Provide your freshly downloaded TWRP image file as the input.
3. Copy patched file magisk_patched.img to Your PC and rename to recovery.img
4. Extract patched boot.img and vbmeta.img from AP_magisk_patched.tar next to recovery.img from step 3.
5. Select patched boot.img, vbmeta.img and recovery.img, Use 7zip to make it into twrp_magisk_patched.tar (right click and choose add to archive)
2.Download multidisabler-samsung-*.zip from here and copy to Ext Storage (Because once you flash TWRP, Int storage will not be readable)
3.Switch Off device and then Press Vol Up + Vol down and connect device to USB - To put device into Download Mode
4.Now select twrp_magisk_patched.tar file with Odin in AP tab
5.Immediately after that reboot to recovery and flash multidisabler-samsung-*.zip
6.Reboot to recovery and select WIPE - Format Data - Now you need to type "YES" ( NOTE : THIS WILL ERASE ALL DATA from device including Int Storage)
Done! Now you have TWRP with Rooted device.
PS : Once you Install patched TWRP and flash multidisabler*.zip, your OEM unlock option will set to Off and can not be turned ON because of hacked OEM function. This is made intentionally to prevent official binary error.
Due to the fact that some devices no longer uses ramdisk in boot images, Magisk has no choice but to be installed in the recovery partition. For these devices, you will have to boot to recovery every time if you want Magisk. Since both Magisk and recovery lives in the same partition, what you actually end up getting when you choose to boot to recovery will be determined by how long you press volume up.
- (Powering up normally) → (System with NO Magisk)
- (OEM Recovery Key Combo) → (Splash screen) → (Release all buttons) → (System with Magisk)
- (OEM Recovery Key Combo) → (Splash screen) → (Keep pressing volume up) → (Actual recovery)
Thanks and credit
For more details read Installation guide by @topjohnwu from Here.
All credit and thanks go to @topjohnwu for magisk & guide.
@dr.ketan for this guide from Here
@ianmacd for multidisabler from here
Me to to modify this guide and multidisabler-samsung-*.zip to suit our device.