TO UNLOCK THE BOOTLOADER
1.GO TO SONY WEBSITE AND GET UR "UNLOCK CODE"
2.GO TO PHONE SETTINGS>ABOUT DEVICE>STATUS >SERIAL NO.
3.create a folder with the name of your SERIAL NUMBER AND PUT THE ulcode file within it
now create a text file with name "ulcode" now enter the UNLOCK CODE within this "ulcode" file
now go c/user/<ur name>/flashtool/mydevice and folder named "registered devices"
and PASTE THE "folder with serial no." within both these folders
now open flastool> click on BLU option>connect ur phone as instructed...
voila...bootloader unlocks.......DISCONNECT AND RESTART UR PHONE.
NOTE :- MY PERSONAL ADVISE ,U MUST VISIT & Read THIS POST
BEFORE UNLOCKING
THE BOOTLOADER ......
https://xdaforums.com/xperia-z4/general/guide-safe-bootloader-unlock-restore-t3386915