How to flash and root OnePlus 3T on Linux? I Recently bought a OnePlus 3T and want to flash and root it.

Most resource focus on OnePlus3 and on Windows.

How do I do that on Linux?
Gather the steps in a gist.



How to flash and root OnePlus 3T on Linux

Update


2017-jan-05:


fix SuperSU with  no-verity-opt-encrypt-5.0.zip and SR5-SuperSU-v2.78-SR5-20161130091551.zip² ;



Requirements


  Disclaimer: I've already done those kind of install on different phones and I'm familiar with the steps. So be sure to read the resources to get an understanding of what happens.



[ ] battery are &gt;60% ;
[ ] know what you are doing?
[ ] remember that version used worked for me.


Screenshots are not mine, thanks to their author.

Flashing Recovery to TWRP


  Flashing require to do a factory reset. Backup your data.


Prepare Phone


enable Developer Options


in Settings -> About Phone -> Build Number (at the bottom)
by tap on it for 5-7 times to enable Developer Options

enable USB Debugging


in Settings -> Developer Options -> USB Debugging.

enable OEM Unlocking (in the same list).

developer-options http://cdn3.freeandroidroot.com/wp-content/uploads/2016/11/Enable-OEM-Unlock-USB-Debugging.jpg
Install adb and fastboot tooling:

sudo apt-get install android-tools-adb android-tools-fastboot

Reboot to bootloader either with adb reboot bootloader or through power button ;
Unlock the bootloader:

sudo fastboot oem unlock

Flash the recovery with TWRP:

sudo fastboot flash recovery twrp-3.0.3-0-oneplus3t.img

Reboot to recovery to wipe cache ;
Reboot to recovery to mount the device ;
Download SuperSU and no-verity-opt-encrypt-5.0.zip


SR5-SuperSU-v2.78-SR5-20161130091551.zip (the 2.79² didn't worked for me) ;
no-verity-opt-encrypt-5.0.zip (dm-verity and forced encryption disabler).

Copy to your smartphone Internal Storage directory (using nautilus or nemo¹) ;
install both of them with TWRP ;
reboot and enjoy!


Root


  The rooting procedure given here is not a data-loss process but it won’t hurt to have a backup of your smartphone’s personal data.
  
  source


Resources


How To Flash TWRP Recovery And Root OnePlus 3T - freeandroidroot ;
How to root opt using Linux - forums.oneplus.net ;
OnePlus 3T: How to Unlock Bootloader | Flash TWRP | Root - devs-lab.com ;
Direct link to working version of SR5-SuperSU-v2.78-SR5-20161130091551.zip - download.chainfire.eu.
Direct link to no-verity-opt-encrypt-5.0.zip - build.nethunter.com.


Footnote


¹: I didn't manage to access my smartphone storage with Dolphin ; 
²: SR1-SuperSU-v2.79-SR1-20161221223537 didn't work for me.