[Sony Xperia 5 ROMs, Kernels, Recoveries, & Other D] terminal_overflow:
Hey everyone!

I want to share the progress (and files) from building AOSP 12 for Xperia 5 (J9210), including rooting the device with Magisk.

I followed Sony's AOSP guide for Android 12: https://developer.sony.com/develop/...sp-build-instructions/build-aosp-android-12-0

And I used their precompiled kernel, version 4.19, by passing

export SOMC_KERNEL_VERSION="4.19"

As an extra environment variable before compiling the full source code.

The OS works surprisingly well, except that mobile data and the camera dont work. Everything else works well, I manually installed some APKs and F-Droid store to replace some of the, well... substandard stock apps.

Root with Magisk works well so far too, Termux can be used as a root user with no troubles.

Apps confirmed to work:

- All Proton apps (ProtonMail, protonVPN etc.)

- Telegram

- Signal

- Brave Web browser

- F-Droid

- Lawnchair

- Magisk

- Shelter

- GBox

- 1Password

- Titanium Backup

- Termux

And more...

Flashable files and installation

Verification hashes for the zip archive:

SHA256: 5579e5bc6633e4920654b4d3103622201bb7a17f824edf732957270195bb9954

SHA512: 57e8501c9e9843126c611ca155a116cf37ed61fb990f0e9165b5dc78ac8f3743556a426bd60239f37aef3f015fbecadd3b60524238ca24664fb39e0b88354

e2a

I have attached the image files that can be flashed using fastboot, my tips below assume that you are running the console from the main folder of the zip archive.

See full installation instructions from Sonys guide (steps 6-8): https://developer.sony.com/develop/...tions/build-aosp-android-12-0#tutorial-step-6

Note 1

: For step 6, "<device>" is replaced with "bahamut".

Note 2

: For step 7, you can use only the following command and you are done:

fastboot flash oem out/target/product/bahamut/SW_binaries_for_Xperia_Android_12_4.19_v3a_kumano.img

Note 3

: For step 8, at the first command: you choose to flash either "boot.img" for non-root, or "magisk_patched-26100_fVEJC.img" for rooted system.

No custom recovery (e. g. TWRP) is used in this build.

After booting up for the first time, you can keep the phone connected to the PC. On your PC, navigate to the magisk folder in the zip archive and install the app with this console command:

adb install Magisk-v26.1.apk

You should be good to go now!

Sources

This is what I believe to be the right kernel source for this device: https://github.com/sonyxperiadev/kernel/tree/aosp/LA.UM.9.12.r1

Main kernel repository: https://github.com/sonyxperiadev/kernel/

Local manifests: https://github.com/sonyxperiadev/local_manifests

The whole source code can be downloaded by following step 4 in the guide: https://developer.sony.com/develop/...tions/build-aosp-android-12-0#tutorial-step-4

What I also could dig up from the guide was this:

AOSP tree build information:​

security revision: 2022-02-05

build: SQ1A.220205.002

branch: android-12.0.0_r28

Precompiled kernel used for this build: kernel-sony-msm-4.19-common

Official build guide from Sony: https://developer.sony.com/develop/...sp-build-instructions/build-aosp-android-12-0

Please let me know if I need to add/remove something here.

Extra note on Android 13

Pretty much nothing was stable in Android 13, so yeah, thats a rabbit hole of suffering. To put it mildly. I think Android 13 needs manual labour in the kernel source or several patches from the Sony Developers to get the drivers to work well with this device. This is based on my own efforts to compile and install Android 13 on the J9210 device, following their guides.