Compare commits

..
Message SHA1
add build instructions into readme
j4nn   commited 2025-12-06 21:04:13 +02:00
8fafe78935
initial attempt for 14.1 branch
addapt lunch targets and disable twrp decryption that fails to build

j4nn   commited 2025-10-11 20:09:28 +02:00
f4ed0dd61a
remove vold patch used to support decryption with sodp roms
the related code has been removed from vold with commit
"vold: remove session keyring workaround for old kernels"

so we will need to use SODP 4.14 kernel at least in order
to enable twrp data decryption in 14.1 branch

j4nn   commited 2025-10-11 19:23:50 +02:00
a10a01391d
5 changed files with 20 additions and 82 deletions

View file

@ -21,11 +21,11 @@ PRODUCT_MAKEFILES := \
$(LOCAL_DIR)/twrp_akatsuki.mk
COMMON_LUNCH_CHOICES := \
twrp_akari-eng \
twrp_akari-userdebug \
twrp_apollo-eng \
twrp_apollo-userdebug \
twrp_aurora-eng \
twrp_aurora-userdebug \
twrp_akatsuki-eng \
twrp_akatsuki-userdebug
twrp_akari-ap2a-eng \
twrp_akari-ap2a-userdebug \
twrp_apollo-ap2a-eng \
twrp_apollo-ap2a-userdebug \
twrp_aurora-ap2a-eng \
twrp_aurora-ap2a-userdebug \
twrp_akatsuki-ap2a-eng \
twrp_akatsuki-ap2a-userdebug

View file

@ -137,7 +137,7 @@ TW_MAX_BRIGHTNESS := 1023
TW_THEME := portrait_hdpi
TW_EXCLUDE_DEFAULT_USB_INIT := true
TW_EXTRA_LANGUAGES := true
TW_INCLUDE_CRYPTO := true
#TW_INCLUDE_CRYPTO := true
TW_INCLUDE_NTFS_3G := true
TW_INCLUDE_PYTHON := true
TW_INCLUDE_RESETPROP := true

View file

@ -7,68 +7,22 @@
- Xperia XZ2 Premium H8116/H8166 => [aurora](https://www.gsmarena.com/sony_xperia_xz2_premium-9166.php)
- Xperia XZ3 H8416/H9436/H9493 => [akatsuki](https://www.gsmarena.com/sony_xperia_xz3-9232.php)
## Checks
Blocking checks
- [x] Correct screen/recovery size
- [x] Working Touch, screen
- [x] Backup to internal/microSD
- [x] Restore from internal/microSD
- [x] reboot to system
- [x] ADB
Medium checks
- [x] update.zip sideload
- [x] UI colors (red/blue inversions)
- [x] Screen goes off and on
- [x] F2FS/EXT4 Support, exFAT/NTFS where supported
- [x] all important partitions listed in mount/backup lists
- [x] backup/restore to/from external (USB-OTG) storage
- [x] decrypt /data
- [x] Correct date
- [x] USB-OTG (flash drive)
Minor checks
- [x] MTP export
- [x] reboot to bootloader
- [x] reboot to recovery
- [x] poweroff
- [x] battery level
- [x] temperature
- [ ] encrypted backups
- [x] input devices via USB (USB-OTG) - keyboard and mouse
- [x] USB mass storage export
- [x] set brightness
- [x] vibrate
- [x] screenshot
- [x] partition SD card
- [x] fastbootd (adb reboot fastboot)
- [ ] decrypt adoptable storage
- [x] reboot to EDL
## Clone manifest twrp-12.1
## Clone manifest twrp-14.1
```bash
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-12.1
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-14.1
```
## Sync manifest twrp-12.1
## Sync manifest twrp-14.1
```bash
repo sync -j$(nproc --all)
git clone https://github.com/minimal-manifest-twrp/android_device_common_version-info -b twrp-12.1 device/common/version-info
```
## Clone the device tree
```bash
git clone https://github.com/j4nn/android_device_sony_tama.git -b android-12.1 device/sony/tama
```
## Optional patch to support SODP roms too
```bash
patch -p1 < device/sony/tama/patches/vold-decryption-workaround-for-sodp-kernel.patch
git clone https://github.com/j4nn/android_device_sony_tama.git -b android-14.1 device/sony/tama
```
## Build
@ -81,10 +35,10 @@ export ALLOW_MISSING_DEPENDENCIES=true
. build/envsetup.sh
export USE_CUSTOM_VERSION=true
lunch twrp_akari-userdebug; mka bootimage
lunch twrp_apollo-userdebug; mka bootimage
lunch twrp_aurora-userdebug; mka bootimage
lunch twrp_akatsuki-userdebug; mka bootimage
lunch twrp_akari-ap2a-userdebug; mka bootimage
lunch twrp_apollo-ap2a-userdebug; mka bootimage
lunch twrp_aurora-ap2a-userdebug; mka bootimage
lunch twrp_akatsuki-ap2a-userdebug; mka bootimage
```
## Thanks

View file

@ -58,6 +58,9 @@ PRODUCT_SOONG_NAMESPACES += \
# Copy modules into initramfs /sbin
PRODUCT_COPY_FILES += $(call find-copy-subdir-files,*.ko,$(COMMON_PATH)/prebuilt/modules,$(TARGET_COPY_OUT_RECOVERY)/root/sbin)
# trying to workaround a build failure with 14.1 branch - did not help - copy the file manually there :-(
#PRODUCT_COPY_FILES += $(COMMON_PATH)/recovery/task_profiles.json:$(TARGET_COPY_OUT)/system/etc/task_profiles.json
# Prebuit files for recovery ramdisk
PRODUCT_COPY_FILES += \
$(call find-copy-subdir-files,*,$(COMMON_PATH)/recovery/root,$(TARGET_COPY_OUT_RECOVERY)/root)

View file

@ -1,19 +0,0 @@
Subject: [PATCH] system/vold: disable support for FS_IOC_ADD_ENCRYPTION_KEY
this workaround is needed to make decryption with SODP kernel 4.14 working in twrp
project system/vold/
diff --git a/system/vold/KeyUtil.cpp b/system/vold/KeyUtil.cpp
index 9273564..28628aa 100644
--- a/system/vold/KeyUtil.cpp
+++ b/system/vold/KeyUtil.cpp
@@ -87,7 +87,8 @@ static bool isFsKeyringSupportedImpl() {
if (errno != EFAULT) {
PLOG(WARNING) << "Unexpected error from FS_IOC_ADD_ENCRYPTION_KEY";
}
- LOG(INFO) << "Detected support for FS_IOC_ADD_ENCRYPTION_KEY";
+ LOG(INFO) << "Detected support for FS_IOC_ADD_ENCRYPTION_KEY, but returning false!";
+ return false;
android::base::SetProperty("ro.crypto.uses_fs_ioc_add_encryption_key", "true");
return true;
}