Note: Take a complete backup of your data. There may be a chance to erase internal memory if required. This will void warranty. I am not responsible to any harm done to your device. You should know what you are doing. Follow the steps carefully.
Get the TWRP for Galaxy S7 (Exynos) here
Get the TWRP for Galaxy S7 Edge (Exynos) here
Get latest Magisk zip here
Get latest Odin here
Get Encryption Disabler here
1) Go to Settings and enable the Developer Options (Keep
tapping on the ‘Build number’ and you will find the Developer Options visible
under Settings). Now enable “USB Debugging” and "OEM unlocking" if
available
2) Transfer the Magisk zip file, TWRP tar file and the Encryption
Disabler zip file into the SD card
3) Shut down your phone and hold Power button + Home button +
Volume down simultaneously until you see some text on the screen. Now press “Volume
up” button to enter the phone into Download Mode
4) Connect the phone into the PC USB port directly via USB
cable. Avoid USB hubs
5) Open Odin and load the TWRP tar file (****.img.tar) in
the AP section. Disable 'Auto Reboot'. Hit 'Start' button
6) Once you see ‘Done’ or ‘Success’ in Odin, hold the Power +
Home + Volume down buttons and once it leaves the Download Mode, change from
volume down to volume up while holding other buttons
7) Press/Select "keep system read only" in order
to Keep the Safety Net
8) In case you can’t read the internal storage of the phone
(check that by pressing on install and checking internal storage), go to
format-->format data and type yes. It explains there that, by doing so, you
will remove encryption. This will erase the internal memory data.
9) Now tap on ‘Install’ and flash the Encryption Disabler
zip file and then the Magisk zip file.
10) Clear Cache/Dalvik if requested and Reboot. Done!!!