yashsingh1/xdaforums huggingface dataset:
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@luuxis Logcat will probably show the same error as here when I nuked it previously

sm7325-common: Drop liboemcrypto blob · LineageOS/android_device_motorola_sm7325-common@6c5b1ba

Unfortunately even though both berlin and dubai show Widevine L1 status? It doesn't work. Apps like Netflix fail to load. logcat shows errors such as: E WVCdm : [device_files.cpp(1111):Retri...

github.com

It's a bummer Motorola does this... Afaik Pixel devices retain working L1 on bootloader unlock, so I'm unsure why Motorola wipes DRM keys on bootloader unlock. There's quite a few OEMs that do this too. It could be worse though, some OEMs like Sony and OnePlus will reduce functionality of the cameras upon bootloader unlock 🙈

Heck, even back on my LeEco Le Max 2 (x2. Such a great device... RIP 3.18 kernel though) I could keep DRM keys and L1 worked until I think Android 8 as secure video codecs stopped working and caused crashes. Pretty much every device I've had since on Android 8 or higher L1 hasn't worked with bootloader unlocked... sigh

I think OnePlus devices and I think Xiaomi had a special apk to fix L1 upon bootloader unlock, but afaik Motorola has never offered this

I remember seeing a Magisk mod that "fixes" Netflix and all it does is nukes liboemcrypto.so too
[Motorola Edge 40 Pro  / Moto X40 (China)] luuxis:
I will look for a solution to the problem.

I'll eventually find a solution to make this work.
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Maybe this can help?

"Guide to reprogram the TEE on Qualcomm devices to fix lost attestation keys":

GitHub - chiteroman/Reprogram-TEE-on-Qualcomm-devices: Guide to reprogram the TEE on Qualcomm devices to fix lost attestation keys

Guide to reprogram the TEE on Qualcomm devices to fix lost attestation keys - chiteroman/Reprogram-TEE-on-Qualcomm-devices

github.com

"Spoof locked bootloader on local attestations"

GitHub - chiteroman/BootloaderSpoofer: Spoof locked bootloader on local attestations

Spoof locked bootloader on local attestations. Contribute to chiteroman/BootloaderSpoofer development by creating an account on GitHub.

github.com

(If it's even neccesary, and obviously not something that'll be used in official LineageOS)

And, here's what else i found that is not for us, but maybe useful for people that make their own builds or ROMs:

proc: Remove verifiedbootstate flag from /proc/cmdline · osm1019/android_kernel_motorola_sm8550@8e1571b

Userspace parses this and sets the ro.boot.verifiedbootstate prop according to the value that this flag has. When ro.boot.verifiedbootstate is not 'green', SafetyNet is tripped and fails th...

github.com

GitHub - Magisk-Modules-Alt-Repo/sensitive_props: Reset sensitive properties to safe state, take from MagiskHide code

Reset sensitive properties to safe state, take from MagiskHide code - Magisk-Modules-Alt-Repo/sensitive_props

github.com
[Motorola Edge 40 Pro  / Moto X40 (China)] luuxis:
Is the key.bin file the same for all devices?

if this is the case when I manage to recover the file everyone will be able to use it.
[Motorola Edge 40 Pro  / Moto X40 (China)] luuxis:
I have an idea that just crossed my mind, if it works I will explain to you what I did.

and I will propose a PR on the github
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
New test build is up! lineage-20.0-20230903-UNOFFICIAL-rtwo contains prebuilt GNSS to fix GPS and also a Carrier Config overlay change that should help get SIM cards working on Edge+ 2023 models and also synced the latest LOS changes which includes the merged changes for sm8550 (kailua) HALs. LHBM for UDFPS still isn't fixed on my builds unfortunately oof...

LineageOS for rtwo - Browse /lineage-20/lineage-20.0-20230903-UNOFFICIAL-rtwo at SourceForge.net

LineageOS for rtwo (Motorola Edge 40 Pro / X40 / Edge Plus 2023)

sourceforge.net
[Motorola Edge 40 Pro  / Moto X40 (China)] liudee:
Does it support DSDA(dual-SIM dual-active)
[Motorola Edge 40 Pro  / Moto X40 (China)] ryansff:
New build still has the same mobile data error on the Edge + 2023, constant sim resetting until the phone crashes and reboots to recovery.
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Same here. I can grab another logcat later but with RETUS base firmware + this build on a Edge+ 2023 telephony is still unusable. Since there were specific fixes I can try to grab another logcat to see if it is crashing somewhere else.
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Even though i think the Edge+ data is a LOS base issue, let's first upgrade blobs in a shortly upcoming build to RETUS T1TR33.43-48-35 (last week's Motorola update that includes August patch) and make it the version of RETUS we're recommending to users of all variants, as we do because RETUS is more stable without keystore crashes as said. Of course if T1TR33.43-48-35 has no new bugs.
[Motorola Edge 40 Pro  / Moto X40 (China)] patzek:
I've tried to update my device to the latest LOS version from here. Currently I'm running 04.08.2023 build. I've removed root and tried the update method suggested in first post (push_update.sh + LOS Updater app) which failed. Than I tried to sideload update from recovery which also failed.

Have I missed something, or what should be the right way? Clean flash only?
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@patzek what device firmware are you currently on? You might need to update that in order to run this newer build

Plus if you have GApps installed you will need to reflash it since this would be a manual update, otherwise Google Framework services can mess up and then you would need a factory reset
[Motorola Edge 40 Pro  / Moto X40 (China)] patzek:
I have updated my device to "XT2301-1_RTWO_RETUS_13_T1TRS33.43-48-21-2_subsidy-DEFAULT_regulatory-DEFAULT_cid50_GPD_CFC.xml.zip" with tiny fastboot script right before I switched over to lineage.

Before, I was on RETEU original os and faces keystore issues. Thats the reason why I switches to RETUS.

And I do not have reinstalled gapps as the installation/update of the rom has failed, but I'm aware of that part after a successful update.

Just asking how to update the right way, as I wasn't able to to it without an error. If it should work by sideloading or injecting the update to the lineage os updater than I thing I have to start over with a clean install.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@patzek I do sideload and it works fine for me and the push update should also work fine. I'm starting to wonder if maybe your other slot isn't populated with device firmware. Have you run the copy-partitions zip since updating to that 33.43-28-21-2 device firmware? It will need to be copied to the other slot, otherwise, only one slot will work
[Motorola Edge 40 Pro  / Moto X40 (China)] patzek:
I have run copy partions right after installation of RETUS firmware. So currently I do not see any "missing" step on my side, but there must be one :)

However, I will retry to apply the update and if it still fail, I will start with a clean flash.

Btw, the latest RETUS firmware (RETUS T1TR33.43-48-35) that someone mentioned here is not available as zip right now, or? Haven't found it anywhere.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
There's a Telegram Edge 40 Pro user who captured RETUS T1TR33.43-48-35 OTA link from the server and this link should be valid for a few more days

https://moto-rsd-prod-secure.s3.us-east-1.amazonaws.com/RTWO_G_T1TR33.43-48-35_subsidy-DEFAULT_regulatory-DEFAULT_cid50_CFC.xml.zip?AWSAccessKeyId=AKIAS37TSJMJY5VTZC6O&Expires=1696240546&Signature=z%2BKiP39ALZkJlbMZM90rma94X3w%3D
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
After switching to RETUS stock T1TR33.43-48-35 (with full reset and everything clean) to prepare and wait for the upcoming LOS build with new blobs, im already noticing keystore error lines in logcat:

I don't know the real world impact yet, as i didnt set up my apps on the stock ROM yet. As so many have said RETUS is the solution to keystore crashes, i hope the consequences of these failures are just not going to manifest as app crashes and lockscreen issues as they are confirmed to do on RETEU. Edit: the error lines persist, but on RETUS (tested so far: stock ROM) it doesn't manifest as crashes. Seems like the failures are suppressed in some way there.

In general, its weird this bug is even still a thing, including in stock ROM.. maybe similar as to how they dared to release the device without working VPN functionality except on X40, due to the dialog bug and they didn't fix it for a long time. I will see if i have the energy to properly report it soon, i hoped someone else had done it by now, someone that has the patience to pass through their Tier-1 support handling and make them really bring it under their firmware developer's attention. If while reporting it on Lenovo forums you say the words "Custom ROM/development" once, they will likely bury it after a template reply, probably even if you say the keystore bug & crashes are also present on stock ROM (RETEU, and btw, i didnt get anyone to confirm the X40 RETCN situation yet). It's hard to create good overview and get something done when it comes to large, sluggish companies like this.

I've also created 4 GPL requests for all the latest firmware releases, maybe we can get somewhere by understanding it ourselves (e.g compare sources from the same, latest base version, to figure out the perceived difference with RETUS). I'd like to believe that kernel and firmware, which are requestable sources, are low level enough to contain everything that deals with keystore functionality, and that there is no 'hidden' code running on the device that was never published or requested before. If it turns out we can't bring the keystore bug under Motorola/Lenovo's attention, we should try to fix it ourselves in the device trees of LineageOS.
[Motorola Edge 40 Pro  / Moto X40 (China)] shamanoid:
sry for noob question, but what is keystore?

does it work on the x40?
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
CTRL + F on each page number
[Motorola Edge 40 Pro  / Moto X40 (China)] zlebors:
New RETCN firmware from lollinet

XT2301-5_RTWO_RETCN_13_T1TR33.4-30-77_subsidy-DEFAULT_regulatory-DEFAULT_CFC.xml
[Motorola Edge 40 Pro  / Moto X40 (China)] shamanoid:
just found talk about the crashes, but not what keystore does

did I miss something?
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@shamanoid https://developer.android.com/training/articles/keystore

@zlebors I believe that is the RETCN equivalent to RETUS 33.43-48-35 as RETUS/RETEU/RETCN all use different firmware release version numbers lol... It's bad enough they have different names... but maybe just like, the 2nd set of digits or something be different instead of everything? oof
[Motorola Edge 40 Pro  / Moto X40 (China)] zlebors:
one thing for sure that I noticed, not all Google services included in the RETCN Rom as I could not get Google Maps Location History enabled.. other than that I have no complain.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@zlebors that is because China has an embargo on Google services, so that is why no China ROMs come with full Google Services
[Motorola Edge 40 Pro  / Moto X40 (China)] zlebors:
yes, actually I prefer RETCN Rom but need to figure out how to enable full Google services .. either by flashing gapps or other method I have no idea.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
A new test build is going up! It might be ready in 15 minutes or so. ineage-20.0-20230911-UNOFFICIAL-rtwo contains vendor blob updates from RETUS T1TR33.43-48-35 and also major changes to the Carrier Config to remove all Motorola thresholds which is probably affecting RETUS users.

LineageOS for rtwo - Browse /lineage-20/lineage-20.0-20230911-UNOFFICIAL-rtwo at SourceForge.net

LineageOS for rtwo (Motorola Edge 40 Pro / X40 / Edge Plus 2023)

sourceforge.net
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Thanks @ThE_MarD! I will try this build to see if it improves the telephony on edge+.

I'm using RETUS - RTWO_G_T1TR33.43-48-35_subsidy-DEFAULT_regulatory-DEFAULT_cid50 as base but can't get LOS to boot now (bootloops after the lineageOS logo loads), maybe something wrong with my flashing. I'll try it again later today.

Update: using RETEU - RTWO_G_T1TRS33.43-20-28-2_subsidy-DEFAULT_regulatory-DEFAULT_cid50 as base also fails into a black screen. The device doesn't even pop up on ADB, so I can't grab any logs. I will try to roll back to an older LOS to see if it's my device that's having issues or something in this build is not working on edge+.
[Motorola Edge 40 Pro  / Moto X40 (China)] Gianluk99:
Sorry for the dumb question, if i flash this rom on the x40, so the chinese version will i be able to change language to all languages or still only chinese and english ?
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
LineageOS supports many languages, from which you'll be able to pick

Btw @jimmie32, it works fine on Edge 40 Pro, let's see if we can get another Edge+ (2023) owner to verify
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
I got confirmation on Telegram from an Edge+ 2023 user he has signal and data on the new build!

That means the only 2 major bugs left is LHBM for UDFPS and SELinux permissive

@jimmie32 I'd recommend only updating baseband and not bootloader. Doing so causes bootloops.

You will need to flash full firmware and factory reset. Then boot stock ROM.

Then you can retry to switch to custom ROM again
[Motorola Edge 40 Pro  / Moto X40 (China)] jimmie32:
Thank you @ThE_MarD! Looks like I had to boot into the updated RETUS ROM first then flash lineageOS. In the afternoon I just flashed and went into recovery to adb sideload right away and it would bootloop.

Update: Telephony works!!! Yes!! Thanks so much the hard work. Now I can start setting this up as a daily driver :D
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
I updated the first post with vanilla BSG GCam APK recommendation from @mxz55 (y)

I'm also going to test including RETUS latest device firmware on my device as it seems like the safest option for us since RETUS device firmware works fine on RETEU and RETCN devices and will eliminate the keystore crashing issues if a user hasn't already upgraded to the latest device firmware.

I'll also keep trying to plug away on SELinux Enforcing to try and figure out what's preventing it from working too

LHBM for UDFPS might be a bit tricky though, so that'll take a little more time to solve in our kernel modules
[Motorola Edge 40 Pro  / Moto X40 (China)] ryansff:
Just adding my experience with the latest test build from 9/11. My Edge+ 2023 is now fully functional, mobile data seems stable and no reboots or crazy battery drain so far. Thank you so much! I'll keep using this until crDroid gets this mobile data patch then I might switch.
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
With the latest LineageOS build and latest fw (RETUS T1TR33.43-48-35) on my Edge 40 Pro, im getting insane Geekbench scores:

https://browser.geekbench.com/v6/cpu/2579558
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
New test build is going up! It might be ready in about 30 minutes... lineage-20.0-20230912-UNOFFICIAL-rtwo contains the vendor blob update to RETUS T1TR33.43-48-35 and the major changes to Carrier Config and also SELinux Enforcing. Please test all functions! If anything is broken I'll need logcat please as it could be SELinux related

Also, this build includes device firmware from RETUS T1TR33.43-48-35 to prevent any keystore crashes for users. I know it works on RETEU like mine, but someone with RETCN please confirm with this build that it boots and everything works

LineageOS for rtwo - Browse /lineage-20/lineage-20.0-20230912-UNOFFICIAL-rtwo at SourceForge.net

LineageOS for rtwo (Motorola Edge 40 Pro / X40 / Edge Plus 2023)

sourceforge.net
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Even if testers feel the SELinux build is stable, please leave that as feedback, so those that are daily driving the device will know if it's safe to update

Generally speaking we're almost there, fixing UDFPS under typical brightness conditions is the main thing to work on for official LineageOS status egilibility
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
I just realized that I also did include device firmware in that latest posted test build from RETUS T1TR33.43-48-35 to prevent keystore issues for any users and also make the device firmware match the version that our vendor blobs are on as well.

I thought I didn't have it prepared in time to be included on the build, but I double-checked and it's in there so I guess I did get it ready fast enough heh

I have updated my post to reflect this. I know it works on my RETEU and jimmie32 just mentioned his RETUS boots it, so just need to check with a RETCN user that it'll work fine for them too :)

@jimmie32 , that's good to hear so far so good for you as well (y). The scores could be lower as I'm using the basic thermal-engine config from rtwo and not a custom one for gaming or perf, so I could try to swap to the perf rtwo config and see how that one fares?
[Motorola Edge 40 Pro  / Moto X40 (China)] Krullendhaar:
That is ridiculous. For comparison, these are the top performing phones for single core in Geekbench 6:
[Motorola Edge 40 Pro  / Moto X40 (China)] zlebors:
I'm using RETCN, I'll try it tonight (GMT +7)
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Well, apparently, when we remove all *** from a Snapdragon 8 Gen 2 device (by using lightweight LineageOS), this is what we get. At 5400 we're also on top of the flagships with multi-core scores, if you don't count all the artificial results, as the top score is tainted by non-mobile ones, ice cooled overclock experiments and spoofed results where they manipulated data sent back to Geekbench

We really have the best performing flagship in our hands with LOS, so you can see how efficiency tends to be bottlenecked by bloat and bad software from vendors. Btw, it appears that Apple continues to lead for single-core performance, due to Bionic characteristics, but right after them we are leading all Android devices.

Last note, im not running our new SELinux enforcing build yet, so I can't tell if performance is worsened by it like jimmie's score indicates or that it's something on his device. All that's clear is that on the second-last build, the Edge 40 Pro is an absolute monster.
[Motorola Edge 40 Pro  / Moto X40 (China)] Drasner:
I installed the last LOS in a Moto X40. Apart from the known issue of the fingerprint not working when screen light is not dim, I've not seen anything else. GPS works. Tomorrow I'll try to test more.
[Motorola Edge 40 Pro  / Moto X40 (China)] zlebors:
I have issue with adb, I never had this issue before

edit: solved
[Motorola Edge 40 Pro  / Moto X40 (China)] MachampsFifthArm:
Does eSim work and also does it work dual sim with the Physical Sim? VoLTE? VoNR? NR Carrier Aggregation?
[Motorola Edge 40 Pro  / Moto X40 (China)] clubwagon:
Hi guys . i bought the moto edge plus 2023 from boost mobile.

T1TRS33.43-48-21-2

Can i install this lineage os that you are making?
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Short answer: Yes, absolutely

Long answer: Yes, even though your firmware version isn't latest, our current build will automatically load the latest (see this post for how it's done)

At most, if you really just bought it, you'll need to wait between 1 and 2 weeks for bootloader unlock to become non-grayed out after performing the Motorola bootloader unlock procedure to get your unlock code
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
Heyyo, I added two more bugs to the bugs list

Some apps can't take photos like Facebook Messenger, WhatsApp and Telegram yet some other apps work

Screen tearing using certain apps or even recent apps

Markus made a bunch of updates to our trees and I'm trying to build them but I'm hitting some errors which hopefully can get resolved asap

Also, can someone please test eSIM and also dual sim?
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
New test build is up! lineage-20.0-20230918-UNOFFICIAL-rtwo contains a crapload of changes thanks to Markus! LHBM for UDFPS is fixed via a kernel display-driver module, switched to source-built dtb/dtbo and of course it still has selinux enforcing and the device firmware from RETUS T1TR33.43-48-35 and vendor blobs and also the carrier config fixes

LineageOS for rtwo - Browse /lineage-20/lineage-20.0-20230918-UNOFFICIAL-rtwo at SourceForge.net

LineageOS for rtwo (Motorola Edge 40 Pro / X40 / Edge Plus 2023)

sourceforge.net

Pretty exciting! Really the only issue left on LineageOS is how to deal with the IPACM/libipanet, the camera not wanting to work in some apps and some graphical glitches

I did try to build without the pending frameworks av commits and camera issue in some apps still exists and seems to be only when taking pictures as videos seem to work

Oh, one rtwo Telegram user mentioned eSIM works and another dual sim works too
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Awesome, and props to SGCMarkus for continuing to polish things. Looking forward to official status!

For who doesn't know the meaning of UDFPS: fingerprint scanner, it's fixed now. I also like how smooth it is, it recognizes the print really fast
[Motorola Edge 40 Pro  / Moto X40 (China)] Drasner:
I have a dual sim x40 so I will download the new files and will test with two sims in the next days.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@mxz55 also for UDFPS, if you go into settings > gestures you can enable screen off fingerprint sensor. Then, you can just place your finger on the sensor with the screen off and instantly unlock your phone (y)
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Somehow, on the new build battery life is much better. My scenario has been 165hz refresh rate, extra high polling rate and using the screen at a high polling rate, since the very beginning.

Both while in use and standby, it's much more power efficient
[Motorola Edge 40 Pro  / Moto X40 (China)] Drasner:
I have tested the new build with 2 SIM cards and it seems to be working fine. I have made calls using both sim cards fine. Mobile internet works in one, but not in the other, although this second one always gives me issues on new phones so it might not be necessarily LOS fault. I'll pass by the carrier shop to see if it is an issue on their end and report back.

I am eager to switch to this new phone as my daily driver since you guys have done such a great job so quick. I am wondering when can I expect to be able to upgrade LOS without having to factory reset, so I can switch everything over and start daily driving the phone.
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Besides dual sim, we need someone to test eSIM
[Motorola Edge 40 Pro  / Moto X40 (China)] mxz55:
Dirty flashing is no problem, you just gotta sideload each LOS release over the previous one (and flash all corresponding img files in fastboot), then sideload MindTheGApps also before first boot. So upgrading is essentially following partial installation instructions, and all apps & data is preserved. I've done it time after time when we get a new build.
[Motorola Edge 40 Pro  / Moto X40 (China)] ThE_MarD:
@mxz55 an rtwo user on Telegram confirmed eSIM works fine for him and his is an Edge+ 2023
[Motorola Edge 40 Pro  / Moto X40 (China)] Jackdm1:
Does this LOS work with microg? Trying to avoid using gapps
[Motorola Edge 40 Pro  / Moto X40 (China)] Soketto:
Finally got around to getting this on my x40, so far everything I use runs with no issue. Thanks again for working on this :)

Yes I had no problem setting this up, I rooted by adb sideloading magisk then used a package to install microG (in this case minmicrog, there are others). I did also have to enable signature spoofing with Lsposed and FakeGApps to tick all the self check boxes.
[Motorola Edge 40 Pro  / Moto X40 (China)] Jackdm1:
Thank you for confirming, I use minmicrog for the device I currently use. Also I enable spoofing using terminal cmd app. I will be receiving the Edge plus in late October, can't wait.