Android: LineageOS, Root and TWRP Recovery on Samung Galaxy S7

To get full control of the phone, I've installed LineageOS with root access.

The following instructions might result in data loss, so make sure you have a backup of all data on the phone!

1. Install TWRP recovery


First, you need to boot into Odin Mode. Press and hold Power+Home+Volume Down.


Confirm you are about to lose warrenty by pressing Volume Up.


On Manjaro, I've used heimdall:

heimdall detect --verbose
heimdall flash --RECOVERY twrp-3.4.0-0-herolte.img --no-reboot

Important: Immediately after the screen turns black, press and hold Power+Home+Volume Up to boot into the recovery. If the original ROM is loaded, it will restore the recovery and you need to start over again.

2. In TWRP

undefined undefined

2.1. Wipe

Swipe to confirm you want to make changes to the system.


First, format the /data partition. Click on Wipe in the menu:

undefined undefined undefined

2.2. Install LineageOS

In recovery, you can already connect via adb.

adb push -a /sdcard/

(I've used an image file from xda.)

undefined undefined undefined undefined

2.3. Reboot


Make sure to uncheck all boxes and click Do Not Install.

3. LineageOS

undefined undefined undefined

4. Magisk

Now you've successfully installed LineageOS, but you don't have root access (via su) yet. To get it, go here. I've used Magisk v21.0 and Magisk Manager v8.0.2.

Install both, reboot, and you should have full control now.


5. Update: Samsung Galaxy S4 mini (I9195)

Today I've flashed LineageOS 18.1 on a Samsung Galaxy S4 mini (I9195). Thanks to arco68, it even runs a recent Android version. :*

It's still a great phone, has a great size, it even supports LTE. If Samsung would update it with a modern SoC, an improved camera and maybe a fingerprint sensor in the same form factor (124mm height, 107g) I would pay shitloads of money for it.

The process was similar as described above:

Important note: I've first tried to use Magisk 24.2 and it failed due to cannot mount /system. See this post. Version 24.0 works though and is fine for me, so I just took that version to get root access.

Also, please note that Magisk and Magisk Manager is now bundled in a single .apk file, which is different to the older version described above.