The below is what's required for 4.4.2 and below, if you've upgraded to 4.4.4, you can root without downgrading by using this: http://forum.xda-developers.com/showthread.php?t=2784900
I know this looks a lot, but most of the work is done for you by flashtool and the various 1-click programs available.
None of this is my own btw, I've just collated info from other people in to one place and made an easy to follow (hopefully) guide.
---------------------------------
Unfortunately, the only 3 firmware versions that can be rooted are 14.1.G.1.518, 14.1.G.1.526 & 14.1.G.1.534 meaning that if you're looking for root and running .257 or have upgraded to Android 4.3 or 4.4, you're going to need to downgrade to obtain it.
This also means that if you want to run anything other than these 3 firmware versions and be rooted, you need to run a custom ROM.
It looks like a fairly lengthy process, but if you know your way around Android and have rooted or used flashtool before, it can actually be done in less than half an hour. If it's your first time, it's probably best to set aside a full hour, just in case you get stuck.
Before you start all this, disable any Sony Software on your PC, namely PC Companion and SEUS.
Worth noting that the ftf files & the ROM.zip mentioned are for the C6903. The process is the same for the other variants, just make sure you download the correct files before you proceed.
----------------------------------------------------------
Downgrading
Firstly, you'll need the excellent Flashtool, by Androxyde, you can get that here: Download | Flashtool
Then you'll need to download a 518, 526 or 534 ftf file from here: [FTF] C6902 & C6903 & C6906 & C6943 FTF Mega Collection - xda-developers
Once downloaded and flashtool has been installed, move the ftf file to C:\FlashTool\Firmware\ and reboot.
In order to flash the file, turn your handset off, open Flashtool and hit the flash icon in the top left corner of the window. You'll be asked if you want to run in Flashmode or Fastboot mode, select Flashmode. You should then be taken to a screen which looks like this:
You want to wipe everything and exclude nothing.
To proceed click "flash" and you'll get a prompt to connect your device in flashmode. With the phone still turned off, connect it to your PC whilst holding Volume Down.
Let the flash proceed and disconnect and turn the phone back on when Flashtool asks you to do so.
There is a high probability that your device won't pick up a cellular signal when it's turned back on. This is fine as when we flash the ROM, everything will go back to normal.
Once downgraded, you can root.
----------------------------------------------------------
Rooting
Head to Settings -> About Phone -> Build Number (Tap this 7 times). You should now get a toast letting you know you're a developer. If you head back to settings, you'll see something called Developer Options, go in to that submenu and activate USB Debugging.
Download and install Kingo on your PC: http://www.kingoapp.com/
Reboot both your phone and PC (this might not be needed, but whenever I have problems with Kingo, rebooting PC & Phone sorts it), run Kingo and follow the on screen instructions. Your phone will reboot again and it should hopefully now be rooted.
----------------------------------------------------------
Installing a Custom Recovery
In order to install the custom ROM, you'll first need to install something called a custom recovery. In very basic terms, this is a piece of software you boot in to before the phone boots to the OS so you can install the ROM.
Head here: http://forum.xda-developers.com/showthread.php?t=2261606
On that page, there's a download link for the recovery: http://nut.xperia-files.com/
There's a lot there, but the file you're looking for should be called Z1-lockeddualrecoveryX.X.XXX-BETA.installer.zip, replacing the X's with numbers. Look for the latest version which is currently Z1-lockeddualrecovery2.7.121-BETA.installer.zip.
Download the zip file and extract it somewhere on your PC.
Once done, connect the phone to your PC, navigate to the recovery folder using Windows explorer and run the install batch file. It will ask you which SuperUser app you have installed, if you've used Kingo, it should be SuperSU, but you can check by looking in the app drawer on your phone. Select the relevant option, follow the on screen prompts and let it do it's thing. Your phone should reboot, when it does, you should be taken to TWRP Recovery.
In recovery, select Reboot -> System and you'll boot back in to Android.
To boot back in to recovery, turn the phone off and turn it on again. When you see the Sony Logo, as soon the device vibrates, hold the volume down button until the LED turns purple and you'll boot back to TWRP. Alternatively, download NDR Utils from the Play store and use that to boot into recovery from your phone.
https://play.google.com/store/apps/details?id=com.camber.ndrutils
One important thing to note, do not under any circumstances, install Busybox, or any app that has the potential to update busybox as this will wipe the recovery and you'll need to start over from scratch.
----------------------------------------------------------
Installing the ROM
You're nearly there! This bit is a little bit more involved than rest of the process, but it's not that difficult, especially if you're used to navigating round recoveries and flashing ROM's etc.
First up, you'll need to select the ROM you want to run. For simplicities sake, I'll choose a simple stock based ROM with some bloat removed and root access.
Some say you can go from 4.2.2 to 4.4.2, but the instructions for the 4.4.2 ROM I use say I have to update to 4.3 first,so I'd follow the devs instructions (it's what I did and I have no problems).
Head here: http://forum.xda-developers.com/showthread.php?t=2572988
I've had it confirmed by the dev, that it is safe to go straight to 4.4.2, from 4.2.2 without going to 4.3 first, the thread you want is here: http://forum.xda-developers.com/showthread.php?t=2687443
If you're using the C6903 variant of the Z1, you'll need to download these files: C6903: Download C6903_14.3.A.0.681.flashable.zip (Bittorrent: 934MB) and C6903_14.3.A.0.681_Stripped.ftf
Once downloaded, copy the flashable zip to the root of your phones external SD Card and place the ftf file in the flashtool firmwares folder you made earlier.
Reboot into recovery and head to Install and select install zip from SD Card, you're not going to flash anything yet, you just want to make sure you can see the zip file you put on your SD Card earlier.
Head back to the main menu and go to backup, then backup your current ROM. Probably worth making sure you're using the external SD Card as the location of the backup, you can check this on the backup screen (it's the bottom option).
Backing up will take about 5 minutes, once completed, head back to the main TWRP screen.
Then head to Wipe -> Advanced Wipe and check the Dalvik, System, Data & Cache options and wipe by swiping the bar on the bottom of the screen.
Once done, head back to the main TWRP menu, then select install zip from SD Card and choose the flashable zip file you copied over earlier. Let it do what it needs to do, head back to the main screen in TWRP and select Reboot -> Power Off (that bit is very, very important).
This next bit is probably the riskiest part of the process, read here for more info: http://forum.xda-developers.com/showthread.php?t=2574764
Go back to your PC, open flashtool, hit the flash icon, flashmode, exclude NOTHING in the stripped ftf file and wipe nothing (making sure all elements of the ftf file is flashed, is very, very important. If you miss anything, you will probably end up with an expensive paperweight). Whilst it is turned off, connect the phone to your PC whilst holding Volume Down to enter flashmode and let flashtool do it's thing.
Once it's done, flashtool will tell you you can disconnect your phone and reboot.
If nothing happens, you'll need to give Sony/your network a call, but hopefully you should boot in to a fully rooted Android 4.4.2!
If you've any questions, I'll be more than happy to help.
I know this looks a lot, but most of the work is done for you by flashtool and the various 1-click programs available.
None of this is my own btw, I've just collated info from other people in to one place and made an easy to follow (hopefully) guide.
---------------------------------
Unfortunately, the only 3 firmware versions that can be rooted are 14.1.G.1.518, 14.1.G.1.526 & 14.1.G.1.534 meaning that if you're looking for root and running .257 or have upgraded to Android 4.3 or 4.4, you're going to need to downgrade to obtain it.
This also means that if you want to run anything other than these 3 firmware versions and be rooted, you need to run a custom ROM.
It looks like a fairly lengthy process, but if you know your way around Android and have rooted or used flashtool before, it can actually be done in less than half an hour. If it's your first time, it's probably best to set aside a full hour, just in case you get stuck.
Before you start all this, disable any Sony Software on your PC, namely PC Companion and SEUS.
Worth noting that the ftf files & the ROM.zip mentioned are for the C6903. The process is the same for the other variants, just make sure you download the correct files before you proceed.
----------------------------------------------------------
Downgrading
Firstly, you'll need the excellent Flashtool, by Androxyde, you can get that here: Download | Flashtool
Then you'll need to download a 518, 526 or 534 ftf file from here: [FTF] C6902 & C6903 & C6906 & C6943 FTF Mega Collection - xda-developers
Once downloaded and flashtool has been installed, move the ftf file to C:\FlashTool\Firmware\ and reboot.
In order to flash the file, turn your handset off, open Flashtool and hit the flash icon in the top left corner of the window. You'll be asked if you want to run in Flashmode or Fastboot mode, select Flashmode. You should then be taken to a screen which looks like this:
You want to wipe everything and exclude nothing.
To proceed click "flash" and you'll get a prompt to connect your device in flashmode. With the phone still turned off, connect it to your PC whilst holding Volume Down.
Let the flash proceed and disconnect and turn the phone back on when Flashtool asks you to do so.
There is a high probability that your device won't pick up a cellular signal when it's turned back on. This is fine as when we flash the ROM, everything will go back to normal.
Once downgraded, you can root.
----------------------------------------------------------
Rooting
Head to Settings -> About Phone -> Build Number (Tap this 7 times). You should now get a toast letting you know you're a developer. If you head back to settings, you'll see something called Developer Options, go in to that submenu and activate USB Debugging.
Download and install Kingo on your PC: http://www.kingoapp.com/
Reboot both your phone and PC (this might not be needed, but whenever I have problems with Kingo, rebooting PC & Phone sorts it), run Kingo and follow the on screen instructions. Your phone will reboot again and it should hopefully now be rooted.
----------------------------------------------------------
Installing a Custom Recovery
In order to install the custom ROM, you'll first need to install something called a custom recovery. In very basic terms, this is a piece of software you boot in to before the phone boots to the OS so you can install the ROM.
Head here: http://forum.xda-developers.com/showthread.php?t=2261606
On that page, there's a download link for the recovery: http://nut.xperia-files.com/
There's a lot there, but the file you're looking for should be called Z1-lockeddualrecoveryX.X.XXX-BETA.installer.zip, replacing the X's with numbers. Look for the latest version which is currently Z1-lockeddualrecovery2.7.121-BETA.installer.zip.
Download the zip file and extract it somewhere on your PC.
Once done, connect the phone to your PC, navigate to the recovery folder using Windows explorer and run the install batch file. It will ask you which SuperUser app you have installed, if you've used Kingo, it should be SuperSU, but you can check by looking in the app drawer on your phone. Select the relevant option, follow the on screen prompts and let it do it's thing. Your phone should reboot, when it does, you should be taken to TWRP Recovery.
In recovery, select Reboot -> System and you'll boot back in to Android.
To boot back in to recovery, turn the phone off and turn it on again. When you see the Sony Logo, as soon the device vibrates, hold the volume down button until the LED turns purple and you'll boot back to TWRP. Alternatively, download NDR Utils from the Play store and use that to boot into recovery from your phone.
https://play.google.com/store/apps/details?id=com.camber.ndrutils
One important thing to note, do not under any circumstances, install Busybox, or any app that has the potential to update busybox as this will wipe the recovery and you'll need to start over from scratch.
----------------------------------------------------------
Installing the ROM
You're nearly there! This bit is a little bit more involved than rest of the process, but it's not that difficult, especially if you're used to navigating round recoveries and flashing ROM's etc.
First up, you'll need to select the ROM you want to run. For simplicities sake, I'll choose a simple stock based ROM with some bloat removed and root access.
Some say you can go from 4.2.2 to 4.4.2, but the instructions for the 4.4.2 ROM I use say I have to update to 4.3 first,
Head here: http://forum.xda-developers.com/showthread.php?t=2572988
I've had it confirmed by the dev, that it is safe to go straight to 4.4.2, from 4.2.2 without going to 4.3 first, the thread you want is here: http://forum.xda-developers.com/showthread.php?t=2687443
If you're using the C6903 variant of the Z1, you'll need to download these files: C6903: Download C6903_14.3.A.0.681.flashable.zip (Bittorrent: 934MB) and C6903_14.3.A.0.681_Stripped.ftf
Once downloaded, copy the flashable zip to the root of your phones external SD Card and place the ftf file in the flashtool firmwares folder you made earlier.
Reboot into recovery and head to Install and select install zip from SD Card, you're not going to flash anything yet, you just want to make sure you can see the zip file you put on your SD Card earlier.
Head back to the main menu and go to backup, then backup your current ROM. Probably worth making sure you're using the external SD Card as the location of the backup, you can check this on the backup screen (it's the bottom option).
Backing up will take about 5 minutes, once completed, head back to the main TWRP screen.
Then head to Wipe -> Advanced Wipe and check the Dalvik, System, Data & Cache options and wipe by swiping the bar on the bottom of the screen.
Once done, head back to the main TWRP menu, then select install zip from SD Card and choose the flashable zip file you copied over earlier. Let it do what it needs to do, head back to the main screen in TWRP and select Reboot -> Power Off (that bit is very, very important).
This next bit is probably the riskiest part of the process, read here for more info: http://forum.xda-developers.com/showthread.php?t=2574764
Go back to your PC, open flashtool, hit the flash icon, flashmode, exclude NOTHING in the stripped ftf file and wipe nothing (making sure all elements of the ftf file is flashed, is very, very important. If you miss anything, you will probably end up with an expensive paperweight). Whilst it is turned off, connect the phone to your PC whilst holding Volume Down to enter flashmode and let flashtool do it's thing.
Once it's done, flashtool will tell you you can disconnect your phone and reboot.
If nothing happens, you'll need to give Sony/your network a call, but hopefully you should boot in to a fully rooted Android 4.4.2!
If you've any questions, I'll be more than happy to help.