Smartphone giant makes flashing tool for its android smartphones but this tool only work with xperia series by sony. Xperia flashtool will help you to restore to factory rom if you flash any custom rom. To use this flashtool your xperia phone’s bootloader must be unlocked otherwise it may not work.
Download EMMA Sony Xperia Flashtool for Android
Supported OS : Windows XP / Windows 7 / Windows 8 / Windows 8.1 / Windows 10 bother 32 and 64 bit