[Sony Xperia XZ1 Compact ROMs, Kernels, Recoveries,] j4nn:
new format of hideunlock kernels flashable to multi fw versions

As you know, up to now my bootloader unlock hiding kernel releases have been specific for each sony fw version and had certain version of magisk integrated in order to allow easy root with system fota update possibility. I've switched the packaging of releases to AnyKernel3 zip template available from [MENTION=4544860]osm0sis[/MENTION] (thanks for that).

This allows to release the kernels without ramdisk and without magisk pre-root, giving flexibility to try to flash/use the kernel not only with the fw version it has been built for, but allows users to test if the kernel could be compatible/working also with the next stock fw as released by sony. Similarly one may choose a preffered magisk version as some need older for some modules compatibility while others prefer the latest one. Or some might even preffer just to hide bootloader unlock state without magisk flashed. All that should be possible now.

The workflow that supports system fota update:

have full stock fw on your phone without any changes

enable developer mode and adb access from usb acking your pc fingerprint

adb reboot bootloader

fastboot boot twrp.img

from usb booted twrp

backup stock kernel and stock recovery partition from usb booted twrp to your sd card

flash magisk

flash hideunlock kernel in zip (version of kernel and fw may not match if testing compatibility with latest fw version)

optionally flash twrp image into recovery partition

reboot to system

enjoy your phone with unlock hidden, use only magisk system less modules, avoid changes in /system or /vendor

when new fw fota update arrives, enter twrp and do

retrieve your hideunlock kernel image in format suitable for fastboot to your pc - use 'adb shell' while twrp runs

cd /data/local/tmp
dd if=/dev/block/bootdevice/by-name/boot of=kernel-hideunlock.img

adb pull /data/local/tmp/kernel-hideunlock.img

restore stock kernel and stock recovery partition from the twrp backup on sd card

reboot to bootloader (i.e. fastboot) from twrp menu

fastboot boot kernel-hideunlock.img

install system fota update and after that go to point 3.

This procedure avoids the need to download full fw flash completely, instead just using system fota update with unlocked phone (works even with phones with lost drm).

Downloads:

kernel-G8141-47.2.A.10.62-hideunlock.zip

kernel-G8142-47.2.A.10.62-hideunlock.zip

kernel-G8341-47.2.A.10.62-hideunlock.zip

kernel-G8342-47.2.A.10.62-hideunlock.zip

kernel-G8441-47.2.A.10.62-hideunlock.zip

My magiskhide extension for sony ric deamon of oreo firmwares has been merged into upstream magisk, available already since Magisk-19.3 version - thanks [MENTION=4470081]topjohnwu[/MENTION].

For more details see my pull request here.

This allows to release also oreo kernels in AK3 zip file format - just use it with magisk 19.3 or any newer version.

kernel-G8141-47.1.A.16.20-hideunlock.zip

kernel-G8142-47.1.A.16.20-hideunlock.zip

kernel-G8341-47.1.A.16.20-hideunlock.zip

kernel-G8342-47.1.A.16.20-hideunlock.zip

kernel-G8441-47.1.A.16.20-hideunlock.zip

Flashing with dm-verity enabled

As flashing magisk defaults with dm-verity disabled, you can use following procedure to force dm-verity not changed from stock, i.e. let it be enabled (useful if planning system fota update in future):

start twrp having adb access enabled, start 'adb shell' with it, use following commands:

stop recovery
start recovery

this will terminate the 'adb shell' session, just start a new 'adb shell' and use following commands:

stop recovery
export KEEPVERITY=true
recovery &
twrp install /sdcard1/Magisk-v19.3.zip
twrp install /sdcard1/kernel-G8441-47.1.A.16.20-hideunlock.zip

You might just use twrp menu to install magisk and the kernel instead of the last two commands should you prefer gui control (assumed, not verified).

The important thing is that twrp has been started with KEEPVERITY=true environment variable set that magisk installation zip checks and if true, keeps verity on if it had been enabled in the original kernel.

from flashing the kernel with dm-verity enabled, you would get following output:

Installing zip file '/sdcard1/kernel-G8441-47.1.A.16.20-hideunlock.zip'
Checking for Digest file...
Skipping Digest check: no Digest file found

kernel sources including BL unlock hiding patch:
https://github.com/j4nn/
sonyxperiadev-kernel-copyleft

kernel hiding BL unlock by j4nn @ xda-developers

AnyKernel3 by osm0sis @ xda-developers

Checking device...
lilac

Checking Android version...
8.0.0

Installing...
keeping dm-verity enabled

Done!
Done processing script file

reboot to system having magisk with dm-verity on and kernel hiding bootloader unlock

xz1c kernels tested personally verifying above procedures, the other kernels are not tested, but should work the same as before.