[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] toto4c19:
Hi everyone, I having finally completed my dump guide. It should be easier for people to rooting, rescuing/flashing and master up your device.

This guide is just for your information and I am not responsible for any bricked device.

All of the mentioned materials (firmware, Magisk module, EdXposed module) are not my work. I am just here for testing

This guide is assuming you have a "healthy" (Full functioning) or "fresh" Sony Xperia XZ3. It is also be used as a reference for other Sony Xperia devices on Android 10.

- For recovery bootloop, please go to step 2.a.

- If for any reasons the device is bricked or not working, please go to step X.

- This guide won't include switching SELinux to permissive (installing permissive.zip) since normally you won't need it unless you want adb insecure for some reason.

Steps:

0. Make sure driver is installed for Sony Xperia XZ3 and adb driver is installed (or ready).

0.1. Sony Xperia XZ3 driver is available on Sony Official website. Just search on google “Sony Xperia XZ3 driver”.

0.2. adb driver is available from Google officially. Just search on google “Android adb driver”.

1. OEM unlcok

1.1. Update to the newest stock firmware before OEM unlocking. The latest firmware for Sony Xperia XZ3 H9493 Customized HK should be 52.1.A.3.92.

1.2. Search “Xperia OEM unlock” on Google and go to Sony official developer site for OEM unlock.

1.3. For Sony Xperia XZ3, go into Settings > About phone and tap seven times on Build number to enable developer options.

1.4. From Settings, go into Developer options and enable OEM unlocking and enable USB debug.

1.5. Open phone dialer and enter *#*#7378423#*#* to access the service menu.

1.6. Go to Service info > Configuration > Rooting Status. If Bootloader unlock allowed says Yes, then you can continue with the next step. If it says No, or if the status is missing, your device cannot be unlocked.

1.7. Submitting the device IMEI to IMEI required OEM unlock procedure and note down the unlock code

1.8. Go to adb folder (platform tool) of the PC. In the folder blank space, Shift + Right Click, open command prompt here

1.9. Put in "adb reboot fastboot" and hit Enter. The device should reboot to fastboot with blue LED light.

1.10. Once it gets to fastboot mode, PC should detect the Sony Xperia XZ3 as an Android device. If driver not found or missing, install it manually. S1 fastboot driver from Flashtool is not recommeneded since it is not signed.

1.10.0. Search 'android_winbus.inf' on google and download the adb driver.

1.10.1. Go to Device Manager, right click on the unknown device and select 'Update Driver Software...' (1st option).

1.10.2. Select 'Browse my computer for drivers' (2nd option)

1.10.3. Select 'Let me pick from a list of device drivers on my computer' (2nd option)

1.10.4. Select 'Show all driver' (1st option)

1.10.5. Select 'Have Disk...'

1.10.6. Browse for the downloaded 'android_winbus.inf' and select Next

1.10.7. Wait for the driver to be installed

1.11. On command prompt opened in step 1.8., put in "fastboot devices" and hit Enter. If the driver is correctly installed and the device is connected, the device number should be shown following with 'fastboot'

1.12. Perform OEM unlock by putting in "fastboot oem unlock 0x<insert your unlock code>" and hit Enter

1.13. OEM unlock should be executed with OKAY [ <time>], finished. total time: <time>.

1.14. After unlock, restart the Xperia XZ3 by putting in "fastboot reboot" and hit Enter

1.15. The Xperia XZ3 should be restarted. It should take longer than usual for the restart and should not be commissioned.

1.16. Commission the device and go into Settings > About phone and tap seven times on Build number to enable developer options

1.17. From Settings, go into Developer options and check whether OEM is unlocked and enable USB debug.

2. Install TWRP

2.0.1. Download the TWRP file for Sony Xperia XZ3 and unzip the *.gz files with https://7-zip.org/ or Linux. The device name for Sony Xperia XZ3 is akatsuki.

2.0.2. Copy 'twrp-akatsuki.img' to an external SD card and insert to the device

2.1. Enter fastboot via software, not hardware buttons for the Sony Xperia XZ3. Connect the Sony Xperia XZ3 to the PC. Go to adb folder (platform tool) of the PC. In the folder blank space, Shift + Right Click, open command prompt here. Put in "adb reboot fastboot" and hit Enter. The Sony Xperia XZ3 should reboot to fastboot with blue LED light.

2.2. For the command prompt, put in "fastboot devices" and hit Enter. If the driver is correctly installed and the device is connected, the device number should be shown following with 'fastboot'. If not and having driver issue, go back to step 1.9 for installing driver.

2.3. Copy 'vbmeta.img' to adb folder (platform tool), where the directory used for command prompt.

2.4. Flash vbmeta by putting in "fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img". If error occur, saying --disable-verity command not found, the adb version is too old, install latest adb and fastboot from Google. Then go back to step 2.2.

2.5. Temperately boot the Sony Xperia XZ3 to twrp by putting in "fastboot boot twrp-akatsuki.img" and hit Enter

2.6. For the Sony Xperia XZ3, install recovery ramdisk by going to Advanced menu -> "Install recovery ramdisk" -> Find the correct path with the "twrp-akatsuki.img" -> Choose "twrp-akatsuki.img" -> do select "back up existing image first" if possible (I tested, won't work) -> Swipe to install

2.7. Reboot into recovery, the Sony Xperia XZ3 should reboot to installed TWRP

2.8. Reboot into system, the Sony Xperia XZ3 should reboot to system

2.a. If the Sony Xperia XZ3 doesn't boot to system anymore

2.a.1. Fix recovery bootloop using installed TWRP

2.a.1.1. Reboot into installed TWRP

2.a.1.2. Fix recovery bootloop by going to Advanced menu -> "Fix recovery bootloop"

2.a.2. If fixing recovery bootloop using installed TWRP not working, go to step 3 and install Magisk

2.a.3. If fixing recovery bootloop by installing Magisk not working, go back to step 2.a.1. and try again

2.a.4. If the bootloop issue is still not being fixed after going step 2.a.3., go back to step 2.1., follow the step till step 2.7.

2.a.5. If bootloop issue is still not being fixed, CONGRATUATION, your device is soft bricked. Smile and go to step X

3. Install Magisk

3.1. Download Magisk V23.0 Magisk Manager apk, change the extension from .apk to .zip (Magisk-v23.0.zip as default) and put to an external SD card. The reason of not using the latest magisk (V24.1 20220215) is because tested with the latest V24.1 that:

3.1.i. It has no online package search and installation features and you can only install package locally which is annoying.

3.1.ii. Magisk ExSDCard Access Enable module can't be installed

3.a.1. If unable to install TWRP as recovery ramdisk due to bootloop, temperately boot to TWRP by ONLY following step 2.1., 2.2. AND 2.5

3.a.2. Install magisk by selecting the V23.0 Magisk Manager .zip

3.b.1. If able to install TWRP as recovery ramdisk, boot to recovery by going to adb folder (platform tool) of the PC. In the folder blank space, Shift + Right Click, open command prompt here. Put in “adb reboot recovery” and hit Enter. The device should reboot to TWRP

3.b.2. Install magisk by selecting the V23.0 Magisk Manager .zip

3.2. Reboot the Sony Xperia XZ3 to system, open magisk and finish installation

From Step 4 to Step 10, everything should just be based on the Sony Xperia XZ3 and PC shouldn’t be needed.

4. Install EdXposed framework

4.1. Download Riru V25.4.4 Magisk zip module (riru-v25.4.4-debug.zip) and put to an external SD card. Tested with the latest Riru (V26.1.4 20220215), it can't be detected by Riru - EdXposed V0.5.2.2.

4.2. Download Riru - EdXposed V0.5.2.2. Magisk zip module (EdXposed-v0.5.2.2_4683-master-release.zip) and put to an external SD card.

4.3. Download the latest EdXposedMaganer apk and put to an external SD card.

4.3. Go to Magisk "Module" and install Riru V25.4.4 Magisk zip module (riru-v25.4.4-debug.zip) in Magisk

4.4. Go to Magisk "Module" and install Riru - EdXposed V0.5.2.2. Magisk zip module (EdXposed-v0.5.2.2_4683-master-release.zip) in Magisk

4.5. Install EdXposedMaganer apk

4.6. Reboot and check whether both Riru and Riru - EdXposed modules are enabled in Magisk, should be auto enabled

4.7. Check whether EdXposed framework is enabled with EdXposedMaganer, should be enabled

5. Install ExSDCard Access Enabler and allow app data to be written (save) to external SD

5.1. Download ExSDCard Access Enabler Magisk zip module (ExSDCard_Write_Access_Enabler_v3.5.zip) and put to an external SD card.

5.2. Go to Magisk "Module" and install ExSDCard_Write_Access_Enabler_v3.5.zip in Magisk

5.3. Reboot and check whether ExSDCard Access Enabler module is enabled in Magisk, should be auto enabled

5.4. Open EdXposedManager, go to "Download" tab and download both XInternalSD and Obb on SD EdXposed modules or manually download the apk from online:

- com.pyler.xinternalsd_v480_f98706.apk

- com.smartmadsoft.xposed.obbonsd_v10_b17ef2.apk

5.5. Install both XInternalSD and Obb on SD apk

5.6. Go to "Modules" tab and enable the installed EdXposed modules

5.7. Exit EdXposedMaganer, from phone Settings, go into Developer options.

5.8. Enable 'Force allow apps on external'

5.9. Reboot

5.10. Open XInternalSD and check the following for it to be setup properly:

5.10.1. Set the path. For Android 7 onwards, path should be in the format "/mnt/media_rw/XXXX-XXXX/". XXXX-XXXX is external SD card number/identifier, it can be checked using ES explorer.

5.10.2. Tick "Custom path to internal SD card"

5.10.3. Tick "Enable for all apps" (Unless for some reason you want just enable for some specific apps)

5.10.4. Untick "Include system apps" (As enabling it can cause issue)

5.10.5. Tick "Full access to external SD card"

5.10.6. Tick "Show app icon"

5.11. Open Obb on SD and check the following for it to be setup properly:

5.11.0. Ignore if it shows "Xposed framework not found"

5.11.1. Tick "Data On SD"

5.11.2. Tick "Play Stores Hooks"

5.11.3. Tick "Detect SD on Android 5/6"

6. Prevent app detecting root with RootCloak

6.1. Open EdXposedMaganer, go to "Download" tab and download RootCloak (with 5.x and 6.x support) EdXposed module or manually download the apk from online:

- com.devadvance.rootcloak2_v18_c43b61.apk

6.2. Install RootCloak (with 5.x and 6.x support) apk

6.3. Go to "Modules" tab and enable the installed EdXposed modules

6.4. Reboot

6.5. Open RootCloak and edit the app list for those you want to hide

7. Removing CPU thermal throttling for maintaining CPU efficiency in any temperature

7.1. Download ES Explorer and enable Root Explorer under "Tool" tab

7.2. Go to root /vendor/etc/

7.3. Move the thermal-engine.conf to an external SD card for making a backup. There should not be thermal throttling for CPU anymore.

8. Removing camera shutter sound

8.1. Download Disable screenshot and camera sounds Magisk zip module (Disable_screenshot_and_camera_sounds-v1.4(5).zip) and put to an external SD card.

8.2. Go to Magisk "Module" and install Disable_screenshot_and_camera_sounds-v1.4(5).zip in Magisk

8.3. Reboot and check whether Disable screenshot and camera sounds is enabled in Magisk, should be auto enabled

8.4. Go to "(root)/system/media/audio/camera/sound0" and check the file. It should become no_sound.m4a

8.5. Try taking a photo with camera sound option on. There should be no sound when taking photo.

9. Disable camera high temperature auto shutdown feature for Xperia official camera app with XThermDisabler

9.1. Open EdXposedMaganer, go to "Download" tab and download XThermDisabler module or manually download the apk from online:

- michele2.thermal.disabler_v10_113030.apk

9.2. Install XThermDisabler apk

10. Done

The below rescue steps are based on PC

X. Rescue soft bricked Xperia XZ3 due to recovery bootloop by reinstalling firmware

X.1. Rescuing by reinstalling firmware with flashtool (Tested fail for H9493)

X.1.1. Download and install the latest flashtool V0.9.34.0

X.1.2. Find the official firmware file for Xperia XZ3 online. For H9493, "Sony_Xperia_XZ3_H9493_52.0.A.3.202" should be the only one available online for Hong Kong version

X.1.3. For flashing, press the lightning button at the top left corner, select Flashmode, select the firmware file and follow the steps

X.1.3.1. For flashing devices that are no supported by flashtool V0.9.34.0

X.1.3.1.1. For checking whether your device is supported by the current flashtool or not

X.1.3.1.1.1. Go to 'Devices' -> 'Manage' -> 'Export'

X.1.3.1.1.2. Check the supported device

X.1.3.1.2. If your device is not in the 'Export' list (E.g. H9493), then you need to add the device script manually.

X.1.3.1.2.1. Go online and find the modded script. They are usually in XDA. https://xdaforums.com/t/xz3-ftf-firmware-with-flashtool-0-9-25.3920053/

X.1.3.1.2.2. Once downloaded the script, put the script in C:\Users\[username]\.flashTool\devices

X.1.3.1.2.3. Restart flashTool and check whether the device script is successfully added in 'Devices' -> 'Manage' -> 'Export'. Go back to step X.1.3. for flashing the device

X.2. Rescuing by reinstalling firmware with Newflasher https://www.bilibili.com/video/av35680720/

X.2.1. Download firmware with XperiFirm

X.2.2. Download Newflasher from xda. https://xdaforums.com/t/tool-newflasher-xperia-command-line-flasher.3619426/

X.2.3. Extract Newflasher.exe and put it under the directory of the downloaded firmware from XperiFirm

X.2.4. Please note that all the files in the same directory of Newflasher.exe will be flash to the connected device. Remove those are not wanted before flashing E.g. simlock.ta for simlock. (Probably this is the only one need to be removed)

X.2.4. When ready for flashing, open Newflasher.exe and follow the instruction in command line. If it is asking you to backup or install driver, just yes for it in case