Skip to content

Samsung Galaxy A12 (a12s) · Guide

Root and GSI guide (Magisk + TWRP)

Root stock One UI with Magisk or install a Project Treble GSI on the Galaxy A12 (SM-A127F) using Odin, TWRP, multidisabler, and F2FS.

Use this guide if you want Magisk root on stock One UI or a Project Treble GSI (such as LineageOS 20 GSI) on the Samsung Galaxy A12 (SM-A127F). For native Android 17 ROMs built specifically for a12s, use Install LineageOS or Evolution X instead.

  • A Samsung Galaxy A12 SM-A127F (Exynos 850, not the MediaTek SM-A125F).
  • A Windows PC with Odin Patched (or Linux/macOS with Heimdall) and a data-capable USB cable.
  • A microSD card to hold the kernel, Magisk, and touch-fix zips inside TWRP.

Every file below is also organized by category on the Galaxy A12 page: TWRP in Recoveries, LineageOS 20 GSI in ROMs, kernel-perm-ksu.zip in Kernels, and Magisk/GApps/tools in Other files and Root.

FilePurposeDownload
Stock ROMOfficial firmware for your region (to patch AP or restore stock)SamFW SM-A127F
Odin PatchedWindows flashing tool for custom Samsung .tar filesOdin3 v3.14.1 Patched (XDA)
TWRP 3.6.1Custom recovery image for SM-A127Ftwrp-3.6.1_11-1-a12.img
LineageOS 20 GSI .tarPre-packed GSI with TWRP and patched vbmetalineageos-20.tar (SourceForge)
Permissive KSU kernelKernel zip flashed in TWRP after the GSIkernel-perm-ksu.zip
Magisk APKRoot manager (rename to magisk.zip to flash in TWRP)magisk.apk
GSI Touch FixMagisk module fixing unresponsive touch on non-BOE panelsTouch-fix.zip
MagiskGApps Optional systemless Google Apps module for vanilla GSIs MagiskGApps.zip
Device ID APK Reads your GSF ID for Play Store certification deviceid.apk
Customization pack Optional boot splash, LSPosed, Zygisk, and launcher backup customization/ on GitHub
  1. Install the latest Magisk APK from GitHub Releases and download your region’s stock firmware from SamFW.
  2. Extract the firmware zip on your PC and copy AP_*.tar.md5 to the phone.
  3. Open Magisk -> Install -> Select and patch a file, then pick the AP file.
  4. Copy the generated magisk_patched-*.tar back to your PC.
  1. Boot into Download Mode (power off, hold Vol Up Vol Down while plugging in USB, press Vol Up).
  2. Open Odin Patched, open the Options tab, and uncheck Auto Reboot.
  3. Click AP and select magisk_patched-*.tar.
  4. Click Start and wait for PASS!.
  5. Hold Vol Down Power to reboot.
Odin options tab configuration
Odin Options tab
Selecting AP slot in Odin
Select the AP slot
Odin ready with AP tar loaded
AP loaded, click Start
  1. Enter Download Mode.
  2. Open Odin Patched, uncheck Auto Reboot under Options, and load lineageos-20.tar into AP.
  3. Click Start and wait for PASS!.
  4. Hold Vol Down Power to reboot. The instant the screen goes black, hold Vol Up, tap Power once, and keep holding Vol Up until TWRP loads.
Odin with LineageOS 20 GSI tar loaded in AP
LineageOS 20 GSI .tar loaded in Odin AP
  1. In TWRP, tap Wipe -> Advanced Wipe.
  2. Check Data and tap Repair or Change File System.
  3. Tap Change File System -> EXT4, then swipe to confirm.
TWRP home screen
TWRP Home
TWRP Wipe menu
Wipe -> Advanced Wipe
Selecting Data partition in TWRP
Select Data
Confirming EXT4 format in TWRP
Change to EXT4

3. Run MultiDisabler twice in TWRP Terminal

Section titled “3. Run MultiDisabler twice in TWRP Terminal”
  1. Go to Home -> Advanced -> Terminal.

  2. Run:

    Terminal window
    multidisabler && multidisabler
TWRP Advanced menu
Advanced menu
TWRP Terminal screen
Run multidisabler twice
  1. Go to Home -> Wipe -> Advanced Wipe.
  2. Select Data -> Repair or Change File System -> Change File System -> F2FS.
  3. Swipe to confirm.
TWRP Data partition repair or change filesystem
Repair or Change File System
Selecting F2FS in TWRP
Choose F2FS
Swiping to confirm F2FS format
Swipe to confirm F2FS

5. Flash the kernel, wipe caches, and reboot

Section titled “5. Flash the kernel, wipe caches, and reboot”
  1. Go to Home -> Install -> Select Storage -> Micro SDCard.
  2. Select kernel-perm-ksu.zip and swipe to flash.
  3. Go to Home -> Wipe -> Advanced Wipe, check Cache and Dalvik / ART Cache, and swipe to wipe.
  4. Go to Home -> Reboot -> System.
TWRP Install zip browser
Select kernel zip
Swiping to flash kernel zip in TWRP
Swipe to flash
Wiping Dalvik and Cache in TWRP
Wipe Dalvik and Cache
TWRP Reboot System screen
Reboot to System
  • Original guide and files by Vari (bthavanish/sm-a127f-Root-gsi-guide)
  • physwizz for Exynos 850 kernels, TWRP, and early SM-A127F notes
  • Mizumo-prjkt and phhusson for Treble super.img GSI tooling

Leaving Varifocal

External site

This link opens an external 3rd-party page in a new tab.