Compare commits

...
Sign in to create a new pull request.
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 62 additions and 29 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

@ -1 +1,50 @@
# TWRP configuration for Sony Tama (sdm845) platform devices
# TWRP configuration for Sony Tama (SDM845) platform devices
## Supported Sony Snapdragon 845 based devices
- Xperia XZ2 H8216/H8266/H8296 => [akari](https://www.gsmarena.com/sony_xperia_xz2-9081.php)
- Xperia XZ2 Compact H8314/H8324 => [apollo](https://www.gsmarena.com/sony_xperia_xz2_compact-9082.php)
- 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)
## Clone manifest twrp-14.1
```bash
repo init -u https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-14.1
```
## Sync manifest twrp-14.1
```bash
repo sync -j$(nproc --all)
```
## Clone the device tree
```bash
git clone https://github.com/j4nn/android_device_sony_tama.git -b android-14.1 device/sony/tama
```
## Build
```bash
unset JAVAC
unset JAVA_HOME
unset LEX
export ALLOW_MISSING_DEPENDENCIES=true
. build/envsetup.sh
export USE_CUSTOM_VERSION=true
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
- [MartinX3](https://github.com/MartinX3) ([android9 twrp](https://github.com/MartinX3-AndroidDevelopment/TWRP_android_device_sony_akari_old) for tama devices including touch type detection)
- TWRP developers (other devices setup as a base template)
- Lineage OS developers (multiple picks from tama devices configs)
Please see commits history for proper attribution.

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;
}