yashsingh1/xdaforums huggingface dataset:
[Lenovo Legion Y700] Isrgish:
This is based on @LSS4181 work on TB-Q706F. Thanks to his work and a great deal of help, I have been able to progress on this TWRP development.

Additionally thanks to the devs of twrpdtgen utility which is very useful for obtaining some very helpful information about the device from a stock recovery image.

The recovery is currently flashable and has a functional adb access. As of now I have not been successful with the GUI interface. You can only use the TWRP command line script. Refer to TWRP Command Line for the available options.

I would appreciate any help that can be provided for troubleshooting why the GUI isn't working.

I haven't tested if decryption works but I highly doubt that it does work. My understanding from others who have built TWRP is that a lot of work is required to make it work. My data isn't encrypted so this isn't a priority for me.

I tested the following and they are working: Backup, Restoring, Wiping, MicroSD card. But only with command line script.

Device tree: twrp_device_lenovo_9707F
[Lenovo Legion Y700] Isrgish:
Reserved
[Lenovo Legion Y700] Isrgish:
@LSS4181

I was using your device tree all along. Now I replaced all the files in vendor but it didn't help.

I checked and I see that the files you have in recovery/root/system are on my device in `/vendor` in different folders. I was thinking to replace them with the ones from my device. I'm just wondering if I should place then in recovery/root/system or in vendor according to where they are on my device.

I had looked at this device tree but wad not successful in getting a working twrp. After building it the output directory showed ad Q706F. I;m thinking that they used your tree abd just renamed it without changing the images.

I changed whatever I thought was relevant but I may hace missed something I;m attaching my BoardConfig.mk if you gave a chance to look.

I have read fully the first 40 pages and the last 50 pages besides extensive searching the rest. This wss a while ago but from what I remember I didn't see anything relating to the display. I will do some more searching to see if maybe I missed something.

Thanks again for all your help.
[Lenovo Legion Y700] LSS4181:
Interesting... so the other tree was using the same approach and thus hit the same wall...

These libraries are indeed in different folders in /vendor. It's been a while since I touched the tree... if there are some libraries you cannot find in /vendor, you probably need to additionally look into /system or /system_ext.

If things like BOARD_KERNEL_CMDLINE are the same as what in the twrpdtgen-generated tree (extracted from stock recovery)... maybe anyone with an actual device and experience in debugging android stuffs could help?
[Lenovo Legion Y700] dla5244:
II looked into a few things to solve this problem.

And I discovered that the librecovery_ui.so library file was the key to solving graphics problems.

I replaced the librecovery_ui.so file among the Pixel tablet's recovery files and was able to experience graphics issues as before.

And as a result of disassembly, it was discovered that the DRM initialization routine was different from the existing AOSP source.

I guarantee that this file plays a big role in the normal operation of recovery.

Unfortunately, it seems impossible to solve this problem with my skills.

I have uploaded the librecovery_ui.so file for stock ROM and Pixel tablet to this post.

I hope we can work together to achieve our goal of normal operation of TWRP recovery.
[Lenovo Legion Y700] Isrgish:
Where is this file coming from? Where should we be putting it? I don't have such a file in my device tree nor in my device.
[Lenovo Legion Y700] dla5244:
One was extracted from Pixel Tablet stock recovery and the other was extracted from 15.0.342 stock recovery.

This file can be tested by renaming it to the path below.

/system/lib64/librecovery_ui.so

You can test it by inserting this file in recovery mode.

ex)

Boot to stock recovery

(You need to modify adb to make it work)

adb push librecovery_ui-pixel.so /librecovery_ui.so

adb shell

stop recovery

mv /librecovery_ui.so /system/lib64/librecovery_ui.so

start recovery

You will see a recovery screen with broken graphics, just like when testing with twrp. With this, it has been verified that the answer is in the librecovery_ui.so file.
[Lenovo Legion Y700] Isrgish:
The one form 15.0.342 stock is this from TB-9707F or id it also from Pixel Tablet? How did you get this out of the stock recovery? Does the 14.0.286 recovery also have this file?
[Lenovo Legion Y700] dla5244:
The file also exists in 14.0.286. Most files are included if it is based on AOSP stock recovery.

Since the stock recovery is built based on AOSP stock recovery, the source code is similar to that of the Pixel tablet.

I extracted the ramdisk from the recovery image and got the corresponding files. Then I changed it using adb and tested it.
[Lenovo Legion Y700] Isrgish:
If I understand correctly I should put the librecovery_ui.so file into system/lib64.

I tried this but I don't see this helping at all.
[Lenovo Legion Y700] dla5244:
This file only works with aosp-based recovery.

I uploaded the librecovery_ui.so file to prove that it is the core of the recovery graphics.

To solve this problem, it seems that the librecovery_ui.so file must be disassembled and analyzed.
[Lenovo Legion Y700] Isrgish:
This is something that I know nothing about. Do you know of any tutorial I can look at to try and learn about this?

BTW, Why do other recoveries work without this file? Even Lenovo tablets work without this file.
[Lenovo Legion Y700] dla5244:
Unfortunately, this requires knowledge of assembly language. So it seems like a very difficult task.

You can analyze this library file using the ARM disassembler program.

The tutorial seems so comprehensive that it's hard to find.

The Y700 stock librecovery_ui.so file appears to have been modified from the AOSP recovery library source.

This modified part is key. Graphics initialization code is included, but it is a bit difficult to analyze.

Other recoveries (TWRP) use the libminuitwrp.so file instead of the librecovery_ui.so file.
[Lenovo Legion Y700] Isrgish:
@LSS4181

If you can take a look at the quoted text above. Do you have any idea if and how to go about this? I don't even fully understand what @dla5244 is saying. I'm always willing to learn and try new things but I need a starting point.
[Lenovo Legion Y700] LSS4181:
So it seems this tablet is using a different graphics init routine from the usual AOSP compatible hardware. As such, you'll encounter display issues when running pure AOSP stuffs which applies to TWRP and others.

I'm not an expert on ARM64 disassembly... You can try Ghidra which appears to be able to disassemble the librecovery_ui.so file and can at least enable inspecting of functions related to drm. You can at least have a look at the decompilation to gain a rough understanding as well as adding your own annotations (like possible variable names and types) to try to connect the pieces together. Original AOSP source code for this library could also provide some helpful hints such as function prototypes and what the local variables actually are for, as well as figuring out where and how the code were changed compared to AOSP.

To fix, you need to find out the differences in the graphics init routine compared to AOSP, and modify the related source code for building TWRP's libminuitwrp.so accordingly.
[Lenovo Legion Y700] Isrgish:
@LSS4181

Is it possible to get the source code from Lenovo?
[Lenovo Legion Y700] LSS4181:
The project generating the library in question would be android_bootable_recovery, which I think is Apache2.0 licensed.

IANAL, from what I read here, Lenovo doesn't have to release the actual source code but you could probably ask them about changes they made for the version used in the particular hardware.

Emphasis added.
[Lenovo Legion Y700] Isrgish:
I will try to contact them and see what I can get from them. I remember seeing somewhere that it is possible to get the source code for certain things but they give a hard time providing it.
[Lenovo Legion Y700] Smashup9492:
Hi, does anyone know where the image for TWRP is? Also can I temporarily boot into this imgae of TWRP without replacing the stock recovery?
[Lenovo Legion Y700] Isrgish:
You can use the TWRP found at unofficial twrp 3.6.2 Root Lenovo Legion Y700. This TWRP can only be used with the command line. Take a look at TWRP Commandline Guide for usage info.

I heard that you can boot to it but I wasn't successful in being able to do it.
[Lenovo Legion Y700] Bocchi_Renewed:
do you know why display is broken?
[Lenovo Legion Y700] Isrgish:
It seems that Lenovo has changed the code for the librecovery_ui.so file and therefore the TWRP libminuitwrp.so file that is used for the UI in TWRP doesn't match what the device is expecting. This seems to be causing the UI problems. Take a look at Post 13 and a few posts following (as well as a few post before) to get an idea of what we are facing.

I have no knowledge about these kind of issues and haven't had the time recently to look into it. Maybe you can or know someone that can.
[Lenovo Legion Y700] Rstment ^m^:
Can you advise me what to ask from Lenovo ?

I am about to send them a request for source code but I am not a developer nor do I know what is needed to make a proper Recovery + OS ... Is kernel source code enough for this?

I am thinking about asking for kernel source in it's entirety + whatever falls under the free license inside their ZUI 13

Is there anything else I should ask for? ( Support for functions like pen is inside the kernel? Or inside the OS ? )
[Lenovo Legion Y700] LSS4181:
Honestly I never made formal inquiries to them for source code and other questions... so I'm afraid I won't be able to help you too much here.

You should be able to just ask for the kernel source since it's GPLv2, but I can't be sure about others. In this device's case, you may consider asking a bit about how display initialization in recovery differs from AOSP, but I can't be sure if they can give you the answer you seek.

Kernel source code is necessary, but that alone is not enough. You need to look for more information about your device to be able to make a complete device tree. It's the device tree's job to make the necessary configurations for a given hardware, as well as decide how the kernel should be built.

...

And the most important part -- vendor tree. It involves finding and listing proprietary blobs from stock ROM, as well as analyzing what really need to be extracted from stock ROM, and what are to be built alongside the ROM you're bringing up.

I've been looking for some convenient ways to do this for quite a while, yet I haven't found anything that could help with this. If a device has a LOS bringup, in most cases you can just use that. If not... most likely you'll have to do it by hand and it's not a trivial task that can be finished within a short timeframe...
[Lenovo Legion Y700] Lucacass:
all commands are confusing to understand how to use them on this page I tried to use them and it gave an error in all commands in TWRP
[Lenovo Legion Y700] Isrgish:
Show what you tried (from the beginning of a session). and what error message your are getting.
[Lenovo Legion Y700] hopeeeeee09:
Hope version 2023 have TWRP like version 2022 xD
[Lenovo Legion Y700] Bocchi_Renewed:
same problem
[Lenovo Legion Y700] hitin911:
https://gitgud.io/Van-Firmware-Dump...0.240_ST_240411-release-keys/twrp-device-tree here is a source for 2023
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
​

*** Disclaimer
* Your warranty is now void.
* I am not responsible for anything that may happen to your phone by installing
any custom ROMs and/or kernels. (Bricked devices, dead SD cards,
thermonuclear war, Seal mad or you are getting fired because the alarm app
failed…)
* YOU are choosing to make these modifications, and you do it at your own risk.
if you point the finger at me or anyone else for messing up your device, you haven't
done what we told you to do.
* Please do research if you have any concerns about features included in your ROM

What is this?

crDroid is designed to increase performance and reliability over stock Android for your device also attempting to bringing many of the best features existent today.

Whats working?

Wifi

RIL

Mobile data

GPS

Camera

Flashlight

Bluetooth

Fingerprint reader

Face unlock

Lights

Sound / vibration

Integrated KSU

Known issues

You tell me​

Instructions

Flash recovery via fastboot

Boot to recovery (Vol UP + Power)

Format Data (backup sdcard before format) if MIUI was previously installed

Flash ROM via adb sideload

Optional: Flash Gapps (MindTheGapps-14.0.0-arm64 is recommended) via adb sideload

Reboot

Downloads

Builds & recovery: https://sourceforge.net/projects/crdroid-xiaomi-9-se/files/crdroid-10/

Source

https://github.com/Rocky7842/android_kernel_xiaomi_sdm710/tree/lineage-21/

Contributors

Rocky7842

LineageOS official maintainers for the original trees.

crDroid Android team

Support me

Donate through PayPal: https://www.paypal.com/paypalme/EricRocky7842

Buy me a coffee: https://buymeacoffee.com/rocky7842

PM me to donate through Alipay.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
Important Notes

Dirty flash from crDroid 9 is fine, but a clean install is always recommended.

Remember to backup your files before install.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
New BETA build uploaded.

Major change:

- Security patch date is now 2023-11-05.

- Update KernelSU to v0.7.1.

- Some missing features were added.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] walkman-610:
Thanks for the firmware,I updated from the previous build with a flash drive, the built-in bootloader saw the update, but did not download it
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
Ops, I know what's the problem. Will fix it.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
Wait a sec, I just checked it and it seems not configured wrong. Don't know what's the issue then. Maybe it's on your side?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] walkman-610:
Perhaps, but everything is fine)
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] walkman-610:
I also found a bug: when adjusting the volume, the slider moves, a reboot helps, but not for long

Spoiler content hidden.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
Yup, source issue. I think it'll be fixed in future release.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] kokos731:
Great rom. Thank you.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] max_artman:
Thanx for your great work! I've testet the ROM now for a week and I'm more than satisfied. I also experienced that the battery lasts longer.

Only thing I've noticed is that Voice over WiFi isn't working. Can anyone confirm this?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
You may want to describe the issue more clearly than "isn't working", so people can verify it better.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] steevenapple:
for installing i have error 1 ....
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] steevenapple:
I'm just stupid, sorry, I wasn't born blessed! Just extract the recovery and flash it first XD
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] max_artman:
The VoWiFi-Icon isn't showing up and calls via WiFi are not possible (however VoLTE works without problems)
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] steevenapple:
After 24h use, the GPS does not work.... It only works ONLY with Google maps if there are no other applications desperately trying to use GPS
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] steevenapple:
Okay, a quick summary of my problems:

GPS which is not detected by several apps

Song that pauses by itself or changes title by itself on bluetooth

Poor graphics performance (if I compare to LineageOS)

Very low 4G speed (I'm picky about that)

Fast charging does not work (limited to 10W instead of 18W which is provided on the MI 9 SE)

I am sorry but for me this version is still in Alpha, a beta version is a version which can be used daily but which may present some temporary bugs, if I also add the various problems listed by other members for me this version does not is not yet complete and cannot be used daily.

It's a shame because I didn't know about crDroid, quite a bit of customization compared to LineageOS, the Always On Display is nice with the charging information, unfortunately I'll have to go back to LineageOS.

Thank you anyway for this work
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
I mean, if you're ok with A13, crDroid 9 is there and is stable.

BTW, I'm not the one decide if we're releasing alpha or beta or something else. crDroid team named it by the completeness of the sources. And, tbh, I'm pretty sure I don't have most of the problems you've mentioned too.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
Mine is working perfectly fine.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] max_artman:
Hi steevenapple!

I can't confirm the most of your problems:

- GPS works for me as expected

- I'm listening to music via Bluetooth every day and never mentioned anything like that

- can't tell anything about graphics performance, 'cause I'm not playing games on my phone

- never expirenced slow 4G speed

- i just testet fast charging and I also didn't get more than 11W

Have you done a clean install?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] steevenapple:
Yes I did a clean install,

The GPS itself works (because I tested it with a GPS test application) but most applications do not find a signal.

The applications that I tested and which do not find a GPS signal are:

Snapchat

Uber Driver

Deliveroo Rider

GasoilNow

Speedtest

And those who manage to find them are: (Provided that there is not one of the previously mentioned apps open because otherwise the applications that I go to will not find the GPS either)

Google Maps

Waze

GPS Test

Speaking of Speedtest after noticing the slowness of 4G I did several tests in several places during the day, I did not exceed 1.5Mbps, now that I have returned to LineageOS, everything is back to normal.

just for info, i have an eea version
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
New build uploaded.

Major change:

- Security patch date is now 2023-12-05.

- Fix some audio related issues.

- Switch to AOSP offline charging animation. (It finally shows percentage.)

- Add fingerprint override.

- Some missing features were added and some bugs were fixed.

Note:

This is the initial formal (non-beta) release. It is recommended to do a clean install.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] walkman-610:
Updated over beta, but the volume slider also goes to the center. Who is completely clear whether there is such a thing or not?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
There's no need to report this here. This is an issue from source that may or may not get resolved yet.

Try to clear cache or/and clean install to see if it's still there. If yes, sorry it's not yet resolved.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] amihftm:
Every thing in this rom is Ok except something I encounter today, I don't notified about incoming calls.

When somebody calls me, my mi-band notify me but screen of phone is off. When I turn it on, still the Phone app is not showing, I should open notification panel and answer call from there.

(I'm using Google dialer from nikGapps which is updated by play store)

Edit: sorry DND was on😅
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] ABC00012345:
Did this work from miui 12.5.1.0 (RFBEUXM) Android 11. After installing, can I go back to miui, or can I install lineage os or something similar on it?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] ABC00012345:
And will telephony service work and will the battery hold longer?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] samsungtab3:
Hi! I flash this rom and so far so good. I don't have big problems, just one thing or two..

First, I don't know why, I downloaded the phone and message apps from google but I can have my messages or my contacts, it doesn't sync this app at all and I don't know what I can do it to force it..

Second, when I downloaded Whatsapp, I already have my google account on the smartphone and when Whatsapp asked me to give permission to restore some backup from drive, when I gave permission, I need to select the account or add a new on, and I don't know why, it is like Whatsapp doesn't recognize my Google account, so I try to add it and I have a message saying to me that the account already exist on the smartphone and cannot do anything more, only ignore this part of the restore of the drive backup..

And third and the last one, I have this errors in the image when I flashed the rom, don't know if it is a big deal but right now I am not sure if this ate causing me big troubles..

But besides this problems with google account, that I want to have it solved, everything is fine for now!

Thanks a lot for your work, effort, support and to keep grus alive! 😃😃😃
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] IbenLarsen:
Hi, thank you for your work. Is signature spoofing working? I can't find it anywhere, and on Signature Spoofing Checker says: DISABLED.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
I doubt this is an issue. You can try:

1. Use crDroid recovery to wipe /system.​

2. Flash the ROM.​

3. Reboot to recovery again.​

4. Flash GApps.​

5. Format data and reboot.​

It's working on my device so I don't know.

I've experienced this on alpha and beta release in google translate. But now, for me, it's fixed. Don't know about WhatsApp though.

Which GApss you using?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
I've heard that crDroid team has not yet fixed it in this version. I think it'll be working in the next one.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] samsungtab3:
First of all thanks for the reply!

1)The gaps that I flashed are the gaps that are here with the rom, the MindTheGapps-14.0.0-arm64.

2)I already solved the whatsapp problem, now I'm already be able to restore my whatsapp backup from google account! I had another problem, I was not able to login on the mbway app, so I thought that could be something related with the gaps, so I flashed the Nikgaps, the omni version and solved the problem of mbway app and the whatsapp but I continues to have the phone and messages app restore problem, don't restore anything, may be I need to flash one version more complete of the gaps no ?

3) The other problem is that I cannot see anymore the system and vendor partitions on the wipe menu, so how can I do a clean flash for the gaps ? Or for the ROM if I need it ? I saw that is something related with a super partition with sub partitions like system and vendor, something related with a change that google made, do you know who can I fix this ? Because if I cannot see the system partition, I cannot flash anything more right ? Just dirty flashes that almost the time will give problems, errors, and bootloops..

You can see my wipe menu on the twrp on the image. I have the twrp 3.7.0_12-0 Rocky7842. Do you know what can I do to have the system partition on the wipe menu ?

Thank you very much for the support :)
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
About GApps, I think you can only wait till developers solve the issues.

Use crDroid recovery to wipe /system. Until now, TWRP do not provide the option when using dynamic partition.
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] samsungtab3:
Ok, may be I will try to wait for the fix por I will try to flash other gaps. Which gaps do you flash ?

The CrDroid is this on the image ? The file who are with the build file right ?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] samsungtab3:
Do you know if I need to flash it or I can just boot it with fastboot ?
[Xiaomi Mi 9 SE ROMs, Kernels, Recoveries, & Other ] Rocky7842:
I think you can boot it.