Before going to the procedure makes sure that you have a rooted Xperia Z2 or Z2 phone. You can successfully root these two phones on Lollipop 5.0.2 build 23.1.A.1.28 with the help of KingRoot application. Just follow the given link to do so.
Root Xperia Z2/Z3 Lollipop 5.1.1 Build 23.4.A.1.232
Before going to the procedure you have to download the required pre-rooted ZIP file for your phone. Dual Recovery is already included in these files.
- Flashable zip of 23.4.A.1.232 for D6502 (1.28 GB) One Drive
- Flashable zip of 23.4.A.1.232 for D6503 (1.29 GB) Google Drive | One Drive
Procedure to Flash these files
1) Download your required ZIP file according to your device model and place that file on your external SD card or internal memory and remember the path. External storage would be better for security.
2) Boot the phone into Recovery mode using NDR Utils or by pressing the volume down button on boot. (The complete procedure is given in the previous article)
3) Flash the pre-rooted zip using TWRP.
4) Wipe Dalvik/ART Cache and reboot your phone. That’s it.
In this way, you can easily root Xperia Z2/Z3 Lollipop 5.1.1 Build 23.4.A.1.232. I have a D6502 model, the only problem in this ROM is, the default messaging app is not able to send a message. You can use Hangout instead of Message app to send a message.