How to root Samsung Galaxy S5 with only open source methods*? First we need to TWRP. TWRP and custom recovery which allows us to install different things a phone like custom operating systems or root the phone. You can download TWRP from here.
Link https://twrp.me/samsung/samsunggalaxys5qualcomm.html
Then we need Odin Samsungs own flash tool this is the only part what is not open source ( to my knowledge). The place we’re going to download it is from Sammobile.com Here you will also get stock operating system if something goes wrong and unroot the phone.
Link https://www.sammobile.com/firmwares/galaxy-s5/SM-G900F/NEE/download/G900FXXS1CQD2/130613/
Scroll all the way down and click the download Odin link. Now open up Odin and click the AP button select TWRP file. Next let’s put Samsung Galaxy S5 into download mode turn the phone off and hold volume down, Power and home button until you get to download screen. with with you with USB cable. In Odin in the ID:com section should now be a yellow bar just press start. TWRP should be installed now sometimes you need to remove the battery to keep stock recovery from flashing itself back. You can Boot to recovery by pressing volume up + home + power button. here we can do anything we like we can wipe the phone install a new OS better known as ROM in Android world. Root our phone for that we need Magisk open source rooting tool.
Link https://forum.xda-developers.com/apps/magisk/official-magisk-v7-universal-systemless-t3473445
Move the file to your phone in TWRP select install select the Magisk file and swiped the right. that’s it! Now you can reboot the phone. Now the Samsung Galaxy S5 is rooted.
Both TWRP and Magisk are fully open source and free which is awesome! that’s all for today