How to Root Newer Samsung Devices (2025+) using Heimdall and Magisk

Aug 15, 2025

bulletproof 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:


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

  1. Go to Settings > About phone
  2. Find Build number and tap it 7 times (you’ll see a message saying “You are now a developer!”)
  3. 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:

⚠️ 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:

  1. 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)
  2. 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:

  1. Search for your device model (e.g., SM-A245F)
  2. Match the firmware version - Look for the same version and region
  3. 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:

  1. Extract the firmware ZIP file
  2. 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

  1. Download latest Magisk APK from the github repo here
  2. Install it on your phone (you might need to enable “Install from unknown sources”)

Patch the AP file

  1. Open Magisk app on your phone
  2. Choose “Select and Patch a File” in the method selection
  3. Select your AP file - Navigate to where you pushed the firmware and select the AP_xxx.tar.md5 file
  4. Wait for patching - This might take a few minutes

Get the patched file

After patching completes:

  1. Pull the patched file to your computer:
    adb pull /sdcard/Download/magisk_patched_xxx.tar
    
  2. 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.

  1. Power device off completely and disconnect any cables
  2. Have a USB cable plugged into your computer, do not plug it into your phone yet
  3. Hold both Volume + and - buttons, do NOT press Power, and plug in the USB cable, HOLD UNTIL YOU SEE BLUE WARNING SCREEN.
  4. Let go of the Volume buttons, then hold Volume Up to select Device Unlock Mode.
  5. 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:

For all other prompts: Press “Later” or “Skip” every time.

Check OEM unlocking status

Once setup is complete:

  1. Open Settings and enable Developer Options
  2. Check if the OEM Unlocking toggle is visible
  3. You might see “Bootloader already unlocked” here

What this means:

If toggle is not visible:

  1. Manually check for a firmware update in System settings
  2. 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”:

  1. Hold Power + Volume Down until the phone reboots
  2. Agree to all prompts using the Power Button
  3. 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
  4. Agree to all prompts using the Power Button
  5. Go through the setup wizard again - We’re doing another clean start

Magisk setup

  1. Connect to internet.
  2. Find Magisk app on the phone.
  3. 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?

If you want to support us, you can donate here: Donate