[Xperia SP Original Android Development] Tossox:
Use this steps:

1. Flash firmware again

a) Download Flashtool (you can download from here but remember to download the version 0.9.18.6)

b) Before you start Flashtool go to the installed directory and go to drivers folder and install drivers

* In this setup select Common drivers for Viskan board; Flashmode drivers ; Fastboot Drivers

* If you're using Windows 10,8,8.1 before install drivers you must open CMD as admin (type CMD in start menu, right click and open as admin) and type this commands:

bcdedit -set loadoptions DISABLE_INTEGRITY_CHECKS Press ENTER

bcdedit -set TESTSIGNING ON

Reboot PC, install drivers then open CMD as admin again and type this commands:

bcdedit -set loadoptions ENABLE_INTEGRITY_CHECKS Press ENTER

bcdedit -set TESTSIGNING OFF

Reboot PC again

c) Open the flashtool then after syncing devices click on black and white XF button and XperiFirm should open. on the left, select Xperia SP and you model. Over the latest Firmware select check all and select Firmware with ending .205 (I'm using Central Europe 5). On the right side select you firmware and click Download. After downloading, close XperiFirm.

d) After unpacking the firmware, connect your device to the computer in Flashmode mode (you connect the phone to the computer while holding the volume down button). When windows installs the drivers, disconnect phone from PC. You can start flashing.

e) Click on lightning button, select Flashmode then mark you Firmware and click Flash. Connect phone in Flashmode and wait.

f) When done, turn on the device and if works XD, you can go to the next step.

2. Go to this thread and download from development downloads section twrp-3.x.x-x-boot-huashan.img and twrp-3.x.x-x-fota-huashan.zip(latest version).

3. In Flashtool go to Fastboot Toolbox (select lightning button and select Fastboot mode) and connect you phone to PC in Fastboot mode (holding the volume+ button, connect the phone to the PC).

4. Click on Check Current Device Status and if will be in the console Device Status: Fastboot mode click Select kernel to Flash and select twrp-3.x.x-x-boot-huashan.img

5. When finished, disconnect the phone and turn it on. Should run in TWRP.

6. Now from the hill.

a) Download latest AOSP image from this thread.

b) Download latest gapps if you want. AdrianDC recommend to use OpenGapps micro 8.0 and edit file in zip to work on 8.1 rom but i'm using this gapps pico and everything works fine.

c) Download latest Magisk from here and Bootbridge from here. Rename Magisk zip file into install.zip. Use 7-zip or other archive manager and open Bootbridge zip, open install folder and put Magisk install.zip here and confirm the prompt to replace the file.

b) Download Magisk Safetynet fix here if you want to pass Safetynet with Magisk.

7. In TWRP select Wipe and Advanced Wipe. Mark Dalvik / ART Cache ; System ; Cache ; Data ; Internal Storage and Swipe to Wipe.

8. Now change Filesystem to F2FS. In Advanced Wipe select Cache and click on Repair or Change File System -> F2FS. Do the same with Data. Remember, if you do, you will lose all files in the phone's internal memory (/ sdcard)!

9. Connect phone to PC in TWRP and Copy all zips (you should have 5 zip: ROM ; Gapps ; Bootbridge with Magisk ; Safetynet fix module ; twrp-3.x.x-x-fota-huashan.zip) to phone.

10. Flash the ZIPs in this order:

- twrp-3.x.x-x-fota-huashan.zip

- Rom

- Gapps

- Bootbridge with magisk

- Safetynet fix if you want

11. After install last zip wipe Dalvik cache and cache (you have this option after zip install).

12. Reboot to system

13. In the configuration wizard ignore all Force Closes (FC) and try to end wizard. Do not connect to wifi or something, skip all. When you are on the desktop I can congratulate you :D

I wasted 2 hours of my life for write this. If someone will not know how to flash this system or will have some problems send her back here :)