[RECOVERY][Android 10/11][Stock/SODP][XZ2/C/P/3] TWRP 3.4.0-0 [UNofficial]

Should I continue this project?

  • Yes, for the XZ2.

    Votes: 153 35.6%
  • Yes, for the XZ2C.

    Votes: 139 32.3%
  • Yes, for the XZ2P.

    Votes: 36 8.4%
  • Yes, for the XZ3.

    Votes: 102 23.7%
  • No.

    Votes: 0 0.0%

  • Total voters
    430
Search This thread

Spassd

Member
Dec 9, 2021
15
1
I follow the steps and cannot reach further after:

  • Update to newest stock firmware before unlocking!!!
  • Unzip the *.gz files with https://7-zip.org/ or Linux.
  • Enter fastboot via software, not hardware buttons. See "Known Bugs".
  • fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
  • fastboot boot twrp.img
As my XZ2 Compact Dual seems to try booting 2021-03-02_17-09-00_twrp_apollo.tar.gz it then shows the SONY logo, then reboots and at the end I just get the normal powerup.
I guess this is the right recovery, as it states there is no special recovery for XZ2 Compact Dual?

Before all I messed up with this instruction:

But I undid it (I think) by flashing the Stock Firmware again with Newflasher. Firmware was H8324_Customized DE_52.1.A.3.49-R3C so I guess it also replaced the (probably) broken former Recovery and unbricked my phone.

Now I try to follow this guide, but it seems TWRP also doesnt boot up.
Can there be traces left of the *broken* recovery even after flashing the Stock Firmware again, so this prevents TWRP to work?

I also did the software way to bootloader.



EDIT:

Now I tried the mothod above. There is a typo saying 'verify' instead of 'verity'.

Other than that I can boot the twrp-first-boot, but then I cannot install the twrp-ramdisk.

Error is:

E: Error getting bootctrl module

Process cd/tmp/repackorig/ && &sdbin%magiskboot unpack -h '/tmp/repackorig/boot.img' ended with ERROR: 1
Error while unpacking the image

(roughly translated from german)


Any ideas?
 
Last edited:
  • Like
Reactions: der.lange
I follow the steps and cannot reach further after:

  • Update to newest stock firmware before unlocking!!!
  • Unzip the *.gz files with https://7-zip.org/ or Linux.
  • Enter fastboot via software, not hardware buttons. See "Known Bugs".
  • fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
  • fastboot boot twrp.img
As my XZ2 Compact Dual seems to try booting 2021-03-02_17-09-00_twrp_apollo.tar.gz it then shows the SONY logo, then reboots and at the end I just get the normal powerup.
I guess this is the right recovery, as it states there is no special recovery for XZ2 Compact Dual?

Before all I messed up with this instruction:

But I undid it (I think) by flashing the Stock Firmware again with Newflasher. Firmware was H8324_Customized DE_52.1.A.3.49-R3C so I guess it also replaced the (probably) broken former Recovery and unbricked my phone.

Now I try to follow this guide, but it seems TWRP also doesnt boot up.
Can there be traces left of the *broken* recovery even after flashing the Stock Firmware again, so this prevents TWRP to work?

I also did the software way to bootloader.



EDIT:

Now I tried the mothod above. There is a typo saying 'verify' instead of 'verity'.

Other than that I can boot the twrp-first-boot, but then I cannot install the twrp-ramdisk.

Error is:

E: Error getting bootctrl module

Process cd/tmp/repackorig/ && &sdbin%magiskboot unpack -h '/tmp/repackorig/boot.img' ended with ERROR: 1
Error while unpacking the image

(roughly translated from german)


Any ideas?
try without magisk....

EDIT:

perhaps it may be necessary to run "copy-partitions" before Install recovery ramdisk:

Pre-install instructions​


In some cases slot b can be unpopulated or contain much older firmware than slot a, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of slot a to slot b. This step is NOT optional.

To do this, sideload the copy-partitions-20210323_1922.zip package by doing the following:

  1. Download the copy-partitions-20210323_1922.zip file from here.
  2. Sideload the copy-partitions-20210323_1922.zip package:
    • On the device, select “Apply Update”, then “Apply from ADB” to begin sideload.
    • On the host machine, sideload the package using: adb sideload copy-partitions-20210323_1922.zip
 
Last edited:

Spassd

Member
Dec 9, 2021
15
1
try without magisk....

EDIT:

perhaps it may be necessary to run "copy-partitions" before Install recovery ramdisk:

Pre-install instructions​


In some cases slot b can be unpopulated or contain much older firmware than slot a, leading to various issues including a potential hard-brick. We can ensure none of that will happen by copying the contents of slot a to slot b. This step is NOT optional.

To do this, sideload the copy-partitions-20210323_1922.zip package by doing the following:

  1. Download the copy-partitions-20210323_1922.zip file from here.
  2. Sideload the copy-partitions-20210323_1922.zip package:
    • On the device, select “Apply Update”, then “Apply from ADB” to begin sideload.
    • On the host machine, sideload the package using: adb sideload copy-partitions-20210323_1922.zip
Thanks for the Tip. But I did not include Magisk for installation, it was just about installing the TWRP.img with the install ramdisk option in TWRP - nothing about magisk.zip.

But afterwards I did the ADB Sideload to flash the copy-partitions.zip and this worked.

But now afterwards I am again trying the ramdisk recovery installation, but I get:

E: Error getting bootstrl module.

If I then reboot into recovery I need to prompt that *Unmodified System Partition* quesetion, but cannot use my touchpad.


Still I could Install new ROMs so I at least installed LOS 18.1 to remove that Stock Thing filled with Bloat Ware.
 
Last edited:

MartinX3

Recognized Contributor
Sep 14, 2014
6,007
3,045
Mars
martinx3.github.io
Thanks for the Tip. But I did not include Magisk for installation, it was just about installing the TWRP.img with the install ramdisk option in TWRP - nothing about magisk.zip.

But afterwards I did the ADB Sideload to flash the copy-partitions.zip and this worked.

But now afterwards I am again trying the ramdisk recovery installation, but I get:

E: Error getting bootstrl module.

If I then reboot into recovery I need to prompt that *Unmodified System Partition* quesetion, but cannot use my touchpad.


Any ideas? Only thing I could imagine: I seem to have *lost* the stock recovery before and now booting my regular recovery does not work, so the phone restarts into system. Nevertheless I flashed the original firmware with Newflasher (H8324_Customized DE_52.1.A.3.49-R3C) but I still dont have the stock recovery. Besides Newflasher Stock Update no idea where to get the Stock Recovery ...

Any chance that I need to get back the Stock Recovery before I can do the TWRP Install? I dont think so as I understand I flash a TWRP temporary and install from there.
The Sony Tama stock firmware has no recovery.
 

Spassd

Member
Dec 9, 2021
15
1
Thanks for the reply - I already changed my original post, but now this also makes sense to me.

So I now installed LOS 18.1, which gives me a new Recovery, but from the temporary Recovery I still cannot install TWRP.

Always:

E:Error getting bootctrl module.

So as my goal was only to install LOS 18.1, I now have what I wanted. But still sad that I seem to cannot get TWRP working :(
Especially for the BACKUP function.

As I now have a working ROM and working Recovery, I dont know what could still be alternating from any fresh system, trying to conduct the installation recipe.
 

MartinX3

Recognized Contributor
Sep 14, 2014
6,007
3,045
Mars
martinx3.github.io
Thanks for the reply - I already changed my original post, but now this also makes sense to me.

So I now installed LOS 18.1, which gives me a new Recovery, but from the temporary Recovery I still cannot install TWRP.

Always:

E:Error getting bootctrl module.

So as my goal was only to install LOS 18.1, I now have what I wanted. But still sad that I seem to cannot get TWRP working :(
Especially for the BACKUP function.

As I now have a working ROM and working Recovery, I dont know what could still be alternating from any fresh system, trying to conduct the installation recipe.
You're welcome

Sadly the stock based lineageOS port uses a modified dtbo partition which breaks the stock twrp compatibility.

About the backup function please ask in the twrp zulip support channel, since it should be a twrp issue.
 

Spassd

Member
Dec 9, 2021
15
1
Thanks again for clarifying for a noob.

So as far as I understand there is no possibility to get TWRP + LOS 18.1 working at the same time (right now)?

Now that would be okay for me to just have LOS 18.1, but now when rebooting to Recovery I get stuck again with a non-touch-screen TWRP which asks if it should keep system partition unmodified. And even if I do

adb reboot system

then I get into this TWRP screen. So I guess I need to flash again the original LOS 18.1 recovery to get rid of these TWRP traces again. So can I simply download Recovery from here ...


and then Boot into Temporary TWRP and then Install Recovery Ramdisk --> Choose Original LOS 18.1 Recovery

and this will get rid of any leftover TWRP?

I dont want to try before getting a secure answer, as I just took ages to fully set up and modify my LOS 18.1 with all stuff like LSPosed / XPosed / bla bla ...
 

MartinX3

Recognized Contributor
Sep 14, 2014
6,007
3,045
Mars
martinx3.github.io
Thanks again for clarifying for a noob.

So as far as I understand there is no possibility to get TWRP + LOS 18.1 working at the same time (right now)?

Now that would be okay for me to just have LOS 18.1, but now when rebooting to Recovery I get stuck again with a non-touch-screen TWRP which asks if it should keep system partition unmodified. And even if I do

adb reboot system

then I get into this TWRP screen. So I guess I need to flash again the original LOS 18.1 recovery to get rid of these TWRP traces again. So can I simply download Recovery from here ...


and then Boot into Temporary TWRP and then Install Recovery Ramdisk --> Choose Original LOS 18.1 Recovery

and this will get rid of any leftover TWRP?

I dont want to try before getting a secure answer, as I just took ages to fully set up and modify my LOS 18.1 with all stuff like LSPosed / XPosed / bla bla ...
You're welcome again

Just "fastboot flash boot los_recovery.img" should help you, if you didn't modify the dbo partition.
The boot/kernel/recovery partition is the same on Tama. (Google wanted it for devices starting with Android 8/8.1/9)

And yes, probably there won't be any twrp for stock los.
But the sodp based twrp works with all sodp ROMs with the same android version as the twrp.

I'll try to release a twrp 12 after aosp12 is ready with kernel 4.19.
(Just life is busy)
 
Cause I need my banking SW (S-pushTAN) every day and I found out, that it is not running for me under LOS, I had to find a solution with a minimum of bloatware: I flashed my H8324 with H8324_Customized DE_52.1.A.3.49-R3C from scratch and TWRP with the method mentioned above successfully. With a small and effective simple script (somewhere found on XDA) I got rid of the bloatware:

run `adb shell`
insert by copy and paste (debloat-remover-non-roo-xperia.txt)
pm uninstall -k --user 0 com.amazon.mShop.android.shopping
pm uninstall -k --user 0 com.sonymobile.advancedlogging
pm uninstall -k --user 0 com.sonymobile.anondata
pm uninstall -k --user 0 com.sonymobile.aptx.notifier
pm uninstall -k --user 0 com.android.dreams.basic
pm uninstall -k --user 0 com.google.android.calendar
pm uninstall -k --user 0 com.amazon.kindle
pm uninstall -k --user 0 com.s.antivirus
pm uninstall -k --user 0 com.sonyericsson.xhs
pm uninstall -k --user 0 com.sonymobile.xperialounge.services
pm uninstall -k --user 0 com.sonymobile.demoappchecker
pm uninstall -k --user 0 com.sonymobile.deviceconfigtool
pm uninstall -k --user 0 com.google.android.apps.docs
pm uninstall -k --user 0 com.google.android.apps.tachyon
pm uninstall -k --user 0 com.android.facelock
pm uninstall -k --user 0 com.sonymobile.music.googlelyricsplugin
pm uninstall -k --user 0 com.google.android.printservice.recommendation
pm uninstall -k --user 0 com.android.htmlviewer
pm uninstall -k --user 0 com.sonyericsson.idd.agent
pm uninstall -k --user 0 com.sonymobile.intelligent.observer
pm uninstall -k --user 0 com.android.keychain
pm uninstall -k --user 0 com.google.android.apps.maps
pm uninstall -k --user 0 com.google.android.music
pm uninstall -k --user 0 com.android.providers.partnerbookmarks
pm uninstall -k --user 0 com.google.android.apps.photos
pm uninstall -k --user 0 com.sonymobile.email
pm uninstall -k --user 0 com.sonyericsson.warrantytime
pm uninstall -k --user 0 com.sonymobile.prediction
pm uninstall -k --user 0 com.sonymobile.xperiaservices
pm uninstall -k --user 0 com.sonymobile.synchub
pm uninstall -k --user 0 com.google.android.videos
pm uninstall -k --user 0 com.sonymobile.music.wikipediaplugin
pm uninstall -k --user 0 com.sonymobile.xperiatransfermobile
pm uninstall -k --user 0 com.sonymobile.music.youtubekaraokeplugin
pm uninstall -k --user 0 com.sonymobile.music.youtubeplugin
pm uninstall -k --user 0 com.sonyericsson.android.addoncamera.artfilter
pm uninstall -k --user 0 com.sonymobile.assist.persistent
pm uninstall -k --user 0 com.sonymobile.assist
pm uninstall -k --user 0 com.android.backupconfirm
pm uninstall -k --user 0 com.android.calllogbackup
pm uninstall -k --user 0 com.sonymobile.cameracommon.wearablebridge
pm uninstall -k --user 0 com.sonymobile.retaildemo
pm uninstall -k --user 0 com.sonymobile.getset
pm uninstall -k --user 0 com.sonymobile.getset.priv
pm uninstall -k --user 0 com.google.android.backuptransport
pm uninstall -k --user 0 com.google.android.feedback
pm uninstall -k --user 0 com.android.inputdevices
pm uninstall -k --user 0 com.sonymobile.intelligent.backlight
pm uninstall -k --user 0 com.android.musicfx
pm uninstall -k --user 0 com.sonyericsson.android.omacp
pm uninstall -k --user 0 com.android.sharedstoragebackup
pm uninstall -k --user 0 com.sonymobile.simlockunlockapp
pm uninstall -k --user 0 org.simalliance.openmobileapi.service
pm uninstall -k --user 0 com.sonymobile.smartcharger
pm uninstall -k --user 0 com.sonymobile.android.addoncamera.soundphoto
pm uninstall -k --user 0 com.sonyericsson.startupflagservice
pm uninstall -k --user 0 com.android.stk
pm uninstall -k --user 0 com.android.apps.tag
pm uninstall -k --user 0 com.sonyericsson.mtp.extension.backuprestore
pm uninstall -k --user 0 com.sonyericsson.mtp.extension.factoryreset
pm uninstall -k --user 0 com.sonymobile.mtp.extension.fotaupdate
pm uninstall -k --user 0 com.sonyericsson.mtp.extension.update
pm uninstall -k --user 0 com.sonyericsson.mtp
pm uninstall -k --user 0 com.sonyericsson.wappush
pm uninstall -k --user 0 com.amazon.avod.thirdpartyclient
pm uninstall -k --user 0 com.sonymobile.cellbroadcast.notification
pm uninstall -k --user 0 com.sonyericsson.unsupportedheadsetnotifier
pm uninstall -k --user 0 com.google.android.youtube
pm uninstall -k --user 0 com.google.android.googlequicksearchbox
pm uninstall -k --user 0 com.whatsapp
pm uninstall -k --user 0 com.google.android.marvin.talkback
pm uninstall -k --user 0 com.instagram.android
pm uninstall -k --user 0 com.facebook.services
pm uninstall -k --user 0 com.sonymobile.support
pm uninstall -k --user 0 com.facebook.katana
pm uninstall -k --user 0 com.facebook.orca
pm uninstall -k --user 0 com.facebook.system
pm uninstall -k --user 0 com.facebook.appmanager
pm uninstall -k --user 0 com.sony.tvsideview.videoph
pm uninstall -k --user 0 com.android.hotwordenrollment.okgoogle
pm uninstall -k --user 0 com.google.android.gm
pm uninstall -k --user 0 com.google.android.tts
pm uninstall -k --user 0 com.google.ar.lens
pm uninstall -k --user 0 com.sonyericsson.textinput.chinese
pm uninstall -k --user 0 com.sonymobile.android.externalkeyboardjp
pm uninstall -k --user 0 com.sonymobile.coverapp2
pm uninstall -k --user 0 com.sonymobile.dualshockmanager
pm uninstall -k --user 0 com.sonymobile.glovemode
pm uninstall -k --user 0 com.sonymobile.pip
pm uninstall -k --user 0 com.sonymobile.pobox
pm uninstall -k --user 0 com.sonymobile.moviecreator.rmm
pm uninstall -k --user 0 com.sonymobile.entrance
pm uninstall -k --user 0 com.spotify.music
pm uninstall -k --user 0 com.android.chrome
pm uninstall -k --user 0 com.android.partnerbrowsercustomizations.chromeHomepage
pm uninstall -k --user 0 com.sonymobile.scan3d
pm uninstall -k --user 0 com.sonymobile.xperiaweather
pm uninstall -k --user 0 com.amazon.clouddrive.photos

That`s it!
btw: TWRP starts soft or hard and Backup is running fine.
 

Attachments

  • debloat-remover-non-roo-xperia.txt
    5.4 KB · Views: 25
Once more me again:
I finally got a perfectly running TWRP on my Xperia XZ2P (Aurora),
H8166_Customized DACHBLX_52.1.A.3.49-R6C

1. adb reboot bootloader
2. fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
3. fastboot boot twrp-kang.img
found here (extracted from twrp-aurora-20210501.zip by sjll):
https://androidfilehost.com/?w=files&flid=324986
4. adb push twrp-kang.img /
In TWRP:
5. Advanced menu -> Install recovery ramdisk -> Choose twrp-kang.img
6. Reboot into installed TWRP
7. Mount System, Vendor, Data, OEM
8. Format Data (factory-reset is not enough!)
9. adb sideload boot-aurora-image.img (with "unsin" extracted boot.img from stock)
10. adb sideload Disable_Dm-Verity_ForceEncrypt_11.02.2020.zip
found here (solves the encrypt/decrypt-problems by Zackptg5):
https://forum.xda-developers.com/t/...ncrypt-disk-quota-disabler-11-2-2020.3817389/
11. restart system
 

Totjoss

Member
Jan 12, 2017
8
1
Hi everyone !
I'm trying to install Android 11 on my XZ2 Compact, I've unlocked the bootloader, but I'm stuck at booting to trwp. You quoted "If "fastboot boot twrp.img" results into a blackscreen and reboot of the phone, take a look if you modified the DTBO partition.", that's my problem, but I didn't do anything special. I don't even know what a DTBO is. I've also tried multiple other TWRPs or even LOS recovery, none boots.
Any idea of how to fix this ? Thanks in advance.
 

Totjoss

Member
Jan 12, 2017
8
1
I installed XperiFirm, downloaded the firmware "H8324_Customized DE_52.1.A.3.49-R3C" (even if a R4C is available) and used newflasher to flash it. It seemed to work until I get this message.

Capture d’écran 2022-01-14 112523.png


I don't know if that means it didn't flash. I retried "fastboot boot twrp-xz2c.img" but still not working (black screen and logo locked). :(
 
  • To rescue a not responding phone:
    • VOLUP+POWER for 3 Seconds -> RESTART with one Vibration.
    • VOLUP+POWER for 20 Seconds -> SHUTDOWN with 3 Vibrations.
    • VOLUP+POWER+CAMERA for 30 Seconds -> HARDWARE SHUTDOWN by discharging a capacitor.
try to restart and look what happens

try to enter fastboot via software

I´m not familar with this situation, perhaps it may be nessecary to wipe DATA and (if possible) DTBO

good luck!
 

Kody0

New member
May 9, 2018
1
0
hello
im failed install recovery ramdisk on xz3 h8416. it say ERROR: 1 Error unpacking image. what must i do? im try to reboot system but got bootloop
 

toto4c19

Member
Oct 15, 2020
6
1
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://forum.xda-developers.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://forum.xda-developers.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
 
  • Like
Reactions: Henri_Smets

toto4c19

Member
Oct 15, 2020
6
1
Martin mate,

Thank you very much for your hard work but could you really have a look and check with the "vbmeta.img" for Xperia XZ3?

I have 2 relavent devices, Xperia XZ2 premium H8166 and Xperia XZ3 H9493.

The Xperia XZ2 premium H8166 work perfectly fine with your guide.

But the Xperia XZ3 H9493 stuck at recovery bootloop at some stage and I notice the bootloop occurs after installing vbmeta.img. I have already tried with everything you mentioned before (E.g. going to Advanced menu -> "Fix recovery bootloop". installing magisk ...) but nothing helps. And thats why I came up with that dump guide above because it ended up with flashing stock firmware for rescuing my Xperia XZ3 H9493.

Since I just want to use TWRP for rooting (installing Magisk), so I just do a temp boot TWRP and achieved what I want.

Thanks and regards,
Toto
 

typ44q

Senior Member
Aug 3, 2010
130
6
3.2. Reboot the Sony Xperia XZ3 to system, open magisk and finish installation
First, thank you for taking the time to write up these instructions!
Background I am using a XZ2c android 10 with TWRP recovery installed

per the instructions I installed Magisk v23.0 successfully using TWRP but as soon as I open the app it says "upgrade to finish the install" and it does an update to V24.3
On the home screen under Magisk Installed it says N/A. Zygisk: No Ramdisk: Yes.
Under App it says Latest 24.3 Installed 24.3
Do I have to keep the app from updating somehow?

Any help would be really appreciated, thanks
 

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    it does not work with the latest firwmare (52.1.A.3.137) i follow the guide but when i flash the twrp,and click reboot,it reboots again on twrp and not into the system.can you update the twrp?? or is because i have the dual sim model h9436 and that in the twrp folder is for the 1 sim ?(h8416) @MartinX3 i follow instructions of

    toto4c19 but nothing...​

    oh! easy, go to "Advanced" then "Fix Recovery Bootloop"
    1
    I've got something for you to try:you can extract the original stock boot image with unsin then flash it with fastboot again, and then try the procedure again
    1
    don't have the knowledge to do this.also its too difficult,for the developer who made the root app,to updated to the latest firmware of the device. seriously now....
    here you go :)
    run the fastboot flash boot boot_X-FLASH-ALL-B6B5.img command. or..you know how to flash it
    1
    thanks.when i will have time i will respond back.
    ur welcome. waiting for ur response
  • 22
    The Sony Open Devices Project is always happy about volunteers (coding, testing, etc) :)
    Also mainlining your favorite snapdragon powered xperia device into the mainline kernel is possible and we will be glad to help you!


    Code:
    #include <std_disclaimer.h>
    /*
     *
     * We are not responsible for bricked devices, dead SD cards,
     * thermonuclear war, or you getting fired because the alarm app failed. Please
     * do some research if you have any concerns about features included in this ROM
     * before flashing it! YOU are choosing to make these modifications, and if
     * you point the finger at us for messing up your device, we will laugh at you.
     *
     */

    Team Win Recovery Project 3.x, or twrp3 for short, is a custom recovery built with ease of use and customization in mind. Its a fully touch driven user interface no more volume rocker or power buttons to mash. The GUI is also fully XML driven and completely theme-able. You can change just about every aspect of the look and feel.

    FAQ:
    • Just wiping your phone in TWRP lead into an encrypted & not readable userdata in the stock system.
      You need to open advanced wiping and check the entries data and internal storage.
      Of course clear the dalvik, too.
    • If you backed up system and/or vendor partitions and you want to restore them, make sure that TWRP setting "Use rm -rf instead of formatting" is set!.
    • If after the usage of NewFlasher or the OTA Updater or something else, which installs stock firmware parts you get stuck into the TWRP or SONY Logo, you need again to disable the verification with the vbmeta.img file and its parameters in fastboot.
    • fastboot & adb
    • Weird problems not easily to reproduce by other users require that you make sure, that you
      • Use the newest platform tools (adb & fastboot)
      • Downloaded the newest firmware via Xperifirm from XDA and installed the newest firmware via Newflasher from XDA
    • Newflasher from XDA
    • Xperifirm from XDA
    • Removing the stock bloat apps via titanium backup may result in a boot loop. Use a file explorer to remove them, disable them or try to use my unfinished bloat removal script at github.
    • Your phone reboots into recovery, instead of system? Maybe it crashed too often due to a wrong installation or whatever?
      In TWRP:
      • Code:
        cat /dev/block/bootdevice/by-name/misc
        shows you the reason.
      • TWRP -> [WIPE] -> [Advanced Wipe] -> Tick only the misc -> [Swipe to Wipe]

    Known Bugs:
    • The "fastboot boot twrp.img" doesn't work, if you use the hardware buttons to open the blue fastboot bootloader mode. Only use adb, twrp or the android system to reboot into blue fastboot bootloader mode or flash the twrp.img, boot the device, reboot into bootloader and flash the original boot.img back, before booting into twrp.
      You can also "fastboot reboot bootloader" in the blue fastboot mode.
      This is a bootloader bug, maybe it gets fixed with the stock Q bootloader.
    • If "fastboot boot twrp.img" results into a blackscreen and reboot of the phone, take a look if you modified the DTBO partition.
      It requires a special TWRP for every modified kernel/dtbo until I find some way to unify the twrp kernel with the DTBO (if the bootloader supports it).

    Bugtracker:

    Bugreport:
    • A bugreport needs your device name, dmesg, the /tmp/recovery.log and a way to reproduce the issue.
      If possible use
      Code:
      logcat -b all
      instead of just a dmesg.
      • If ADB is not working to provide logs
        • VOLUP+POWER for 1 Seconds -> Forced crash to create a pstore
        • Boot the normal system.
        • Give me the files in
          Code:
          /sys/fs/pstore/
    • If the TWRP is stuck at the TWRP logo, the chances are high, that the decryption didn't succeed.
    • To rescue a not responding phone:
      • VOLUP+POWER for 3 Seconds -> RESTART with one Vibration.
      • VOLUP+POWER for 20 Seconds -> SHUTDOWN with 3 Vibrations.
      • VOLUP+POWER+CAMERA for 30 Seconds -> HARDWARE SHUTDOWN by discharging a capacitor.

    Thank you very much for your help, code contribution & testing! (Random order):
    • @dees_troy and his team of volunteers for the TWRP code
    • @dhacke thank your for providing a download server
    • Shame on me if I forgot someone after searching through the thread and my PM's!
    • And many thanks to the few donators! :)

    A telegram group for technical SODP stuff:
    https://t.me/xda_tv

    XDA:DevDB Information
    TWRP, ROM for the Xperia XZ2

    Contributors
    MartinX3, Sony
    Source Code: https://github.com/MartinX3-AndroidDevelopment

    ROM OS Version: Android 10
    ROM Kernel: Linux 4.x
    ROM Firmware Required: Newest recommended
    Based On: AOSP

    Version Information
    Status: Stable
    Current Stable Version: 3.4.0-0
    Stable Release Date: 2020-06-13

    Created 2020-03-29
    Last Updated 2020-06-20
    13
    Download & Installation

    Download:

    Installation:
    1. Update to newest stock firmware before unlocking!!!
    2. Unzip the *.gz files with https://7-zip.org/ or Linux.
    3. Enter fastboot via software, not hardware buttons. See "Known Bugs".
    4. fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
    5. fastboot boot twrp.img
    6. Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img
    7. Reboot into installed TWRP
    8. Want Root? -> Magisk
    9. (Only if your phone doesn't boot to system anymore) Advanced menu -> "Fix recovery bootloop"
    10. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)
    10
    This means TWRP for 52.1.A.2.1?
    Yes
    I'm working on it this week plus a refactoring of the twrp device tree
    8
    The refactoring for the SODP twrp is now completed.
    It'll work without a flashed ROM (vendor/system/oem partition)
    Here runs now a nice 3.4.0 TWRP (new version since today)

    Now what's left
    - the STOCK TWRP touch driver refactoring, since the touch drivers aren't in the stock kernel, but external kernel modules which get started by bash scripts in stock.....
    - stock twrp without decryption to always work
    - sodp twrp without decryption to always work
    7
    News

    02.03.2021

    Reuploaded the SODP TWRP with a workaround for Android 11 compatibility.

    15.06.2020
    reuploaded the stock twrp for the xz2 premium with a completely fixed touch.

    14.06.2020
    reuploaded the stock twrp with a later touch kernel modules initialization.
    Hopefully fixing the randomly happening not working touch.

    13.06.2020
    thanks to the fixes in 3.4.0 we got now a twrp with the following enhancements for stock and sodp:

    - this twrp will work with future 10.0 roms, you don't need a new build matching the security patch level of your rom.
    - you can install this twrp again with the buildin ramdisk patcher. Please follow the installation instructions.

    11.06.2020
    switch to twrp 3.4.0
    sodp twrp 2020-06 security patch level
    stock twrp 2020-05 security patch level for firmware 52.1.a.2.1

    now both twrp should work without a rom being installed (empty system/vendor/oem partitions) and still be able to decrypt your userdata.
    Also the stock twrp touch should now always work instead of playing russian roulette.

    11.05.2020
    reuploaded sodp twrp for 2020-05 security patch level.
    It didn't boot with the newest aosp.

    07.05.2020
    sodp twrp for 2020-05 security patch level.

    14.04.2020
    removed stock twrp for firmware 52.1.a.0.672 until sony releases the kernel sources of the new security patch level.
    Otherwise the keymaster won't decrypt the userdata for twrp and twrp gets stuck on the twrp logo.

    13.04.2020
    stock twrp for firmware 52.1.a.0.672
    sodp twrp for 2020-04 security patch level

    hopefully fixed the touch problems of the stock twrp

    fixed the forced read only partition mountings of system, vendor, odm

    31.03.2020
    stock twrp for firmware 52.1.a.0.618

    30.03.2020
    sodp twrp for 2020-03 security patch level
    installing in ramdisk (to make it persistent) is impossible at the moment, because it is a 9.0 twrp which makes its ramdisk incompatible to the rom.

    Of course monthly twrp releases in sync with the current patch level need to be released or i would need to remove the userdata decryption completely.


    The stock twrp will follow, after it became ready.