How to Root Your Android with Magisk and Keep SafetyNet: The Ultimate Guide

  • Magisk allows you to root your Android without modifying the system partition and bypassing SafetyNet.
  • Unlocking the bootloader and patching the boot.img are essential to install Magisk correctly.
  • Bypassing SafetyNet requires additional modules and setting up MagiskHide to avoid detection by apps.

ways to root Android

Rooting an Android device has become an adventure that fewer and fewer users dare to undertake, mainly due to the technical and security restrictions that Google and manufacturers have been implementing. However, the arrival of tools like Magisk has allowed us to continue enjoying the advantages of root access, even on relatively new devices, and to do so hiding root from the system to pass the infamous SafetyNet check. All of this maintains access to critical apps like banking, mobile payments, and even games that were previously blocked on modified devices.

In this article I am going to explain to you All you need to know to root your Android using Magisk, with a special focus on maintaining SafetyNet, covering everything from the preliminary steps and requirements to detailed methods for different models, specifics by brand, and tips to ensure you don't miss a single detail during the process. If you're looking for a comprehensive guide with clear language and practical examples, you've come to the right place!

What is root on Android and why root today?

Root an Android device It means obtaining superuser privileges, that is, having the highest level of permissions in the operating system. While years ago it was practically essential for customizing mobile phones or getting the most out of features, it's becoming less common today, but it's still essential if you want to:

Related article:
How to know if your Android is rooted with Root Checker
  • Remove system apps and bloatware
  • Control permissions and advanced automations
  • Installing custom ROMs, customization modules, or applications that require elevated permissions
  • Extend the useful life of an old mobile phone by giving it new uses

Despite all these benefits, there are also disadvantages, and they are not few: You can lose the warranty, leave the phone unusable (bricked), or cause incompatibilities with increasingly security-demanding applications and services.

Learn to root Android with these tools

Things to consider before rooting Android

Before you take the plunge, it's a good idea to review the main risks and warnings:

  • Bricked: With any rooting process, there is a risk that your phone will become unusable if something goes wrong (flash failure, corrupted files, etc.).
  • Data loss: Many methods involve unlocking the bootloader, which will forcibly erase all content on the deviceAlways make a backup before you begin.
  • Incompatibility with apps: Some apps, such as mobile banking, games (Pokémon Go, Call of Duty, etc.), or NFC payments, may crash if they detect that the device is rooted or the bootloader is unlocked.
  • Warranty and support: If your device is still under warranty, having the bootloader unlocked may void it. In the event of a malfunction, official support may refuse to repair it.

In short, root is still useful., but you will need to assess whether the benefits outweigh the drawbacks based on your specific case.

Main methods to root your Android

There are currently several ways to gain root access, and although Magisk It's the most popular and secure tool, but it's not the only one. Below is a summary of the most common methods:

1. Root apps for Android

In the past there were apps like Kingo Root o Kingroot that promised to root with a single touch. Currently, their success is limited to very old models (usually Android 6.0 or earlier), exploiting vulnerabilities that have already been fixed. Not recommended for recent phones And, in any case, their use entails security risks: once rooted, these apps can do anything with your phone, so if you decide to use them, do so with a clean device, without your real data, and change it to a more secure manager like Magisk or SuperSU as soon as possible.

2. Root apps for Windows

Same concept, but running the exploit from the PC and connecting the phone via USB. Tools like OneClickRoot or the desktop version of KingRoot work on the same old models. Again, the trust in the developer It's crucial, and the risk of the app leaving backdoors or including malware is high. Use it only as a last resort and never on your primary phone.

3. Flashing via custom recovery

The traditional method of rooting using TWRP or CWM: Flashes a ZIP file with the root binaries (like Magisk or SuperSU) from the recovery itself. It requires unlocking the bootloader, installing the modified recovery, and then installing the root ZIP. the most universal method but also the one that involves the most risks. Keep in mind that some recent mobile phones have the bootloader locked and do not allow this procedure.

4. Root using Magisk

Magisk It is the most advanced root tool currently available. It is open source, the community can audit its operation, and it allows Root without modifying system partitions. Most importantly: it includes the possibility of spending the SafetyNet Google's, hiding root access from most apps and services that previously had easy access to it. Magisk is usually installed by flashing a patched boot.img or using recovery. Additionally, its module system allows you to install all kinds of add-ons and hacks with just a few taps.

How to root your Android with Magisk without losing SafetyNet

Let's go with the most recommended and safe method for most users: Root Android Using Magisk and make sure that the device passes SafetyNet check to continue using the services that require it. Here's a breakdown of the options and more detailed steps, taking into account what you learned in the reference tutorials and adapting it to different models and scenarios.

virtual xposed
Related article:
Install Xposed modules without root? That does VirtualXposed

Unlocking the bootloader: the first essential step

El bootloader This is the device's bootloader. If it's locked, you won't be able to flash partitions (the Magisk-patched boot.img, for example), so you'll need to unlock it first:

  • Most brands require you to activate the developer options (by tapping 'Build number' repeatedly in Settings > About phone).
  • Once visible, activate the OEM unlock y USB debugging (Settings > System > Developer options).
  • On models like Xiaomi, you will need to log in with your account, add the device to the unlock status and follow the instructions in the tool We Unlock from the PC. You usually have to wait a week until the unlock is authorized.
  • For other brands, you can unlock it via fastboot commands from the PC by typing: fastboot oem unlock (or the command that corresponds to your brand).
  • Caution: Unlocking the bootloader erases all data Of the device.

Once unlocked, your phone or tablet will be as good as new and you can proceed with the root process.

Prepare the boot.img file and Magisk Manager

To install Magisk Without custom recovery, you need the file boot.img from your device's current ROM. You can extract it from the official ROM downloaded for your model ("Stock ROM" or "Fastboot ROM"), usually available on each manufacturer's support website. Always make sure the boot.img corresponds exactly to the firmware version and region you have installed.

Then download the Magisk Manager app (now simply Magisk), from its official GitHub page. Install it on your phone after enabling the installation of apps from unknown sources.

Patch the boot.img with Magisk

Open Magisk on your mobile. Choose the option install Magisk and select "Patch a file". Select the boot.img file you copied to internal storage, usually in the Download folder. Magisk will generate a file named magisk_patched.img (or something similar) in the same folder.

Now transfer that file back to your computer, using whatever method you prefer: USB, cloud, email, etc.

Flash the patched boot.img with Fastboot

With the mobile in fastboot mode (you can enter using the command adb reboot bootloader from the PC with USB debugging enabled, or by turning the phone off and on with a special key combination), connect the device to the PC and, in a command console, go to the folder where you have the ADB/Fastboot drivers and the magisk_patched.img file.

Type the following command to flash the patched boot:

fastboot flash boot magisk_patched.img

On some models with A/B partitions (each with its own boot, common on recent devices), you'll need to flash both:

fastboot flash boot_a magisk_patched.img fastboot flash boot_b magisk_patched.img

Once completed, reboot your phone with:

fastboot reboot

Complete Magisk installation to root Android

Once your phone boots up, reopen Magisk. It may ask you to install some additional components and restart again. Do so. Once finished, Magisk will be operational and your phone will be ready. fully rooted without modifying the system partition.

Bypass SafetyNet: Hide Root from Google

The key to being able to continue using sensitive services and apps is pass the SafetyNetTo do this, you'll need to install some extra modules from Magisk:

  • Install the SafetyNet Fix module: Download it in ZIP format from GitHub (for example, the version safetynet-fix-v2.2.1.zip) and flash the module from Magisk in the modules section, choosing “Install from storage.” Reboot the device when prompted.
  • Install Riru (if Magisk version and your system require it): This may be necessary, especially on Xiaomi devices or ROMs that require it, for other stealth modules to work properly.
  • Activate MagiskHide: Go to Magisk settings, locate the MagiskHide option, and activate it. This will hide root access for specific apps (Google Play Services, banking apps, etc.). Check all the recommended boxes and verify that the Magisk app name is changed if necessary (this helps bypass additional detection checks).

Finally, use the “Check SafetyNet” feature in Magisk to make sure the patch is working and you can continue using all your apps without issues.

Advanced schematic for models without custom recovery or TWRP

steps to follow to root Android

Does your model not have a custom recovery available, or do you want to lose OTA updates? No problem: you can still root using the patched boot.img method, as explained on forums like MovilesDualSim. You can also check out the .

  1. Unlock the bootloader following your manufacturer's procedure (essential).
  2. Extract the boot.img from your ROM and copy it to your phone to patch it with Magisk.
  3. Generate the magisk_patched.img file and transfer it back to your PC.
  4. Flash the patched file with fastboot to each corresponding boot partition.
  5. Boot your phone and complete the installation from Magisk Manager.

If something goes wrong and your phone goes into bootloop, you can always recover the original state flashing the factory boot.img again (better if you have the full ROM on hand to restore everything).

Specific example for Xiaomi and Mi Pad tablets when rooting Android

On devices like the Xiaomi Mi Pad 5, the process is very similar, although there are some practical peculiarities that you should take into account, as explained in .

Xposed Framework
Related article:
Best Xposed Framework Modules for Android Root Users
  • Unlocking the bootloader This is only possible with a Mi account, using the Mi Unlock tool on your PC. You must wait the exact amount of time indicated by the software (usually 7 days). Don't format or tamper with the account during this time, or you'll have to start over.
  • Once unlocked, install the official SafetyNet-compatible ROM if you want to ensure maximum compatibility before rooting.
  • Extract the boot.img file from the appropriate ROM folder and install it on the device to patch it with Magisk, following the steps above.
  • Flash the patched boot on both partitions (A and B) using fastboot and reboot several times to avoid lags or performance issues after patching (at least two additional reboots are recommended).
  • After rooting, install the necessary modules for SafetyNet and enable all stealth options, including changing the Magisk app name. Use the verification option to verify that everything was done correctly.

What if you want to return your device to factory settings?

If you need to revert the process, simply flash the stock ROM and select the option to lock the bootloader during the flash (e.g., "Clean all and lock" in Mi Flash). This will restore the device to its factory state, with no trace of root.

The process to root with Magisk and keep SafetyNet working It is practical and safe if you follow the right stepsThe key is to make backups, stay well-informed, and always use official or audited tools, striking a balance between functionality and security. Share the information and more people will know about the topic..