Thank you so much
@der_akinator! I have tested your build on my OnePlus 9 Pro with stock OxygenOS 12 (C.48) and stock OxygenOS 13 (F.17).
Decryption works in both cases (I only have one default user, user 0, and I use a numeric PIN). I do get the error message "Failed to mount '/vendor_dlkm' (Block device required" (rest is cut off) a few times at the beginning and also when starting a backup. But I think that has already been discussed in earlier messages and can safely be ignored, as I understand.
With OOS 12 I was able to do a backup successfully. But with OOS 13 I ran into the "createTarFork() process ended with ERROR: 255" issue that others have seen as well. As with the others who encountered it, I hit it when backing up /data/fonts/files. While TWRP recovery was open, I opened a shell with adb to figure out what is going on. The /data/fonts/files folder looked like this for me:
Code:
OnePlus9Pro:/data/fonts/files # ls -lah
total 27K
drwxrwx--x 9 system system 3.3K 2022-12-03 13:16 .
drwxrwx--x 4 root root 3.3K 1970-12-21 00:39 ..
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~Dq2S8kVqf-Dc6LKcUPIxAg==
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~MH9JbGNsVi5FNqTFxYOkzw==
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~PDIpcvjXWCGB0L9vu4bRVQ==
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~i9uxPse9gJwQHVMzvWO_ew==
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~ifyxiQTJ82tMnh85d-S_oQ==
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~vVr66c0Pht6y0-g70ZEL1A==
drwx--x--x 2 system system 3.3K 2022-12-03 13:16 ~~zZmOMCJqZPx76zYvxoauLA==
Inside each directory is a font file and those files cannot be read:
Code:
OnePlus9Pro:/data/fonts/files # cat */*
cat: ~~Dq2S8kVqf-Dc6LKcUPIxAg==/GoogleSansText-Medium.ttf: Required key not available
cat: ~~MH9JbGNsVi5FNqTFxYOkzw==/NotoColorEmoji.ttf: Required key not available
cat: ~~PDIpcvjXWCGB0L9vu4bRVQ==/GoogleSans-Regular.ttf: Required key not available
cat: ~~i9uxPse9gJwQHVMzvWO_ew==/GoogleSansText-Bold.ttf: Required key not available
cat: ~~ifyxiQTJ82tMnh85d-S_oQ==/GoogleSans-Medium.ttf: Required key not available
cat: ~~vVr66c0Pht6y0-g70ZEL1A==/GoogleSans-Bold.ttf: Required key not available
cat: ~~zZmOMCJqZPx76zYvxoauLA==/GoogleSansText-Regular.ttf: Required key not available
So these fonts just cannot be read and that's why the backup failed. It failed exactly when it tried to read the first of those files (which happened to be /data/fonts/files/~~MH9JbGNsVi5FNqTFxYOkzw==/NotoColorEmoji.ttf. Here is the relevant entry from recovery.log:
Code:
...
I:addFile '/data/fonts' including root: 1
==> set selinux context: u:object_r:system_data_file:s0
found fscrypt policy '/data/fonts' - '2DK' - '2312b5d79eb868cb6ff02d908d0fe1a7'
I:addFile '/data/fonts/files' including root: 1
==> set selinux context: u:object_r:font_data_file:s0
found fscrypt policy '/data/fonts/files' - '2DK' - '2312b5d79eb868cb6ff02d908d0fe1a7'
I:addFile '/data/fonts/files/~~MH9JbGNsVi5FNqTFxYOkzw==' including root: 1
==> set selinux context: u:object_r:font_data_file:s0
found fscrypt policy '/data/fonts/files/~~MH9JbGNsVi5FNqTFxYOkzw==' - '2DK' - '2312b5d79eb868cb6ff02d908d0fe1a7'
I:addFile '/data/fonts/files/~~MH9JbGNsVi5FNqTFxYOkzw==/NotoColorEmoji.ttf' including root: 1
==> set selinux context: u:object_r:font_data_file:s0
I:Error adding file '/data/fonts/files/~~MH9JbGNsVi5FNqTFxYOkzw==/NotoColorEmoji.ttf' to '/data/media/0/TWRP/BACKUPS/fd144c5b/2022-12-03--12-20-33/data.f2fs.win019'
Error creating backup.
I:ERROR tarList for thread ID 0
Error creating backup.
I:InfoManager saving '/data/media/0/TWRP/BACKUPS/fd144c5b/2022-12-03--12-20-33/data.info'
createTarFork() process ended with ERROR: 255
Backup Failed. Cleaning Backup Folder.
...
After deleting the entire folder /data/fonts/files, the backup worked. It would probably be great if the TWRP backup code would be able to catch this error and continue with just throwing a warning instead of crashing. But I expect that might be something that needs to be fixed in the common TWRP source since it may not be specific to the OnePlus 9 Pro device.
By the way, there are plenty of files listed in the recovery.log that have "found fscrypt policy" and they all seem to be backed up without issue. Some of those files are even within a folder with a scrambled name (starting with ~~ and ending with ==). So there is something special about these font files.
For those interested, here is how I performed the upgrade. I started on OxygenOS 11.
1) Install the system update from the settings (it showed the update was about 4 GB large and called C.48)
2) BEFORE rebooting after the upgrade: use Magisk app to flash the twrp-installer zip from this thread (will flash to slot A and B)
3) BEFORE rebooting using the Magisk app reinstall Magisk; I did BOTH direct install (will flash to active slot) and install after OTA (will flash to inactive slot)
4) NOW reboot and verify everything works
5) Then the system upgrade showed me the update to OOS 13 (F.17) but it showed it was only 1-poin-something GB in size. So I decided to use the Oxygen Updater app, which downloaded the full F.17 upgrade (over 4 GB). I followed the instructions in Oxygen Updater to apply the update (had to install OPLocalUpgrade)
6) Repeat steps 2 and 3 above.
7) Now reboot, verify everything works and do another backup in TWRP