[Xperia SP General] quetzalcoatl2435:
Since every "best way to root stock 4.3" guide for LB in this forum involves flashing a deodexed ROM from a region that might not be yours and taken from someone's phone that might be different from yours, I've decided to make this guide which will (I hope) help you make YOUR OWN pre-rooted flashable zip using YOUR OWN phone and an FTF for YOUR OWN region.

Just a mandatory precaution: I'm not responsible for whatever happens to you, your phone, your family, your house, your dog, your car, etc resulting from the use of this guide.

Here goes.

What's needed:

==========================

1. Your SONY Xperia SP running a rooted stock ROM. You might need to downgrade to 4.1.2 and root that.

2. A recovery. See: http://xdaforums.com/showthread.php?t=2649923 (Note: I only use CWM. I have not tried Philz or TWRP.)

3. SONY PC Companion

4. Flashtool

5. su + busybox binaries

6. META-INF

7. SuperSU

8. Stock .266 kernel. You could make this yourself, but for the sake of simplicity, just use this one instead.

8b. Stock .201 kernel.

9. (Optional) be2_album for Bravia Engine fix.

The good part:

=====================

1. Follow this guide to download and make your own FTF file. This file will contain the stock firmware for your own phone and region.

2. Then follow this guide to extract the system folder, but stop at step 9.

3. Navigate to the "bin" folder inside the system folder you just extracted and delete anything that's <10 bytes in size. Those are symlinks which will be recreated automatically in the flashing process. (Ignore this step if there are no files smaller than 10 bytes. Anything larger than 100 bytes should NOT be deleted.)

4. Extract the META-INF.zip file you downloaded above and copy the META-INF Folder in the folder alongside the system folder.

5. You should now have 2 folders, META-INF and system.

6. Extract the su + busybox binaries and put them in system/xbin.

6b. (Optional) Extract be2_album and put it in /system/etc.

7. Zip the two folders (META-INF and system) using store only (no compression).

8. Congrats, you just made your own pre-rooted pure stock ROM. Copy this zip and SuperSU into your sd card and we're good to go.

How to flash:

================

This might sound familiar, because this part is the same as the other guides.

1. Boot into CWM.

2. Clear dalvik cache and wipe cache. (Optional: wipe data)

3. Flash the zip you just made.

4. Flash SuperSU.

5. Power off.

6. Flash kernel using flashtool.

7. Boot up your phone and enjoy (or not) using a ROOTED STOCK firmware that was meant for YOUR phone and not for someone else's phone in another country on the other side of the world.

8. (Optional) If you get a reboot when remounting (e.g. when using Foldermount), apply this fix.

As a side note: Memory management is kinda crappy on 4.3. Dropping dalvik.vm.heapgrowthlimit to 64m and dalvik.vm.heapsize to 96m helps somewhat, but YMMV. Please experiment on your own to find a limit that works best for you.

This guide will (in theory) work for ANY future official release as long as the partitions stay the same. I hope this will at least reduce the nagging the devs (especially DoomLord) gets for a root exploit for stock 4.3. :p