yashsingh1/xdaforums huggingface dataset:
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] Aurora1:
Hello,

years ago, now the HTC U11+ have SecPatch 2019-07-01 - 01.07.2019, Android 9 and ROM 2.19.401.2 (Europe).

twrp-3.3.1-0-ocm_181101.img work on PIE, but no /data/ encryption.

Isnt it possible to read out the Encryption passwort from running System and patch the twrp?

Or something to bring TWRP to working Encryption.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] The_Walking_Playground:
If it was possible, it would've been done already.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
[MENTION=4375068]sabpprook[/MENTION]

Just FYI, if i remember correctly i ran into a similar issue (for a non-HTC device by the way, no clue what device it was), it also however had a vendor partition, and all ended up decrypting perfectly fine (even with 0 files symlinked), but (s)he was building in an 8.0 tree so the sepolicy + plat/non_plat contexts were irrelevant, (s)he did however not have the proper services at the time, once that was used (at the time it wasn't on gerrit), decryption worked properly.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] sabpprook:
I got it, but omni android-8.0 still have some problems to build TWRP recovery, e.g. property get, busybox, file copy.

Since TWRP crypto feature still improving, I'll wait you to release the stable one. :o
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Yeah, omni-8.0 is a bit messy for a twrp build, needs a different busybox repo, and several other commits to build twrp more or less decently, which is why I was recommending omni-7.1 with the added sepolicy files as mentioned here
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] sabpprook:
Decryption still not work with omni-7.1, and here's the device tree.

https://github.com/sabpprook/android_device_htc_ocm
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
[MENTION=4375068]sabpprook[/MENTION]

Thanks for the logs, as usual, trying to actually understand what's going on correctly and not, is quite hard, I can *guess* that although services are running more or less properly, they're falling back to pre-Oreo decryption, due to possibly some 7.1 vs 8.0 changes (in property service, contexts, selinux, etc).

Could you please try this TWRP U11+ (htc_ocm) Recovery

And upload the new logs for me.

Though I take full credit for that build, because it's mine:

The recovery.log won't lie, so if you see something referring to our retired friend, big time contributor, and the list is long, then yep, it's Captain_Throwback, helping us all out again.

Wish him well, go find some posts of his, and hit the thanks button or even send him a small token of appreciation if you can.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
Big thanks for [MENTION=2605798]nkk71[/MENTION] and [MENTION=1162986]Captain_Throwback[/MENTION], but data decryption failed.

Log from /tmp View attachment 0001.rar

Log from /cache View attachment recovery.rar
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] sabpprook:
[MENTION=5064339]goodman_east[/MENTION]

According to recovery log you provided, /vendor does not mount properly, so "ven_qseecomd" was disabled.

Can you try this one? I do some fix on TWRP 3.2.0

https://drive.google.com/open?id=1B6j7qMkGlRvM-O2Gx8jCfRes5_lr9nQD
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Vendor is a real partition, so it is mounted, however the last build from Cap is done in 8.0, which as I mentioned may need to be built in 8.0 to work properly.

However, the TW_CRYPTO_USE_SYSTEM_VOLD is now incorrect given the currently merged version, and you need to remove all init.recovery.vold_decrypt rc files from your device tree as well as the plat/non_plat files and the sepolicy extras.

In 8.0 these will all get built properly, having them in your device tree will just overwrite them.

Also the TW_CRYPTO_USE_SYSTEM_VOLD should be using the same arguments as the U11 ones I linked in the ocn device patch set.

Probably these changes weren't done in Captain_Throwback last build, which is however built in 8.0 (with some extras to build properly).

Edit, actually something else looks wrong in the log too, I'll need to check it later.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
I test your modified recovery, and system can be mounted correctly.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Logs always provide logs, there were some major changes merged recently, which could affect things, so always provide logs please.

Remember that neither Captain_Throwback nor I have this device, so the best we can do is to read your logs. Neither of us enjoy (and usually don't even try) blind builds for devices we don't own.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
But I tested it. It didn't seem to be very stable. This led to the failure of my cell phone to enter the system. After I brushed in a recovery, I couldn't mount system. Now I need to re brush it into the official RUU, so I can log again.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] sabpprook:
Is that means TW_CRYPTO_USE_SYSTEM_VOLD currently not work in omni-8.0 built?

And I found some difference between U11 and U11 plus, there is only "android.hardware.keymaster@3.0-service-qti" under "/vendor/bin/hw" in U11 plus, and more sepolicy definitions

/(vendor|system/vendor)/bin/hw/android\.hardware\.keymaster@3\.0-service-qti	u:object_r:hal_keymaster_qti_exec:s0
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
It seems data successfully decrypted from the log and picture 1. But it stuck when boot to system with data corruption and required a password.

[IMG="1"]http://wx1.sinaimg.cn/mw690/aa2e59a4gy1fm0d41zabvj20f00qoq43.jpg[/IMG]

[IMG="2"]http://wx3.sinaimg.cn/mw690/aa2e59a4gy1fm0d4gxtsoj20f00qoq3f.jpg[/IMG]

View attachment cache.zip

View attachment tmp.zip
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
I'll need to check that later, just noticed you were using a different service just now that you mentioned it, according to upstream I don't recall seeing a -qti service instead of the regular one
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Log does show a successful decrypt:

...
[B]vdc cryptfs result (passwd): 200 732 0 (ret=0)
[/B]
...
Failed to unmount '/system' (Device or resource busy)
WARNING: system could not be unmounted normally!
Finished.
...
Data successfully decrypted, new block device: '/dev/block/dm-0'
/data | /dev/block/dm-0 | Size: 113522MB Used: 5930MB Free: 104514MB Backup Size: 5930MB

The failing /system unmount is due to some of the debug flags (LOGD in particular iirc).

So that looks like an almost complete build.

As for the second problem, I can't say for sure, according to your recovery log you're encrypted using the default password, so no prompt should show up.

I have been sometimes greeted with the very unwanted:

And most of the times, I just RUU'd to clean everything, then restore some data + google restore (when needed), or just left my device nice an clean. I cannot say whether it's the failed decryption count, some real corruption or something else.

So on that front I have no advice to offer atm unfortunately.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
It seems that /system was ruined, cannot boot to os after format data. Luckily, I backuped system image and boot, so can restore them to boot to os.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Well first off, I stand corrected about the service, seems like OEMs still like to change things I have no idea about, so the service is actually the one [MENTION=4375068]sabpprook[/MENTION] mentioned and [MENTION=1162986]Captain_Throwback[/MENTION] confirmed.

Your/our guardian angel has decided to do yet another build for you guys, this is an unnofficial TWRP build, it is not a debug build anymore.

https://drive.google.com/file/d/1EHRZZkkTKERaZ3_KeX5_XWjWzN6VdCGb/view

Enjoy, and greetings from Captain_Throwback
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
the unofficial TWRP failed to decrypt data. Attachments are the logs.

Edit1: Cannot boot to system (flashed the unofficial twrp-->boot to bootloader-->boot to recovery-->and then reboot to system, but boot to recovery automaticly.

Edit2: Phone can boot to system after the stock boot.img flashed. It seems the boot.img was modified.

Edit3: very sorry, my friend typed a wrong command "fastboot flash boot path-to-recovery", I will let him test again.

Edit4: Flash the twrp again using "fastboot flash recovery path-to-recovery", still cannot decrypt data, but can boot to system.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Can you please try the following 2 versions:

twrp-3.2.0-0_CPTB_UNOFFICIAL-ocm-A01.img

twrp-3.2.0-0_CPTB_UNOFFICIAL-ocm-A02.img

Instead of flashing them (which is fine no problem), but wouldn't it be simpler to "fastboot boot <name of twrp.img>" (without flashing it). I'm not sure fastboot boot works on your device, it does on the standard U11 though.

For the standard U11, you "fastboot flash recovery <name of twrp.img>" in download mode, but you can "fastboot boot <name of twrp.img>" in bootloader.

As to the log you posted, yes, failed decryption *seems* the *result*, but there are two other unrelated problems in there leading to this.

The first one should be fixed by either of these two repacks, I can't say about the second error at the moment.

If you can please boot or flash them, and upload the recovery log please. And since these are just repacks, please mention which log goes with -A01 and which one with -A02, though I think they should be exactly the same, nothing is ever easy it seems.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
here are the logs.

A01 tmp1 and cache1

A02 tmp2 and cache2
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Good, getting closer, I cannot say that decryption is failing per se, it's the unexpected output returned during the decryption, which is:

1- not supposed to occur

2- not expected

and therefore not accounted for this *spam* in vold_decrypt.

Captain_Throwback made a new build for you https://drive.google.com/file/d/1HeFKZS1Dgc1LmOX1GgVVnn1mCfFm1XdK/view

Give it a try.

I'll adjust the code to try and deal with the unexpected output, but ideally, I should investigate the matter and see why this is happening in the first place, as it is not supposed to happen at all.

You'll need to use the android-8.0 branch: https://github.com/TeamWin/android_device_qcom_htc-common/tree/android-8.0
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
Internal storage is still 0 MB. logs and info about mounts and partitions are presented in the attachments.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
okay thanks, I'll need to adjust the code, but could you tell me exactly what ROM / RUU you are running, I'd appreciate a link if you have one. That would give me the opportunity (when time allows) to try and find the cause of the libc warning/error too.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
ocmdtwl RUU 1.03.1405.1. I find a link here

Thank you and [MENTION=1162986]Captain_Throwback[/MENTION] .
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
I haven't checked the link you sent, but thanks, I will :good:

In the meantime, if you still feel like testing stuff, here's one

That's built directly in my box, so I may have missed a few things, and there is more than one change in there, due to upstream(s)

(TWRP, Omni, BB, etc), and I removed the stderr pipe for now (hoping that will fix the bad parsing, but I cannot say for sure, since I cannot reproduce)

I'm not sure I'd test something built at 3am in the morning, but then again, it doesn't seem you are unfamiliar with my habits or strange posts :p

EDIT: seems i had/have some upload issues, so I moved it to dropbox for now:

https://www.dropbox.com/s/yytou2he69exopj/TWRP-3.2.0-OCM-nkk71-20171204-0237.img?dl=0

and just to confirm:

CRC32: AB83C143

MD5: 93C485D00C314926D97DBEDF0614FE38

SHA-1: D4528C4C8A527F7EEC191AC6837C003F199A0E9E
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
Thank you very much for building a new twrp, I will ask my friend to test it and upload log here.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
It's a new build, with plenty of repo changes, so no worries if it doesn't work right (actually last time I said that, it did :p), but it's all still a bit messy especially for Oreo + OEM + Omni ++ on a device we cannot test on.

Thanks for testing.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
For better test, I bought a U11+ from http://eshop.htc.com/mall/zh-CN/htc/htc-u11-plus, but haven't yet shipped, maybe the day after tomorrow I can receive it.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
Thank you very much, nkk71. I tested your recovery on my U11+ phone. Your job is great. Now it has been able to mount USB to my PC. I will upload pictures later.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
So it decrypted fine?

I still need a recovery.log (and if you can a dmesg) from both you, and [MENTION=5064339]goodman_east[/MENTION] (and/or whoever is testing for him). As mentioned earlier, we've moved on from debug builds, but the output is unexpected and should not be there.

I'd rather have both (errors and proper parsing), i just got rid of the former which is not *correct* imho. (It is not *incorrect* either, since I'm looking for a valid reply, but the *spam* errors, should be accounted for, even if they should not exist in there)
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
I restarted my phone after I decrypted and entered the system to prompt a password, but I entered my original password not right.

View attachment recovery.log
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
Data decrypted successfully, but a nonexistent password is required when phone boots from twrp to system. I think /data was modified.

Edit1: This build of TWRP is the same as #33
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
No it's not the same build as previously, it's a new clean build, which *allows* for the error in libc:

libc: Access denied finding property "persist.vendor.dpm.feature"

not to be interpreted as part of the return codes (the info that decryption is waiting for). Having that *text* being seen as part of the return code, will break vold_decrypt as it is expecting the information in a certain way.

As for the logs (other than the above error which is also confusing and I haven't trying to see what it means), there are some differences in your logs:

In poppy22's log system get's unmounted normally (expected), however in goodman_east's log system does not get unmounted normally (unexpected), and since there are 2 logs showing different results about the unmounting of the system partition, it does not seem to be an issue from TWRP / vold_decrypt.

However, neither of these would / should result in an incorrect password (or password prompt if it's default) during boot. I honestly see no reason why this is happening, and perhaps it is unrelated.

As long as you keep your system partition read-only, nothing should be changed.

Also, [MENTION=4541682]poppy22[/MENTION] why did you wipe so much?
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
[MENTION=2605798]nkk71[/MENTION] Because when I entered the system, I asked for a password, but all the passwords I entered were incorrect, so I tried to format data partition to see if I could solve the problem of password. It turned out that I thought too much [MENTION=2605798]nkk71[/MENTION] [MENTION=1162986]Captain_Throwback[/MENTION] I tried to use https://github.com/CaptainThrowback/android_device_htc_ocm to compile under Omni, but it would not compile the part of the vold_decrypt.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
Does this file have any effect on [MENTION=2605798]nkk71[/MENTION] /system/lib/modules/texfat.ko? Do you need to extract from the official recovery.img? I got a copy of it. Would you look at it?

View attachment texfat.tar.gz
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] aussie1234:
Unlock bootloader

Hi, I've read that some have already unlocked the bootloader for HTC U11+.

On HTCDev U11+ is not on the list. How can I unlock U11+?

Thanks

Aussie
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] etann:
Hi there, you may just pick "All other supported models" from the droplist.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
I'm using that device tree as well, just need to add an empty vendor folder in recovery/root so that the vendor partition can get mounted properly. (oh and the android-8.0 branch, not master)

It builds fine, but I did (still do) have to make some modifications to vold_decrypt due to the error you're getting from libc trying to access that property. It's probably something not yet merged in omni-8.0, I'll need to check aosp and see what I can do about it.

that module is just to support exFAT formatted external sdcards, so no impact on decryption or the failed password problem you are encountering, which I do find very strange.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] poppy22:
Yes, it's a time-consuming project. Thank you very much for the effort and effort you have done for this project, but I can't do anything. I feel very sorry for that.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
can you guys get me a listing from the booted ROM (you'll need su access)

adb shell
su
ls -laZ /dev/__properties__
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
ls -laZ /dev/__properties__ > sdcard/list
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] devsk:
How do people have 'su' on their U11+? I would like to have that....:)
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] Kisakuku:
By flashing a Magisk-patched boot image.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] devsk:
Is there a page I missed on the U11+ boards? Can you please give me a link? I am looking get root on my U11+. Now that I just got the OTA, I don't expect another one anytime soon...:D
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] devsk:
Doesn't this require a custom recovery? Please tell us how this is working. Lot of my enhancements are blocked behind root.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] tbalden:
Read magisk thread op. All info there about adding magisk with manager app and a stock boot image and flashing with fastboot. Presumably you can get a stock boot image somewhere it should be possible.

Also the twrp here works I assume to that extent, that you can copy zip with adb push too without mounted internal storage. Then flash.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] devsk:
I tried 'fastboot boot <recovery>' with this recovery and it does not boot. Is that expected on this device? I thought on HTC, I could do that. I was hoping to extract stock recovery like this.

Does anybody have the latest stock recovery for U11+? Is there a way to extract it?
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] Prot02018:
I also tried exactly the same thing a few weeks ago and it didn't work. I talk about it in this thread.

I'm also looking for the extracted stock recovery for the Chinese version as I only have the original RUU file which I am not familiar with being able to decrypt.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Here is the stock recovery extracted from the RUU 1.03.1405.1 RUU

U11+_stock_recovery_from_2Q4DIMG_OCEAN_M_DTWL_O80_SENSE90GP_HTCCN_CHS_2_1.03.1405.zip

I've been looking at the ruu to see if I could find anything obvious, but with the exception of the different / additional property/selinux stuff I don't see anything evident.

I'll probably make one more build for you guys, but I honestly don't see any reason (that I can think of) why TWRP would decrypt fine, but upon boot you cannot enter the ROM.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
Another test for this buid is done with my own U11+, and data is successfully decrypted.

But cannot boot to system after every enter into TWRP because a nonexistent password is asked to input, only after data formatted can boot to system.

I think maybe /data was changed by sth., so I listed /system and /data files both in the system and in TWRP with command

ls -lR /system or /data

Sadly, I have no idea about it.

OS 1.03.1405.1 cannot get rooted, so I make a rom using RUU 1.05.709.12 to gain root.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] devsk:
I have already taken the OTA to 1.10.709.23. Wouldn't I be breaking the next OTA if I asked Magisk to use this older recovery image (which it will patch and apply)? I think I need 1.10.709.23 stock recovery.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] cameljockey1:
I ordered my u11plus just yesterday. Should get it next week. I have read the whole thread and a little confused. Which twrp is working enough? Should I update the phone when I receive it? I need to root so I can add lte bands for it to work in the USA.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] goodman_east:
I saw fstab.qcom and fstab.htc_ocm in /etc directory of vendor.img, does it have relationship with the encryption?
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Here's a new build, for whoever want's to give it a try:

twrp-3.2.1-0_TEST1212_ocm.img

I cannot say whether something will change or not (error messages in the log, password prompt on boot), and since I have no way to even possibly try to understand what's going without the device, that's the best I can do for you folks.

Lemme know how it works out, and upload a recovery.log as well as a dmesg if you can.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] lyfkevin:
password prompt on boot still exisits.

I need to factory reset and restore data whenever I tested a twrp built.

Any alternative?

Thanks.:good:
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] nkk71:
Okay, all this is very confusing, so if I understand correctly:

Normally booting ROM

Flashed TWRP

Entered TWRP, and let it decrypt properly

Reboot, and ROM asks for password

Nothing else was done right?

If yes, can you test one last thing (using same TWRP):

Normally booting ROM

Set a PIN

on boot

Reboot normally and make sure PIN works properly

Reboot to TWRP

It will ask for a password -> CANCEL the prompt! do not let it decrypt

Reboot and tell me if the ROM accepts your PIN

And do you know if you're running with verity enabled or not? (eg if you have Magisk flashed then it should be disabled), you can do a "adb shell mount" in booted ROM and it should give some info.
[HTC U11+ ROMs, Kernels, Recoveries, & Other Develo] lyfkevin:
I just did few tests with magisk rooted environment.

Normally boot and set 4-digits PIN on boot

Reboot ROM once to ensure PIN works

Flash twrp and boot into it with PIN correctly -> Check log_A.zip

Reboot to ROM, rejected my PIN

Reboot to twrp again, CANCEL the prompt -> Check log_B.zip

Reboot to ROM, rejected my PIN,

30 times failure and it reboot to twrp automatically (not factory reset ROM), CANCEL the prompt-> Check log_C.zip and IMG_0013

Reboot to ROM, rejected my PIN, IMG_0014, the attempt counts to negative LOL

Reboot to twrp, with PIN correctly -> Check log_D.zip

At the end, flash stock recovery and factory reset.