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
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:
2.2. Install LineageOS
In recovery, you can already connect via adb.
adb push -a lineage-17.1-20201008-UNOFFICIAL-herolte.zip /sdcard/
(I've used an image file from xda.)
2.3. Reboot
Make sure to uncheck all boxes and click Do Not Install.
3. LineageOS
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:
- Boot into Odin Mode
- Flash TWRP recovery (I've used version 3.6.1_9-0)
- Flash LineageOS (18.1)
- Optional: Flash Open GApps (I've used ARM, 11.0, pico)
- Flash Magisk-v24.0.zip for root access (Note: rename .apk to .zip and flash via TWRP)
- After a reboot, the Magisk app wasn't installed automatically, so I had to install Magisk-v24.0.apk manually
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.