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.
What you need
Section titled “What you need”- A Samsung Galaxy A12
SM-A127F(Exynos 850, not the MediaTekSM-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.
| File | Purpose | Download |
|---|---|---|
| Stock ROM | Official firmware for your region (to patch AP or restore stock) | SamFW SM-A127F |
| Odin Patched | Windows flashing tool for custom Samsung .tar files | Odin3 v3.14.1 Patched (XDA) |
| TWRP 3.6.1 | Custom recovery image for SM-A127F | twrp-3.6.1_11-1-a12.img |
LineageOS 20 GSI .tar | Pre-packed GSI with TWRP and patched vbmeta | lineageos-20.tar (SourceForge) |
| Permissive KSU kernel | Kernel zip flashed in TWRP after the GSI | kernel-perm-ksu.zip |
| Magisk APK | Root manager (rename to magisk.zip to flash in TWRP) | magisk.apk |
| GSI Touch Fix | Magisk module fixing unresponsive touch on non-BOE panels | Touch-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 |
Option A: Root stock One UI with Magisk
Section titled “Option A: Root stock One UI with Magisk”Patch your AP file
Section titled “Patch your AP file”- Install the latest Magisk APK from GitHub Releases and download your region’s stock firmware from SamFW.
- Extract the firmware zip on your PC and copy
AP_*.tar.md5to the phone. - Open Magisk -> Install -> Select and patch a file, then pick the
APfile. - Copy the generated
magisk_patched-*.tarback to your PC.
Flash the patched AP in Odin
Section titled “Flash the patched AP in Odin”- Boot into Download Mode (power off, hold Vol Up Vol Down while plugging in USB, press Vol Up).
- Open Odin Patched, open the Options tab, and uncheck Auto Reboot.
- Click AP and select
magisk_patched-*.tar. - Click Start and wait for PASS!.
- Hold Vol Down Power to reboot.
Option B: Flash a GSI with Odin and TWRP
Section titled “Option B: Flash a GSI with Odin and TWRP”1. Flash the GSI .tar in Odin
Section titled “1. Flash the GSI .tar in Odin”- Enter Download Mode.
- Open Odin Patched, uncheck Auto Reboot under Options, and load
lineageos-20.tarinto AP. - Click Start and wait for PASS!.
- 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.
2. Format Data to EXT4 in TWRP
Section titled “2. Format Data to EXT4 in TWRP”- In TWRP, tap Wipe -> Advanced Wipe.
- Check Data and tap Repair or Change File System.
- Tap Change File System -> EXT4, then swipe to confirm.
3. Run MultiDisabler twice in TWRP Terminal
Section titled “3. Run MultiDisabler twice in TWRP Terminal”-
Go to Home -> Advanced -> Terminal.
-
Run:
Terminal window multidisabler && multidisabler
4. Convert Data back to F2FS
Section titled “4. Convert Data back to F2FS”- Go to Home -> Wipe -> Advanced Wipe.
- Select Data -> Repair or Change File System -> Change File System -> F2FS.
- Swipe to confirm.
5. Flash the kernel, wipe caches, and reboot
Section titled “5. Flash the kernel, wipe caches, and reboot”- Go to Home -> Install -> Select Storage -> Micro SDCard.
- Select
kernel-perm-ksu.zipand swipe to flash. - Go to Home -> Wipe -> Advanced Wipe, check Cache and Dalvik / ART Cache, and swipe to wipe.
- Go to Home -> Reboot -> System.
Post-install GSI fixes
Section titled “Post-install GSI fixes”Credits
Section titled “Credits”- Original guide and files by Vari (bthavanish/sm-a127f-Root-gsi-guide)
- physwizz for Exynos 850 kernels, TWRP, and early
SM-A127Fnotes - Mizumo-prjkt and phhusson for Treble
super.imgGSI tooling