• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[EOL][RECOVERY][Android 8 / 9][Stock/SODP][XZ2/C/P/3] TWRP 3.3.1-0 [UNofficial]

Should I continue this project?

  • Yes, for the XZ2.

    Votes: 177 36.0%
  • Yes, for the XZ2C.

    Votes: 198 40.3%
  • Yes, for the XZ2P.

    Votes: 62 12.6%
  • Yes, for the XZ3.

    Votes: 104 21.2%
  • No.

    Votes: 2 0.4%

  • Total voters
    491
Search This thread

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
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:

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.

Bugtracker:

Bugreport:
  • A bugreport needs your device name, dmesg, the /tmp/recovery.log and a way to reproduce the issue.
  • If the TWRP is stuck at the TWRP logo, the chances are high, that the decryption didn't succeed.
    • The TWRP should be still usable if you just "fastboot boot twrp.img" it.
  • 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
  • @M-ROM for his hint activating the touch in TWRP
  • @osm0sis
  • @nreuge
  • @FartyParty
  • @pandemic
  • @nasko_spasko
  • @VeixES
  • @Klaus N.
  • @old.splatterhand
  • @yanke928
  • @michele2
  • @niaboc79
  • @j4nn for hacking the kernel to make "fastboot boot twrp.img" possible
  • @shoey63 for testing @j4nn 's hack
  • @oshmoun for a better "fastboot boot twrp.img" solution
  • @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, oshmoun, Marijn, Sony
Source Code: https://github.com/MartinX3-AndroidDevelopment

ROM OS Version: 9.x Pie
ROM Kernel: Linux 4.x
ROM Firmware Required: Matching to firmware in twrp name
Based On: AOSP

Version Information
Status: No Longer Updated
Current Stable Version: 3.3.1-0
Stable Release Date: 2019-08-10

Created 2018-07-26
Last Updated 2020-10-23
 
Last edited:

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
Download & Installation

Download:

Installation Android 9.0:
  1. Update to newest stock firmware before unlocking!!!
  2. Enter fastboot via software, not hardware buttons. See "Known Bugs".
  3. (Optional; If you modify the system or need the camerafix.zip)
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
  4. fastboot boot twrp.img
  5. Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img
  6. Reboot into installed TWRP
  7. Want Root? -> Magisk
  8. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)

In case of touch issues on the XZ2 compact:
  1. Download (try the v10 zip first, if it doesn't work try v9 or v8)
  2. Do the same steps, but with the TWRP test release.

Installation Android 8.0:
  1. fastboot --disable-verity --disable-verification flash vbmeta vbmeta-xz2(?).img
  2. fastboot flash boot twrp.img
  3. Install stockkernel-xz2(?)-installer.zip
  4. Install twrp-3.2.3-0-xz2-xz2c-xz2p-installer-xz?-installer.zip
  5. Install Magisk-v17.1.zip
  6. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)
 
Last edited:

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
News

30.01.2020
i put this twrp officially into the endoflife status.
Due to twrp 10.0 being work in progress, i am unable to compile it in a 10.0 build environment.
So the 10.0 release will take its time.
(and sony didn't release the source code for the stock kernel until now).
I will try to experiment with a 9.0 twrp and a 4.14 kernel, so look if it is usable in the new 10.0 4.14 custom roms as a temporally workaround, when i have free time.
If that works, i will experiement with the stock kernel source, after it got released.
But for now i have no clue for any eta. (the curse of doing it as a volunteer :d)

17.11.2019
stock twrp 52.0.a.11.32 doesn't decrypt userdata.
Waiting that the needed patches get submit in twrp/omnirom.
Then i rebuild a new twrp for 52.0.a.11.32.
Please only "fastboot boot" it, don't flash it to the phone or the twrp will be just stuck at twrp logo.

16.11.2019
stock twrp 52.0.a.11.32

16.10.2019
stock twrp 52.0.a.11.3

13.10.2019
september security patch level:
Stock twrp 52.0.a.10.6

smaller download size:
Removed bundled magisk, since the newest one doesn't make bootloops anymore.
Removed touch drivers from twrp, now a script greps them dynamically from the vendor partition.

08.09.2019
a testbuild for the apollo/xz2c users with the not working tcm touch hardware.
Together with the testbuild for omnirom and sonyaosp every apollo user should be able now to use the touchscreen.
apollo_twrp_v8.zip

26.08.2019
september no new release
reason -> vacation + university exams


10.08.2019
august security patch level:
Stock twrp 52.0.a.8.131
sodp twrp

09.08.2019
removed the august stock twrp.
The new aosp pie august security patch level introduced new updates to the de/encryption, which needs to get adapted by twrp first.

08.08.2019
august security patch level:
Stock twrp 52.0.a.8.131

30.07.2019
stock twrp:
Upgraded the touch drivers to the 52.0.a.8.107 version.
Should fix all possible happening touch issues in twrp.

13.07.2019
fixed stock twrp touch
(culprit was the activation of the logcat support; working fine in the sodp twrp, but kills the touch workaround of the stock twrp)

12.07.2019
fixed stock twrp touch
(accidentially delivered with sodp kernel leading into not working touch)

12.07.2019
july security patch level:
Stock twrp 52.0.a.8.107
sodp twrp

11.06.2019
stock twrp 3.3.1 firmware 52.0.a.8.83 (june security patch level)

10.06.2019
custom rom twrp with june 2019 security patch level.
For the upcoming sonyaosp / omnirom june 2019 security patch level release.

01.06.2019
reuploaded custom rom twrp with hotfix to decrypt devices fullwiped on may 2019 or newer.

31.05.2019
custom rom twrp 3.3.1 with may 2019 security patch level.
Also i'll only push files to the single sim device section.
The dual sim device section will get a file with a hint to look into the single sim section.
That'll save bandwith and server storage.

18.05.2019
reworked the thread page

14.05.2019
http://www.dhsfileserver.de/ftp/martinx3/ thank you @dhacke for the second download server

13.05.2019
stock twrp firmware 52.0.a.8.50 (may security patch level)

24.04.2019
reuploaded aosp/stock twrp.
Accidentially uploaded (build environment bug) the akari xz2 twrp for every device. It boots & installs magisk, but it can't mount the other partitions.
Sorry!

22.04.2019
aosp twrp
hello "fastboot boot twrp.img"!
Bye bye twrp installer zip file! (see installation instructions.)
reduced the download size!

17.04.2019
stock twrp
hello "fastboot boot twrp.img"!
Bye bye twrp installer zip file! (see installation instructions.)
reduced the download size!

09.04.2019
stock twrp firmware 52.0.a.8.25 (april security patch level)
fixed touch problems some people have.
Twrp is now at version 3.3.0-0.

07.04.2019

06.04.2019
reuploaded april security patch level aosp twrp with a newer kernel and more upstream merged changes from sony aosp.
I hope now the wifi problem is gone.
Twrp is now at version 3.3.0-0.

02.04.2019
reuploaded april security patch level aosp twrp.
Reverted https://gerrit.omnirom.org/#/c/andro...overy/+/33783/
now zips are installable again without the "digest" error.
Omnirom still has the bug. Just install it on top of omnirom or replace its boot.img by the twrp.img.

02.04.2019
aosp twrp released for aosp / custom roms with april 2019 security patchlevel.

01.04.2019
aosp twrp released for aosp / custom roms with march 2019 security patchlevel.

May contain the stock twrp mtp bug.

A zip installer is not needed anymore.
Just flash the boot.img, the dtbo.img and the vbmeta.img with the parameters.

31.03.2019
reuploading twrp.
Removed the old build, which stopped at twrp logo.
Now the mtp and touchscreen problems should mostly be fixed.

30.03.2019
reuploading twrp.
Removed the old build.
Now the mtp and touchscreen problems should be fixed.

I tried to automate the upload with my new android file host access.
It is unstable.
Sadly android file host is the only hoster with unlimited quota.

25.03.2019
stock twrp released for stock firmware 52.0.a.8.14.
Many new fixes and features and sadly a new bug:
Wait until the password entry appears, before you connect the phone with your computer or the touch won't work.

But i hope that the touch bug on the xz3 is now fixed.

14.03.2019
dear people, sadly no new twrp for the new stock march firmware with shiny new twrp bugfixes and so on until i finished my next exam (of many) at the 20.03.2019.
But after that i'll release a new release.
Maybe with working "fastboot boot twrp.img" ;)

i hope
https://gerrit.omnirom.org/#/c/android_bootable_recovery/+/33287/
will got merged then, too, so i can hopefully remove the twrp installer zip file.

Ps:
The good thing is, if you rely on the twrp and won't update the firmware before i release it, you can see others complaining about march firmware bugs without having them on your phone. [emoji14]

19.02.2019
bundling now .202 touch drivers.
The difference to the first version is, that i don't try to get them from the vendor partition.
Instead i bundled them into my ramdisk file.
I hope the touch problems are now fixed for everyone, which i sadly can't reproduce.

17.02.2019
since some users still get no working touch, i switched back from .202 touch drivers to .163 touch drivers.

16.02.2019
hotfix for stock xz2 twrp. I introduced a bug with the last update.

16.02.2019
hopefully fixed touch bugs some where having (even with the exact same hardware/firmware combination like me)

13.02.2019
twrp firmware 2019 february 52.0.a.3.202
including a camera fix, which is compatible with the latest twrp release. (fixes only the black preview)
reduced the twrp download size by around 6mb. If the touch doesn't work, pelase report it asap.

10.02.2019
in combination with my sonyaosp _r31 release i uploaded the twrp for custom rom's / aosp (february patch level)
it is importand to use the same twrp security patch level as the rom or avb 2.0 will lead into bootloops in twrp and the system.

08.02.2019
i found the broken twrp solution together with the sony developers.

It's the cause of the omni 9.0.0_r31 ramdisk (february security level)
i need to wait for the february security patch stock update.
The rollback security is preventing me to use an january kernel with the february firmware, resulting in a blinking bootlooping black/logo/black/logo twrp animation.
Will release the next working twrp with twrp camerafix & magisk camerafix included and maybe my touch driver approch will work then, ( now i know it should work, it was only the cause of this security behaviour)

07.02.2019
i̶n̶c̶l̶u̶d̶i̶n̶g̶ ̶a̶ ̶w̶o̶r̶k̶i̶n̶g̶ ̶c̶a̶m̶e̶r̶a̶ ̶f̶i̶x̶ ̶c̶o̶m̶p̶a̶t̶i̶b̶l̶e̶ ̶w̶i̶t̶h̶ ̶t̶h̶e̶ ̶l̶a̶t̶e̶s̶t̶ ̶t̶w̶r̶p̶ ̶u̶p̶d̶a̶t̶e̶.̶ ̶(̶o̶n̶l̶y̶ ̶f̶i̶x̶e̶s̶ ̶b̶l̶a̶c̶k̶ ̶c̶a̶m̶e̶r̶a̶ ̶p̶r̶e̶v̶i̶e̶w̶.̶)̶

06.02.2019
r̶e̶d̶u̶c̶e̶d̶ ̶t̶h̶e̶ ̶t̶w̶r̶p̶ ̶d̶o̶w̶n̶l̶o̶a̶d̶ ̶s̶i̶z̶e̶ ̶b̶y̶ ̶a̶r̶o̶u̶n̶d̶ ̶6̶m̶b̶.̶ ̶i̶f̶ ̶t̶h̶e̶ ̶t̶o̶u̶c̶h̶ ̶d̶o̶e̶s̶n̶'̶t̶ ̶w̶o̶r̶k̶,̶ ̶p̶l̶e̶a̶s̶e̶ ̶p̶r̶o̶v̶i̶d̶e̶ ̶m̶e̶ ̶t̶h̶e̶ ̶i̶n̶f̶o̶r̶m̶a̶t̶i̶o̶n̶s̶ ̶l̶i̶n̶k̶e̶d̶ ̶i̶n̶ ̶t̶h̶e̶ ̶f̶a̶q̶.̶

03.02.2019
a mysterious bugfix for the stock twrp appeared. It is super effective for stock decryption.

01.02.2019
added the aosp/customrom support. I tested it on my xz2 with omnirom, aosp and resurrection remix.

19.01.2019
updated to stock firmware 52.0.a.3.163 (jan 2019)

19.01.2019
created buildenvironment for twrp.
Twrp is now based on tama omnirom builds.
That means we now get the latest twrp code commits.
This are the twrp code changes:
https://github.com/omnirom/android_...8=✓&q=committer-date:>2018-12-10&type=commits

15.01.2019
hopefully activated the xz3 twrp touch.

10.12.2018
twrp android 9.0 pie december update.
Synced my stuff with the 52.0.a.3.126 stock firmware (drivers, kernel, etc.).
Added the xz3.
uploaded the last pie firmware with a working camera on unlocked devices.

16.11.2018
the xz2p has a different kernel.
I fixed the xz2p twrp by splitting it in its own twrp boot.img file.

16.11.2018
twrp android 9.0 pie november update.
Synced my stuff with the 52.0.a.3.84 stock firmware (drivers, kernel, etc.)

13.10.2018
android 9.0 pie update.
Cleaned unused stuff.
Fixed mtp.
Only for xz2 and xz2c as universal installer.
Encryption still not supported, but my device config files are now usable to compile your own twrp.
Of course, the configsettings still are not fully optimal for this device.

13.10.2018
android 9.0 pie twrp for xz2 and xz2c got released!
Xz2p will follow, after it gets the same update.
Mtp is still deactivated.
Encrpytion of the userdata doesn't work (password always wrong), because of the new android 9.0 pie encryption.
I think the next release will fix this.
Btw. In the first post is now a know bugs section.
And thanks to @m-rom, @michele2 and @niaboc79, who tried to helped me in this emergency situtation that pie got released and needed a new twrp while i was at work. :silly:

11.10.2018
i seperated the twrp builds again, because of touch bugs in the xz2c.
The xz2, xz2c and the xz2p got seperated twrp.img files and stock kernel installer for twrp.

10.10.2018
i seperated the xz2_xz2c build from the xz2_premium build.
It seems that i made a mistake.
The xz2 and xz2c are sharing the same kernel, but the xz2premium kernel has little differents.
I also optimized the folder structure behind the downloadlink.

10.10.2018
working together with @storm// to achieve a working xperifix drmfix.
After we got success, i will highly recommend removing the old drmfix and installing his one.
The old one may brick the device forever during a longer time period. (2 weeks or longer)

old drmfix uninstall routine:
Flash with newflasher (v13+) only the file:
Vendor_x-flash-all-b6b5.sin

but remember to flash both slots.
Not only a or b.


twrp is your friend.
Or
fastboot set_active other

10.10.2018
i am happy to announce the twrp for the xz2, xz2c and xz2p!
I need test results for the xz2c and the xz2p which i don't own.
Installation instructions got updated.
The last file got uploaded a few minutes ago.

08.10.2018
fixed sdcard
in the 2018-10-08_01:36+2:00 folder.

Code:
1 fastboot format userdata
2. Fastboot flash twrp-xz2-2c-fixed-fstab-fixed-security.img
3. Reboot into recovery
4. Twrp flash stock kernel xz2_51boot.zip
5. Twrp flash twrp-installer-xz2-2c-3.2.3.zip
6. Install drmfix by storm// [b]or[/b] m-rom
7. Twrp flash magisk-v17.1.zip
8. Twrp flash permissive.zip
9. Reboot into system

06.10.2018
new try, thanks to everyone who helps me, tests for me and are a part of this nice little project. :)
in the 2018-10-06_14:53+2:00 folder.

Code:
1. Clean flash
[b]or[/b]
1.1 fastboot format cache
1.2 fastboot format userdata

2. Fastboot flash twrp-xz2-2c-fixed-fstab-fixed-security.img
3. Fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
4. Reboot into recovery
5. Twrp flash stock kernel xz2_51boot.zip
6. Twrp flash twrp-installer-xz2-2c-3.2.3.zip
7. Install drmfix by storm// [b]or[/b] m-rom
8. Twrp flash magisk-v17.1.zip
9. Twrp flash permissive.zip
10. Reboot into system

05.10.2018
new try, thanks to everyone who helps me, tests for me and are a part of this nice little project. :)
in the 2018-10-05_16:10+2:00 folder.

Code:
1. Clean flash
2. Fastboot flash twrp-xz2-2c-fixed-fstab-fixed-security.img
3. Fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
4. Reboot into recovery
5. Install drmfix by storm
6. Twrp flash stock kernel xz2_51boot.zip
7. Twrp flash twrp-installer-xz2-2c-3.2.3.zip
8. Twrp flash magisk-v17.1.zip
9. Twrp flash permissive.zip
10. Reboot into system

05.10.2018
modified the twrp recovery hack by @m-rom again.
Now i fixed the security settings for adb.
Twrp-xz2-2c-fixed-fstab-fixed-security.img
in the 2018-10-05_10:22+2:00 folder.

04.10.2018
modified the twrp recovery hack by @m-rom again.
Now unpacked and repacked by android image kitchen.
Twrp-xz2-2c-fixed-fstab.img
in the 2018-10-04_21:00+2:00 folder.
I exchanged the twrp.fstab and the recovery.fstab. I hope this fixed the shell problem.

04.10.2018
modified the twrp recovery hack by @m-rom.
Twrp-xz2-2c.img
in the 2018-10-04_11:30+2:00 folder.
I exchanged the twrp.fstab and the recovery.fstab. I hope this fixed the shell problem.

02.10.2018
a new build.
Twrp__more_oem_drivers__oem_firmware__omni_8.1__aosp_8.1_kernel__oem_8.1_libs.img
in the 2018-09-27_22:20+2:00 folder.
I added the entire firmware, bin, and radio folder and some more lib64 drivers from the aosp oem 8.1.6.3_r1_v15 binaries, so we can test, if the touch works now.

28.09.2018
a new build.
Twrp__more_oem_drivers__omni_8.1__aosp_8.1_kernel__oem_8.1_libs.img
in the 2018-09-27_22:20+2:00 folder.
I added every lib64 driver, so we can test, if the touch works now.

27.09.2018
a new build.
Twrp__omni_8.1__aosp_8.1_kernel__oem_8.1_libs.img
i tweaked some configs.
Switched back to oem 8.1 v15 drivers.
I did not upgrade the kernel, because the current code could damage the display.
Kernel bugs are listed in my aosp rom thread.

20.09.2018
new builds.
Feel free to test. :)

boot__omni_8.0__stock_8.0_kernel__stock_51.1.a.11.51_libs.img.gz
boot__omni_8.0__aosp_8.1_kernel__stock_51.1.a.11.51_libs.img.gz
twrp__omni_8.0__aosp_8.1_kernel__stock_51.1.a.11.51_libs.img.gz

boot__omni_8.1__stock_8.0_kernel__stock_51.1.a.11.51_libs.img.gz
boot__omni_8.1__aosp_8.1_kernel__stock_51.1.a.11.51_libs.img.gz
twrp__omni_8.1__aosp_8.1_kernel__stock_51.1.a.11.51_libs.img.gz


boot__omni_8.0__stock_8.0_kernel__oem_8.1_libs.img.gz
boot__omni_8.0__aosp_8.1_kernel__oem_8.1_libs.img.gz
twrp__omni_8.0__aosp_8.1_kernel__oem_8.1_libs.img.gz

boot__omni_8.1__stock_8.0_kernel__oem_8.1_libs.img.gz
boot__omni_8.1__aosp_8.1_kernel__oem_8.1_libs.img.gz
twrp__omni_8.1__aosp_8.1_kernel__oem_8.1_libs.img.gz


boot__omni_8.0__stock_8.0_kernel__oem_9.0_libs.img.gz
boot__omni_8.0__aosp_8.1_kernel__oem_9.0_libs.img.gz
twrp__omni_8.0__aosp_8.1_kernel__oem_9.0_libs.img.gz

boot__omni_8.1__stock_8.0_kernel__oem_9.0_libs.img.gz
boot__omni_8.1__aosp_8.1_kernel__oem_9.0_libs.img.gz
twrp__omni_8.1__aosp_8.1_kernel__oem_9.0_libs.img.gz

18.09.2018
a new build.
Twrp_8.0_oldconfig.img.gz
twrp_8.0_newconfig.img.gz
now i used the source code of the stock kernel to create a prebuild kernel image.
And i updated the device config.
And it looks like, that i can't put the stock source into the kernel folder of omni build environment.
It stops with the error, that it can't find a rule to make the zimage.
It is much more easier to build the aosp kernel, than the stock kernel.

17.09.2018
i downloaded the 51.1.a.11.51 firmware and extracted all the needed stuff, including the new kernel to update the twrp device sources. Hehe.
One is got built with omni 8.0 and the other one with omni 8.1.
Feel free to test them.

16.09.2018

15.09.2018
i uploaded the aosp rom.
Feel free to test it.
Its kernel will be the one with my twrp build.
So i need to know if the kernel work or has bugs and broken functions.
If the kernel and the aosp image is fine, i will update the twrp build.

14.09.2018
the bootloader v60 got released with the september patch.
i will now build aosp with the latest sources and if it will boot and work, i will use its kernel and the updated device sources to build twrp.

27.08.2018
don't use this twrp builds.
We need to wait for the bootloader update from sony.
The device will be announced as part of the sony open devices project at the same time and the following issue will be closed:
https://github.com/sonyxperiadev/bug_tracker/issues/149.
The leading developer jerpelea told us, that it would be released with the september stock update.

18.08.2018
i compiled the xperia aosp 8.1 image for the xz2 (h8266).
Feel free to test it.
I don't know, if we need the bootloader patch to run it.
Please follow the installing instructions in the third post.
https://drive.google.com/open?id=1-p7sknnber8pc9ya7ojpkvcltuwlgnri

04.08.2018 #3
i compiled the sony 51.1.a.4.265 stock kernel.
I compiled the normal bootimage with the sony stock kernel and the sony aosp build sources, to test if it is bootable.
I did the same with the omni 8.0 sources and the sony stock kernel.
I uploaded them with the file ending "-with-stockkernel.img"

i don't know, if the stock kernel is compatible with the sony aosp or the omni sources.

04.08.2018 #2
i compiled the normal bootimage with the sony aosp kernel and the sony aosp build sources, to test if it is bootable.
sony-aosp-8.1-04-08-2018-bootimage.img

04.08.2018
i recompiled the sony aosp 4.9 after its change to 'beta'.
I recompiled omni 8.0 twrp bootimage and recoveryimage with it.
Please test it and provide a feedback.

Ps: Omni 8.0 because since the last 'repo sync' i am not able to compile 8.1 anymore because of missing framework lib dependencies.

01.08.2018
i was able to compile the standard recovery with the sony 4.9 aosp kernel for the xz2.
I also compiled a bootimage and a recoveryimage with twrp with the sony 4.9 kernel and the omni sources.
Please test it and provide a feedback.

30.07.2018
the build is not working.
It seems, that we need to wait for sony to stable their asop kernel on github (e.g. To announce, that the xz2 is now a part of the open source project.)
 
Last edited:

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
Unfortunately, trying to run but the command does not enter you can write exactly step by step how to do it

Could you tell me, which error message you get?
Or does nothing happen?

Did you unlock your bootloader?

Do the command

"fastboot devices"

(Without "")

Will it ahow your device with a number?

_______________________________________

Or if you need to get into the Fastboot Mode

Connect your device to your PC and write

"adb devices"

This should show you your device and a number.

Then you can do

adb reboot bootloader

And choose the fastboot mode.
 

paulle

Senior Member
Nov 1, 2010
1,295
275
entering fastboot mode xperia xz2

Unfortunately, trying to run but the command does not enter you can write exactly step by step how to do it

Switch off the phone. Press and hold the Volume Up button
Connect to your PC using a USB Cable while holding down the Volume Up button on your Xperia XZ2
Before plugging in the USB cable on your Xperia XZ2 make sure that the other end of USB cable is already connected to the PC.
Wait till the LED turns into blue (the volume up button has to be pressed all the time till you see the blue led). Blue LED -> no more need to press the volume up button. Now you are in fastboot mode.

Using Linux do the following: open a terminal, type 'sudo fastboot devices' (without the quotes) (make sure before that you have fastboot installed on your linux box).
The output should be something like: QV7016A31E fastboot

The procedure should be very similar using windows (without using the sudo command), but I never tried it.
 
Last edited:
  • Like
Reactions: MartinX3

yanke928

Senior Member
Apr 30, 2012
53
52
Unfortunately this build seems not working, it did something out of an ordinary boot though.

Here's what exactly what I did:
1. The phone is unlocked, model H8266.
2. Shut down and get into fastboot mode, with blue LED on.
3."fastboot boot xz2_twrp.img" and get it booting.

and this is what I observed:
1. Screen turns on with Blue LED on, diaplaying "Your device software cannot... Blablablah".
2. After 5 seconds the screen turns off, but the blue LED is still on.
3. After around 20 seconds the screen turns on again with "SONY" logo, blue LED is still on.
4.About 5 seconds later, Blue LED turns off.
5.Again about 10 seconds later, screen turns off.
6.The red LED blinked a few times, with two times of vibration.
7.Screen turns on with "SONY" logo, then it's totally an ordinary boot into Android.

Hope the feedback will help.
 
Last edited:
  • Like
Reactions: MartinX3 and nreuge

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
Unfortunately this build seems not working, it did something out of an ordinary boot though.

Here's what exactly what I did:
1. The phone is unlocked, model H8266.
2. Shut down and get into fastboot mode, with blue LED on.
3."fastboot boot xz2_twrp.img" and get it booting.

and this is what I observed:
1. Screen turns on with Blue LED on, diaplaying "Your device software cannot... Blablablah".
2. After 5 seconds the screen turns off, but the blue LED is still on.
3. After around 20 seconds the screen turns on again with "SONY" logo, blue LED is still on.
4.About 5 seconds later, Blue LED turns off.
5.Again about 10 seconds later, screen turns off.
6.The red LED blinked a few times, with two times of vibration.
7.Screen turns on with "SONY" logo, then it's totally an ordinary boot into Android.

Hope the feedback will help.

Can you give use the entire Message of "Your device software cannot.."? :)
 

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
I should compile the Android 8.0 kernel with the Omni 8.0 sources, instead of 8.1 I think.
I also can't use the Sony Kernel 4.9.116 on Github, because it is not finish and stick with the delivered Kernel 4.9.65 from the July update.

(It is hard to test without an unlocked phone, hehe)
@yanke928
Can you use a second terminal to use
adb -d logcat &> log.txt
OR
ddms (in the android sdk)
while entering the fastboot boot cmd
to look, if it will give us any logs?
There is also a xda guide
https://www.xda-developers.com/guide-on-using-adb-logcat-and-ddms/
 
Last edited:
  • Like
Reactions: nreuge

yanke928

Senior Member
Apr 30, 2012
53
52
I should compile the Android 8.0 kernel with the Omni 8.0 sources, instead of 8.1 I think.
I also can't use the Sony Kernel 4.9.116 on Github, because it is not finish and stick with the delivered Kernel 4.9.65 from the July update.

(It is hard to test without an unlocked phone, hehe)
@yanke928
Can you use a second terminal to use
adb -d logcat &> log.txt
OR
ddms (in the android sdk)
while entering the fastboot boot cmd
to look, if it will give us any logs?
There is also a xda guide
https://www.xda-developers.com/guide-on-using-adb-logcat-and-ddms/

Tried to get log during the recovery booting but failed.
By issuing "adb logcat > logcat.txt" at the second terminal while booting the device from fastboot to the TWRP, it doesn't output anything when it's trying to boot the TWRP, but after the failure boot of TWRP, it does catch logs of an ordinary boot. Which means the adb works fine, while the TWRP doesn't give out any logs.

---------- Post added at 03:01 PM ---------- Previous post was at 02:27 PM ----------

I should compile the Android 8.0 kernel with the Omni 8.0 sources, instead of 8.1 I think.
I also can't use the Sony Kernel 4.9.116 on Github, because it is not finish and stick with the delivered Kernel 4.9.65 from the July update.

(It is hard to test without an unlocked phone, hehe)
@yanke928
Can you use a second terminal to use
adb -d logcat &> log.txt
OR
ddms (in the android sdk)
while entering the fastboot boot cmd
to look, if it will give us any logs?
There is also a xda guide
https://www.xda-developers.com/guide-on-using-adb-logcat-and-ddms/
I've found that I did a stupid thing, model confused.
Seemed you've compile it for H8266 for Chinese Mainland market, while I have H8296, HK version, but I don't think this will matter somehow since the phone of HK version and Chinese version can be flashed with each other's firmware. Also, if you're Chinese, you can communicate with me directly without English:D
 
  • Like
Reactions: MartinX3

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
Tried to get log during the recovery booting but failed.
By issuing "adb logcat > logcat.txt" at the second terminal while booting the device from fastboot to the TWRP, it doesn't output anything when it's trying to boot the TWRP, but after the failure boot of TWRP, it does catch logs of an ordinary boot. Which means the adb works fine, while the TWRP doesn't give out any logs.

---------- Post added at 03:01 PM ---------- Previous post was at 02:27 PM ----------


I've found that I did a stupid thing, model confused.
Seemed you've compile it for H8266 for Chinese Mainland market, while I have H8296, HK version, but I don't think this will matter somehow since the phone of HK version and Chinese version can be flashed with each other's firmware. Also, if you're Chinese, you can communicate with me directly without English:D

I am also using the H8296 HongKong device, because of the 6GB ram, but I installed the H8266 German firmware on it. :)
@spirit-eh got the same error, but I don't know his device.

PS:
I am still downloading the minimal platform_manifest_twrp_omni on 8.0 branch, before I can compile it again.
Many stuff to download and I got only 5Mbit internet on my vacation. :silly:

Edit:
A notable difference between the XZ2 image and the XA2 image is the kernel size
XZ2 kernel 15.3 MB
XA2 kernel 46 MB
Maybe he compiled the AOSP one from github.

Edit2:
I assume hardly, that I need to wait for the XZ2 to be added to the Sony open source programm.
So I can use the AOSP 8.1 kernel, instead of this hacked thing delivered in the Sony open source downloads in their site.

The XA2 twrp maintainer did the same.
 
Last edited:
  • Like
Reactions: nreuge

MartinX3

Recognized Contributor
Sep 14, 2014
5,825
2,887
Mars
martinx3.github.io
An older version of twrp does not work on xz2 (H8216) ? @MartinX3

TWRP 3.1 introduced support for A/B-Devices.
TWRP 3.2.0 introduced the Android 8.x compatibility and 3.2.1 and 3.2.2 included important fixes.
I wouldn't try an older version.

I also need to compile TWRP from source with my collected config files to work with the XZ2.
(TWRP need to compiled for every device on its own).

Now I try to compile it with OMNI 8.0 instead of 8.1, because it is a hacky 8.0 kernel, which I need to use.
(Sony's Android 8.1 AOSP 4.9 kernel is not finished.)
 
  • Like
Reactions: nreuge

Top Liked Posts

  • There are no posts matching your filters.
  • 50
    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:

    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.

    Bugtracker:

    Bugreport:
    • A bugreport needs your device name, dmesg, the /tmp/recovery.log and a way to reproduce the issue.
    • If the TWRP is stuck at the TWRP logo, the chances are high, that the decryption didn't succeed.
      • The TWRP should be still usable if you just "fastboot boot twrp.img" it.
    • 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
    • @M-ROM for his hint activating the touch in TWRP
    • @osm0sis
    • @nreuge
    • @FartyParty
    • @pandemic
    • @nasko_spasko
    • @VeixES
    • @Klaus N.
    • @old.splatterhand
    • @yanke928
    • @michele2
    • @niaboc79
    • @j4nn for hacking the kernel to make "fastboot boot twrp.img" possible
    • @shoey63 for testing @j4nn 's hack
    • @oshmoun for a better "fastboot boot twrp.img" solution
    • @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, oshmoun, Marijn, Sony
    Source Code: https://github.com/MartinX3-AndroidDevelopment

    ROM OS Version: 9.x Pie
    ROM Kernel: Linux 4.x
    ROM Firmware Required: Matching to firmware in twrp name
    Based On: AOSP

    Version Information
    Status: No Longer Updated
    Current Stable Version: 3.3.1-0
    Stable Release Date: 2019-08-10

    Created 2018-07-26
    Last Updated 2020-10-23
    12
    Download & Installation

    Download:

    Installation Android 9.0:
    1. Update to newest stock firmware before unlocking!!!
    2. Enter fastboot via software, not hardware buttons. See "Known Bugs".
    3. (Optional; If you modify the system or need the camerafix.zip)
      fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
    4. fastboot boot twrp.img
    5. Advanced menu -> "Install recovery ramdisk" -> Choose twrp.img
    6. Reboot into installed TWRP
    7. Want Root? -> Magisk
    8. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)

    In case of touch issues on the XZ2 compact:
    1. Download (try the v10 zip first, if it doesn't work try v9 or v8)
    2. Do the same steps, but with the TWRP test release.

    Installation Android 8.0:
    1. fastboot --disable-verity --disable-verification flash vbmeta vbmeta-xz2(?).img
    2. fastboot flash boot twrp.img
    3. Install stockkernel-xz2(?)-installer.zip
    4. Install twrp-3.2.3-0-xz2-xz2c-xz2p-installer-xz?-installer.zip
    5. Install Magisk-v17.1.zip
    6. (Optional; Security degradation; Only if you know what you're doing) Switch SELinux to permissive (with my permissive.zip)
    12
    @MartinX3 @sToRm// @modpunk
    I got drmfix working on enforcing selinux! ;)

    How-to:
    After reboot into system (post #3 - First time installation of TWRP & after newflasher installation), open a shell window and type:
    Code:
    su
    mount -orw,remount /vendor
    magiskpolicy --load /vendor/etc/selinux/precompiled_sepolicy --save /vendor/etc/selinux/precompiled_sepolicy "allow init domain process { noatsecure }" "allow init secd process { noatsecure }"
    mount -oro,remount /vendor
    Enjoy it!
    (you may now add it in your scripts if you want to)
    12
    09.04.2019
    stock twrp firmware 52.0.A.8.25 (april security patch level)
    fixed touch problems some people have.
    Twrp is now at version 3.3.0-0.
    12
    13.10.2019
    September security patch level:
    Stock twrp 52.0.A.10.6

    Smaller download size:
    Removed bundled magisk, since the newest one doesn't make bootloops anymore.
    Removed touch drivers from twrp, now a script greps them dynamically from the vendor partition.