How to Root Newer Samsung Devices (2025+) using Heimdall and Magisk
Aug 15, 2025bulletproof VPN - stay anonymous
Introduction
There’s a lot of misleading/false/outdated information on the net about unlocking Samsung bootloaders. This guide provides a tested, step-by-step approach that actually works. Lots of steps.
Tested on: Samsung Galaxy A24 (SM-A245F)
What we’re using: Linux, Heimdall, Magisk, and ADB
Prerequisites: Basic command line knowledge and understanding of the risks
⚠️ Warning: This will void your warranty and could brick your device if you mess up. Only proceed if you’re aware of all the risks and you’re a big boy/girl already.
What you’ll need
Before we begin, make sure you have these tools on your Linux system:
- Heimdall - For flashing firmware to Samsung devices
- Magisk - For rooting and patching firmware
- ADB (Android Debug Bridge) - For device communication
- USB cable - For connecting your device to your computer
- Correct firmware - Specific to your device model (download it from SamFW)
Step 1: Enable Developer Options and USB Debugging
You need to enable some settings on your phone. Here’s what to do:
Enable Developer Options
- Go to Settings > About phone
- Find Build number and tap it 7 times (you’ll see a message saying “You are now a developer!”)
- Go back to Settings and you should now see Developer options (somewhere at the bottom)
Enable required settings
In Developer options, make sure to enable:
- USB debugging - This allows your computer to communicate with your phone
- OEM unlocking - This is crucial for unlocking the bootloader
⚠️ Important: If you can’t see the OEM unlocking option in Developer options, or if it’s grayed out, you might be out of luck. This usually happens on devices from Canada or USA due to carrier restrictions. In that case, you’ll need to start protesting outside of your carrier’s office, or buy a new phone from a different region.
Step 2: Download correct firmware
Before you can patch anything, you need to get the right firmware for your specific device. This is crucial - flashing the wrong firmware can brick your phone permanently.
How to find your device info
First, let’s identify your exact device model and firmware version:
-
Check your device model:
- Go to Settings > About phone
- Note down the Model name (if you see something like SM-A245F/DSN, your model is SM-A245F)
-
Find your current firmware version and region:
- Go to Settings > About phone > Software information
- Look for Baseband version (e.g., A245FXXU3BWL1)
- This tells you which firmware version you’re currently running. Region is the part after model name (e.g., XXU)
Download the right firmware
Now head to SamFW and:
- Search for your device model (e.g., SM-A245F)
- Match the firmware version - Look for the same version and region
-
Download the AP file - This is the main firmware file you need (usually named something like
AP_A245FXXU3BWL1.tar.md5
)
Extract the firmware
Once downloaded:
- Extract the firmware ZIP file
- Look for the
AP_xxx.tar.md5
file - this is what we’ll be patching
Step 3: Patch the firmware
Now it’s time to patch your firmware with Magisk. This process modifies the boot image to give you root access.
Transfer the AP file to your phone
First, get the firmware file onto your phone:
adb push AP_xxx.tar.md5 /sdcard/Download/
Install Magisk
- Download latest Magisk APK from the github repo here
- Install it on your phone (you might need to enable “Install from unknown sources”)
Patch the AP file
- Open Magisk app on your phone
- Choose “Select and Patch a File” in the method selection
-
Select your AP file - Navigate to where you pushed the firmware and select the
AP_xxx.tar.md5
file - Wait for patching - This might take a few minutes
Get the patched file
After patching completes:
-
Pull the patched file to your computer:
adb pull /sdcard/Download/magisk_patched_xxx.tar
-
Extract the patched file:
mkdir magisk_patched tar -xf magisk_patched_xxx.tar -C magisk_patched
You should now have a boot.img
file in the magisk_patched
folder - this is your patched boot image that we’ll flash later.
Step 4: Unlock device
⚠️ Following actions will wipe all user data.
- Power device off completely and disconnect any cables
- Have a USB cable plugged into your computer, do not plug it into your phone yet
- Hold both Volume + and - buttons, do NOT press Power, and plug in the USB cable, HOLD UNTIL YOU SEE BLUE WARNING SCREEN.
- Let go of the Volume buttons, then hold Volume Up to select Device Unlock Mode.
- The next screen will prompt you to confirm you want to unlock the bootloader. Quickly Press Volume Up to select Yes (if you wait here, the phone will reboot automatically; in this case, repeat actions). Your device will restart and wipe all user data.
Setup wizard
You aren’t quite done yet. When prompted, press Power Button.
Important: Skip through the wizard but make sure you connect to WiFi. We are going to wipe data again so don’t set up anything yet.
For Samsung account sign-in:
- Press “Forgot password or don’t have account?”
- Then “Set up later in Settings”
- Finally “Skip”
For all other prompts: Press “Later” or “Skip” every time.
Check OEM unlocking status
Once setup is complete:
- Open Settings and enable Developer Options
- Check if the OEM Unlocking toggle is visible
- You might see “Bootloader already unlocked” here
What this means:
- Toggle visible and grayed out: You’re clear to install custom firmware
- Toggle NOT visible: VaultKeeper is not yet disabled
If toggle is not visible:
- Manually check for a firmware update in System settings
- Check again to see if the OEM Unlocking toggle is visible
Prepare for flashing
Enable USB debugging, then reboot into Download mode:
adb reboot bootloader
Step 5: Flashing
⚠️ Following actions will void warranty permanently.
Now it’s time to flash your patched boot image. This is where things get serious - make sure you’re following every step exactly.
Enter Download Mode
You should now see the “Downloading…” blue screen on your phone. If not, reboot into Download mode:
adb reboot bootloader
Flash the patched boot image
Now flash your patched boot image using Heimdall:
heimdall flash --boot magisk_patched/boot.img --no-reboot
Wait for the “boot upload successful” message.
Reboot and factory reset
Immediately after “boot upload successful”:
- Hold Power + Volume Down until the phone reboots
- Agree to all prompts using the Power Button
-
You’ll see the “Android Recovery” screen - Select “Factory data reset” and confirm
- Use Volume Up and Down to navigate between menu options
- Use Power Button to select
- Agree to all prompts using the Power Button
- Go through the setup wizard again - We’re doing another clean start
Magisk setup
- Connect to internet.
- Find Magisk app on the phone.
- Start it, continue, phone will reboot automatically.
Step 6: Check if root is working
Time to verify that everything worked! Let’s check if you actually have root access on your device.
Enable USB debugging.
adb shell
# in shell:
su
# allow superuser access on phone's screen and then run:
whoami
If you see root
as the output of whoami
, congratulations! Your bootloader is unlocked and you have root access. You really did that. Feels great, doesn’t it?