This is my step/procedure to ROOT and repair your firmware. I hope it will help you. I COMPILE IT FOR EASY UNDERSTANDING. DO AT YOU OWN RISK.
I ASSUME YOUR DEVICE IS C5303
There is several way how to repair your firmware
Go to setting>Backup and reset>Factory data reset [Internal data loss will happen]
Dial *#*#7378423#*#*. Go to customization setting. You can factory default or reset. [Internal data loss will happen]
1. Use flashtool and here the link to download the latest http://www.flashtool.net/download.php
2. Download firmware https://mega.co.nz/#!8AJhGDIS!YSYbbE...prt07UEaiZRxHU
This is Android 4.1.2 Jelly Bean 12.0.A.2.254_CE or you can get latest firmware at
3. Install flash tool (don’t change file/folder destination) and it driver (go to c>flashtool>drivers) tick all to be safe. For windows 8 go here ( http://forum.xda-developers.com/show....php?t=2095087
) to install driver.
4. Place download firmware in the firmware folder (go to c > flashtool > firmwares)
5. After you get all the flash tool and firmware. Now you are ready to install firmware. Open flashtool according to your pc (x32 or x64).
6. Click the thunder icon.
7. Tick flashmode.
8. Choose the firmware you download.
9. Click flash. Remember all the menu on the right you must not disturb unless you are advanced user.
10. Turn off the phone. Connect usb to the pc. Hold the volume down without let it go. Connect the other side of the usb to the phone while holding the volume down button. Then let it go after you see some progress in the flash tool.
11. Now your phone is back to default.
Let root your phone
Go to this link to root http://forum.xda-developers.com/show....php?t=2405933
. This only for 12.0.A.2.245 / 254 firmware.
Go to this link to install latest recovery http://forum.xda-developers.com/show....php?t=2649923
. These recovery is needed to install any custom locked bootloader rom.
Now you have root phone. If you want to install custom rom please go to these link http://forum.xda-developers.com/xperia-sp/development
PLEASE REMEMBER DO NOT FLASH UNLOCKED BOOTLOADER ROM AND ITS KERNAL SINCE YOUR PHONE STILL NOT UNLOCKED.
CREDIT TO ~DOOMLORD~neroyoung~mrjraider~dssmex~ FOR MAKE MY LIFE EASIER
HIT THANK BUTTON IF IT HELP YOU AND SORRY FOR MY BAD ENGLISH.