[Samsung Galaxy S8 & S8+ Cross Device Development] jesec:
Guides:

Notice: It may wipe all your data including those in internal storage.

Pre - HOW-TO PREPARE FOR FLASH: (Chinese/HK variants)

SPECIAL NOTE: These variants do NOT have "OEM Unlock" option and you don't need to enable it. Only reactivation (Samsung Account) lock needs to be disabled.

1. On your phone, open Settings, go to "Cloud and Accounts" -> "Accounts".

2. Select your Samsung account, open menu, remove account. (That will make sure reactivation lock is disabled. Alternatively you can disable reactivation lock without delete your Samsung account. Result should be same. )

3. Download, install and run official unlock tool, CROM service.

4. Your phone is unlocked and ready to flash TWRP at this stage. Now you can proceed to part 1.

Part 1 - HOW-TO FLASH TWRP:

1. Download and Install Samsung Mobile Phones Drivers.

- Option 1: Download and Install Smart Switch for PC.

- Option 2: Download and Install standalone driver package.

2. Download and extract Odin (Samsung's Flash Tool) to your computer.

3. Download a .tar image of TWRP.

4. Reboot your device to download mode.

- Hold [VOLUME DOWN] + [BIXBY] + [POWER] for approx. 15 seconds.

- Read the warning carefully.

- If you agree, press [VOLUME UP] to get into Download mode. If you don't agree, STOP.

5. Open Odin and place that TWRP tar file in the [AP] slot.

6. Connect your phone.

7. Hold [VOLUME UP] + [BIXBY] + [POWER] on your phone and then press start on Odin.

8. Wait for the phone to reboot. DO NOT release [VOLUME UP] + [BIXBY] + [POWER] or you may not reboot into TWRP.

Part 2 - HOW-TO INITIALIZE TWRP: (for new phones)

1. If you completed Part 1 successfully, you should be in TWRP now. At this point, you will reach the screen asking you if you want to allow system modifications.

2. Select "Keep /system RO". (Don't swipe right or you may not be able to boot into system if you failed to complete next steps. However, you can swipe right to allow modifications if you are confident that you can complete next steps.)

3. Go to "Wipe" menu of TWRP and you will find "Format Data". Press "Format Data" and type "yes" to continue.

4. Go to "Reboot" menu and Press "Recovery" to reboot TWRP.

AT THIS STEP YOU CAN DIRECTLY GO TO PART 3 OF THIS GUIDE IF YOU WANT TO ROOT.

5. Download the latest dm-verity and force encryption disabler zip on your computer.

6. Transfer the zip to your phone.

- Option 1: MTP: Connect your phone with computer and just copy the zip to internal storage. (similar to how you transfer files when in system.)

- Option 2: ADB: Connect your phone with computer and run command "adb push /path/to/zip /sdcard/".

- Option 3: External SD: Copy the zip to an external SD and then insert the card to your phone.

7. Go to "Install" menu of TWRP and flash the zip.

TWRP is initialized and fully functional at this stage. Now you can either reboot into system or root, flash custom ROMs, Kernels via TWRP.

Part 3 - HOW-TO ROOT:

Note: Additional security layers implemented by Samsung make it impossible to get root access with a modified stock kernel. Thus, a custom kernel with security features disabled is MANDATORY.

1. Download a custom kernel with security features disabled.

- Reference: https://xdaforums.com/galaxy-s8/samsung-galaxy-s8--s8-cross-device-development/kernel-jesse-s-kernel-galaxy-s8-s8-t3637640

1. Download the root package.

- Option 1: Magisk

- Option 2: SuperSU (untested)

2. Transfer the zips to your phone.

3. Flash the kernel.

4. Flash the root package.