A factory reset started in Android reached OrangeFox as --wipe_data, which ran a plain "wipe data". That left the metadata encryption key in /metadata/vold/metadata_encryption, which KeyMint had already deleted, so Android and recovery both failed with INVALID_KEY_BLOB and Android looped into recovery with init_user0_failed. Formatting also removes the key, so Android makes a new one on the next boot. Co-Authored-By: Claude Opus 5.5 <[email protected]>
OrangeFox device tree for the Sony Xperia 1 VIII (pdx267)
OrangeFox Recovery (fox_14.1) for the Sony Xperia 1 VIII (pdx267, SM8850 "canoe"), with
/data decryption, A/B and dynamic partitions. Based on the LineageOS pdx267 tree and on
koaaN's OrangeFox tree for the OnePlus 15 (infiniti, same SoC).
Building
-
Sync OrangeFox 14.1 (https://gitlab.com/OrangeFox/sync):
./orangefox_sync.sh --branch 14.1 --path ~/fox_14.1 -
Clone this tree:
git clone -b fox_14.1 https://git.redlintu16.com/SonyPDX267/android_device_sony_pdx267-orangefox.git ~/fox_14.1/device/sony/pdx267 -
Apply the two source changes in
patches/(see below). -
Build:
cd ~/fox_14.1 export ALLOW_MISSING_DEPENDENCIES=true . build/envsetup.sh lunch twrp_pdx267-ap2a-eng mka adbd recoveryimage
The image is out/target/product/pdx267/OrangeFox-*-pdx267.img. It is signed with the
LintuROM AVB key (BOARD_AVB_RECOVERY_KEY_PATH in BoardConfig.mk), so it boots with
LintuROM's vbmeta; point that at your own key otherwise.
Flashing
The recovery partition holds only a ramdisk: the bootloader takes the kernel from boot and
the modules from vendor_boot (a kernel inside the recovery image makes the Sony bootloader
report it as corrupted). fastboot boot does not work with it. Flash to the current slot:
fastboot getvar current-slot
fastboot flash recovery_b OrangeFox-*-pdx267.img # or recovery_a
fastboot reboot recovery
Source changes (patches/)
system_core-selinux-permissive.patch(system/core): the pdx267 bootloader ignores the recovery image's cmdline, andvendor_bootis shared with Android, so recovery's init defaults to SELinux permissive.cts-platform_releases-17.patch(cts): adds Android version17to the CTS release list, which the build checks againstPLATFORM_VERSION.
Decryption
Metadata encryption + FBE with hardware-wrapped keys, through Qualcomm's KeyMint in the TEE.
- Blobs: stock Android 16 (73.1.A.2.74, 2026-10) vendor, in
recovery/root/vendor. As in the infiniti tree, the vendor's newerlibc++ships aslibc++_v35.so(NEEDED entries patched with patchelf) and the recovery's ownlibbinder,libbase,libutilsandlibcutilsare used.qseecomdand thedlopened listener libraries,onekeymint,gatekeeper-rustand the AIDL boot control service (OF_USE_AIDL_BOOT_CONTROL). recovery/root/init.recovery.decrypt.rc: mounts the modem (trusted applications) at/vendor/firmware_mntand persist at/mnt/vendor/persist, and starts the services.keystore2.rc: not critical (TWRP's restarts the phone after 4 crashes) and started once KeyMint runs.- VINTF manifests (version 8.0) in the ramdisk
/vendor. The fastboot HAL's fragment is moved out of the framework manifest at boot, orkeystore2cannot register.
Version and patch level must match the installed ROM (RL16_RECOVERY_OS_VERSION,
RL16_RECOVERY_OS_PATCH and PLATFORM_VERSION in BoardConfig.mk; currently Android 17,
2026-10). KeyMint binds keys to them: lower and it rejects the keys as a rollback, higher (the
usual TWRP 99.87.36 / 2099-12-31) and it upgrades them so Android can no longer use them.
Theme
RedWhite (light, the default) and RedBlack (dark) replace OrangeFox's Light and Dark styles:
red on white or black, square corners, red outlines instead of tinted panels, Raleway, and a
plain "OrangeFox" splash. theme/gen_fox.py generates recovery/root/twres from OrangeFox's
stock theme; run it again after updating the OrangeFox source:
python3 theme/gen_fox.py ~/fox_14.1
Raleway (theme/fonts) is under the SIL Open Font License (theme/fonts/OFL.txt).