OnePlus 5 Soft Brick I have a OnePlus 5 and it won't boot.
The phone is stuck on black screen and blue led (can't boot) since 20 days and I tried everything I saw on the web to make it boot again. 

I tried :


to flash the recovery with the original one
to flash the Oxygen OS and the Hydrogen OS via fastboot (authorized even with a locked bootloader)
to use MSMDownloadTool (a tool I found on the web, used by the support of OnePlus to reinstall bricked phones.


...but nothing helped. 

I'm now with my OP5 soft bricked but since I used MSMDownloadTool it locked itself (the tool locked the bootloader) and I can't flash again with fastboot (except the official rom but still won't boot) nor adb, I tried fastboot oem unlock but I got an error (because I can't go on the developers options due to the phone not loading) : 
FAILED (remote: Flashing Unlock is not allowed)

If it gets you some info I did :
./fastboot oem device-info
 and got that result :
(bootloader) Verity mode: enforcing
(bootloader) Device unlocked: false
(bootloader) Device critical unlocked: false
(bootloader) Charger screen enabled: true
(bootloader) enable_dm_verity: true
(bootloader) have_console: false
(bootloader) selinux_type: SELINUX_TYPE_INVALID
(bootloader) boot_mode: NORMAL_MODE
(bootloader) kmemleak_detect: false
(bootloader) force_training: 0
(bootloader) mount_tempfs: 0
OKAY [  0.001s]
Finished. Total time: 0.002s

Is there any solution to be sure to write again everything on the OP5 ? (it seems that the MSMDownloadTool and fastboot won't erase everything as the OP5 finishes properly new installation but bootloops every time).

The present state of the OP5: bootloader locked, official recovery working, official rom installed but won't boot.

I'm on mac and windows btw. 

I followed numerous tutorials like this one : 
Unbrick tool OnePlus 5

Thanks in advance.
This will be a good workaround for the situation above. Since you were able to flash the phone, that means the MSNFlashTool is well configured in your computer. Now what I want you to think about is how you can flash a custom recovery image into the phone so that you can even get the phone alive by a third party OS like Lineage and anything. 

After downloading the firmware file and starting flashing, the MSMTool writes the current progress in the progress window writing what it's flashing in the phone. Notably the userdata.img is one of the files you recognize since it is somehow big and doesn't flash quickly. 

Consequently many data partitions exist in the phones memory, like the:


system.img
cache.img
boot.img
recovery.img


These are the essentials in any system, remember these are not all but these are the compulsory in any system. I'm sure the flash file is an archive that you can open with rar. It sometimes can be an archive containing an archive so you have to extract it twice incase you don't see these img files. Once opened in rar take note on what type of archive is the firmware file. It can be:


zip
tar
7z
rar
gz
gzip


And many more other types. Hope you remember this. Look for a compatible custom recovery image like twrp and replace it with the recovery.img or alternatively the boot.img if you miss the recovery in the firmware. If there are checksums like the md5, sha256 or any other sums to verify the integrity of files, regenerate and replace them, then repack the firmware with the same compression type as it was and flash the phone using it and you shall have teamwin recovery as your default recovery or boot. 

Use the recovery to load third party OS and if you get the OS booting use it to unlock bootloader for futher fastboot actions or you can even use the new OS if you're convenient with it

Note: Ensure the recovery image is specifically made for your device model. If you have any trouble finding the appropriate recovery for your specific phone model, I can make you a download link for it after you give me exact specifications of your phone. 

Hope it helps you