[Sony Xperia XZ2 ROMs, Kernels, Recoveries, & Other] MartinX3:
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!

Official site

Unofficial site

#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

https://developer.sony.com/develop/open-devices/get-started/flash-tool/useful-key-combinations/

https://wiki.lineageos.org/adb_fastboot_guide.html

https://developer.android.com/studio/releases/platform-tools

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:

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:

TWRP Bugtracker -> If you think the problem is in TWRP

My Bugtracker -> If you think the problem is in my implementation

Bugreport:

A bugreport needs your device name, dmesg, the /tmp/recovery.log and a way to reproduce the issue.

If possible use

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

/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:

Sony Open Devices Project Chat for devs

https://developer.sony.com/develop/open-devices	OEM binaries:	@SMDW_downloads	Bug Tracker:	https://github.com/sonyxperiadev/bug_tracker	This group is only for dev stuff.	For support: https://t.me/xdadevelopershub

t.me

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