yashsingh1/xdaforums huggingface dataset:
[Xiaomi Mi MIX 4] vamsi209:
niceee, so for mix 4, i extracted the twrp trees using this,

https://xdaforums.com/t/script-twrp-device-tree-generator.4085463/

setup the local repo for building twrp trees, using these

1. Installing the tools

A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen

github-wiki-see.page

tried building but the device doesn't lunch after following the steps shown above,

http://www.hastebin.com/jonexiyowu.md

and one of the dev https://github.com/imjyotiraditya , helped me build an aospa rom for g8x,

now he is on to building twrp for our device odin.

if anyone has twrp trees, we can try geting aospa build ready for our device :)
[Xiaomi Mi MIX 4] SanHelios:
hey, i'm trying it right now... was able to manage a device tree from the latest weekly of the EU-rom. Repo is syncing right now for the aosp-twrp-11 repository.
[Xiaomi Mi MIX 4] vamsi209:
U used the same script for the recovery trees?
[Xiaomi Mi MIX 4] SanHelios:
yes, i extracted it from the boot.img.

Update... build/envsetup.sh error, anyone any suggestions?

Update managed to get envsetup.sh to work, got following error messages

source build/envsetup.sh

including device/xiaomi/odin/vendorsetup.sh

COMMON_LUNCH_CHOICES: Befehl nicht gefunden.

COMMON_LUNCH_CHOICES: Befehl nicht gefunden.

lunch twrp_odin-eng

In file included from build/make/core/config.mk:291:

In file included from build/make/core/envsetup.mk:266:

build/make/core/product_config.mk:155: error: Can not locate config makefile for product "twrp_odin".

23:22:04 dumpvars failed with: exit status 1

WARNING: Trying to fetch a device that's already there

Traceback (most recent call last):

File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 431, in <module>

fetch_device(device)

File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 399, in fetch_device

git_data = search_gerrit_for_device(device)

File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 86, in search_gerrit_for_device

device_data = check_repo_exists(git_data, device)

File "/home/dave/AOSP-Recovery/vendor/twrp/build/tools/roomservice.py", line 62, in check_repo_exists

raise Exception("{device} not found,"

Exception: odin not found,exiting roomservice

In file included from build/make/core/config.mk:291:

In file included from build/make/core/envsetup.mk:266:

build/make/core/product_config.mk:155: error: Can not locate config makefile for product "twrp_odin".

23:22:05 dumpvars failed with: exit status 1

** Don't have a product spec for: 'twrp_odin'

** Do you have the right repo manifest?

Anyone a good guess?
[Xiaomi Mi MIX 4] Puksom:
Did you had any luck, or any chance I can help?
[Xiaomi Mi MIX 4] SanHelios:
well, i made some progress, but i failed again. I posted a thread in the official twrp forum. Maybe you might want to take a look at it.. thx.

Post in thread '[DEV]How to compile TWRP touch recovery' https://xdaforums.com/t/dev-how-to-compile-twrp-touch-recovery.1943625/post-85686505
[Xiaomi Mi MIX 4] SanHelios:
I'm a total beginner, so i might be wrong. But as far as i can tell, the makefiles of the extracted device tree need to be update or even completely rebuild.
[Xiaomi Mi MIX 4] radoinc:
Hi, it seems like I was able to execute the script successfully.

It didn't work on Windows because it got stuck on the execution of unpackimg.bat.

I ran it on Linux and it worked (after chmod 777 of boot.img). This is the command I ran:

python3 -m twrpdtgen -o ./odin ./boot.img

output:

TWRP device tree generator
Version 1.3.0

[INFO] Cloning AIK...

Done! You can find the device tree in odin/xiaomi/odin

I took boot.img from the latest MIUI 12.5.7.0 China Stable

Now I have what it seems to be the device tree (odin.zip) but I don't know what to do it it or what it is.
[Xiaomi Mi MIX 4] SanHelios:
This is great, so we know this script works and does what it is supposed to do...

I checked the makefiles to see if there are any differences, but there are none. So it suggests that it doesn't matter, from which version you get the files from. I love, that the users of the Mi Mix 4 are more open so compiling than the community of the MI 11 Ultra is..
[Xiaomi Mi MIX 4] radoinc:
I'm trying to replicate your steps but I get the same "Can not locate config makefile for product "twrp_odin"." as you did above. In the other topic I see you managed to get past that step.

I see you get some output after executing envsetup.sh and it seems like this is related to the device tree.

Can you please share what you did with the device tree before attempting to compile twrp? I'd like to try myself but I can't find clear instructions.
[Xiaomi Mi MIX 4] SanHelios:
Acutally i left it completely unchanged, the only thing i did was to change the repository. I deleted the aosp-repository and took the omni-twrp-repository

(https://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni)

mkdir twrp

cd twrp

repo init -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_omni.git -b twrp-10.0

repo sync

after syncing was complete, i followed these instructions

4. Build TWRP from source

A Python library/script to automatically generate TWRP-compatible device tree from a boot/recovery image - twrpdtgen/twrpdtgen

github-wiki-see.page
[Xiaomi Mi MIX 4] radoinc:
Thanks! Now I managed to get the same result as you. The error seems to be raised by mkbootimg.py:

def write_header(args):
BOOT_IMAGE_HEADER_V1_SIZE = 1648
BOOT_IMAGE_HEADER_V2_SIZE = 1660
BOOT_MAGIC = 'ANDROID!'.encode()

if (args.header_version > 2):
raise ValueError('Boot header version %d not supported' % args.header_version)

To me it seems like this Omni repo includes old version of mkbootimg.py, because in the google repos I can see that the current version of this function looks like this:

def write_header(args):
if args.header_version > 4:
raise ValueError(
f'Boot header version {args.header_version} not supported')
if args.header_version in {3, 4}:
return write_header_v3_and_above(args)

It seems like Boot header version 3 was introduced with Android 11: https://source.android.com/devices/bootloader/boot-image-header

I think we can't do much with the Omnia repos until they get updated with current mkbootimg.
[Xiaomi Mi MIX 4] SanHelios:
My question is, do the makefiles from the devicetree need to be adjusted or completely rebuild to android 11 parameters? I.e. rhe command "add_lunch_combo" is obsolete and "COMMAND_LUNCH_CHOICES" took its place..

Sorry in advance for this nooby questions...
[Xiaomi Mi MIX 4] vamsi209:
how far did you guys go for getting twrp up for our device?
[Xiaomi Mi MIX 4] radoinc:
Maybe, but I still think the Omni source is a dead end. Notice that the About on the github page says:

Minimal manifest for building TWRP for devices shipped with Android 5.1 through Android 10
[Xiaomi Mi MIX 4] SanHelios:
Funny, now that you mention it, i realize it now too... Looks like a bit of a challenge...
[Xiaomi Mi MIX 4] Puksom:
Don't we need this https://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp as that one is stated to support android 11

GitHub - MiCode/Xiaomi_Kernel_OpenSource at odin-r-oss

Xiaomi Mobile Phone Kernel OpenSource. Contribute to MiCode/Xiaomi_Kernel_OpenSource development by creating an account on GitHub.

github.com
[Xiaomi Mi MIX 4] SanHelios:
Already tried it with the AOSP-repository... here's what the system gave me back

https://xdaforums.com/t/propietary-blobs-files-for-odin.4336423/post-85673585

maybe i need to use the odin-kernel, since the prebuilt-kernels are not recommended
[Xiaomi Mi MIX 4] Puksom:
Ah ok. From what I saw on Zulip dev channel A11 TWRP is almost ready for release
[Xiaomi Mi MIX 4] radoinc:
I was able to get

#### build completed successfully (29 seconds) ####

with the AOSP repo and some modifications in the device tree files. However I can't find boot.img (or I don't know where to look at).

Here's what I did:

repo init --depth=1 -u git://github.com/minimal-manifest-twrp/platform_manifest_twrp_aosp.git -b twrp-11

repo sync

python3 -m twrpdtgen -o ~/twrp11/device ~/boot.img

The problem here is that, as you correctly guessed, twrpdtgen is meant to work with omni 10 manifest and the device trees it creates have values that are per-configured for Omni. So I made the following edits:

AndroidProducts.mk

change from:

$(LOCAL_DIR)/omni_odin.mk

to:

$(LOCAL_DIR)/twrp_odin.mk

Add at the end:

COMMON_LUNCH_CHOICES := \
twrp_odin-userdebug \
twrp_odin-eng

omni_odin.mk

Rename the file to twrp_odin.mk

change from:

$(call inherit-product, vendor/omni/config/gsm.mk)

to:

#$(call inherit-product, vendor/omni/config/gsm.mk)

change from:

$(call inherit-product, vendor/omni/config/common.mk)

to:

$(call inherit-product, vendor/twrp/config/common.mk)

change from:

PRODUCT_NAME := omni_odin

to:

PRODUCT_NAME := twrp_odin

vendorsetup.sh

change from:

add_lunch_combo omni_odin-userdebug
add_lunch_combo omni_odin-eng

to:

#add_lunch_combo omni_odin-userdebug
#add_lunch_combo omni_odin-eng

device.mk

delete this part:

PRODUCT_STATIC_BOOT_CONTROL_HAL := \
bootctrl.lahaina \
libgptutils \
libz \
libcutils

Then I continued following the instructions:

export ALLOW_MISSING_DEPENDENCIES=true
. build/envsetup.sh
lunch twrp_odin-eng
mka bootimage

At the end I get a message saying that the build has completed successfully and a bunch of files in /out, but I'm not sure what to do next.
[Xiaomi Mi MIX 4] SanHelios:
i'm doing it right now... keep you posted.

Update 28/09/21

I was able to reproduce the same... i have an output-folder with tons of files, but no img-file. The file is supposed to be in

out/target/odin

but i couldn't find anything...
[Xiaomi Mi MIX 4] jjjhitel:
There's a significant progress on twrp I'm working on.
[Xiaomi Mi MIX 4] SanHelios:
Oh, this looks great... can you tell us, what you used as repositories and commands?

Seems like soong is running correctly, but when ninja is about to continue the build process, it stops.
[Xiaomi Mi MIX 4] radoinc:
Hi, I found another workaround that seem to give results: use the omni manifest and the original tree, but in BoardConfig.mk replace:

BOARD_BOOTIMG_HEADER_VERSION := 3

with

BOARD_BOOTIMG_HEADER_VERSION := 2

Compiling like this creates a boot.img file. I don't have the device yet, but even if I did I don't know if I would flash it. I have a feeling that changing this value may not be safe (also I'm a total noob in this so I wouldn't trust a recovery created by myself :) )
[Xiaomi Mi MIX 4] SanHelios:
As far as i learned is, that Bootloader Header Version 2 is native to Android 10/Omni anyways, so it should work

I think i'm going to try it... it wanted to setup my device anyways. And if anything goes wrong, the fastboot-weeklys always fixed any problem for me.. ;)

Btw, i found a video tutorial for building twrp from source. I'm not sure, if i can apply this week (maybe friday) to see how this turns out. I'll keep you posted.
[Xiaomi Mi MIX 4] vamsi209:
so mate, one suggestion is, dont flash the twrp image, go to fastboot, and use fastboot boot twrp.img, so even if the build isnt correct, it just tries to boot the image flash rather than replacing the boot partition
[Xiaomi Mi MIX 4] vamsi209:
did you make these changes along with the once u mentioned here? and then did it make the twrp image?

AndroidProducts.mk

change from:

$(LOCAL_DIR)/omni_odin.mk

to:

$(LOCAL_DIR)/twrp_odin.mk

Add at the end:

COMMON_LUNCH_CHOICES := \ twrp_odin-userdebug \ twrp_odin-eng

omni_odin.mk

Rename the file to twrp_odin.mk

change from:

$(call inherit-product, vendor/omni/config/gsm.mk)

to:

#$(call inherit-product, vendor/omni/config/gsm.mk)

change from:

$(call inherit-product, vendor/omni/config/common.mk)

to:

$(call inherit-product, vendor/twrp/config/common.mk)

change from:

PRODUCT_NAME := omni_odin

to:

PRODUCT_NAME := twrp_odin

vendorsetup.sh

change from:

add_lunch_combo omni_odin-userdebug add_lunch_combo omni_odin-eng

to:

#add_lunch_combo omni_odin-userdebug #add_lunch_combo omni_odin-eng

device.mk

delete this part:

PRODUCT_STATIC_BOOT_CONTROL_HAL := \ bootctrl.lahaina \ libgptutils \ libz \ libcutils

Then I continued following the instructions:

Code:

export ALLOW_MISSING_DEPENDENCIES=true

. build/envsetup.sh

lunch twrp_odin-eng

mka bootimage

At the end I get a message saying that the build has completed successfully and a bunch of files in /out, but I'm not sure what to do next.
[Xiaomi Mi MIX 4] Puksom:
That's awesome! Thanks, and care to explain what we do wrong. Hopefully you come far so we can use it with the Xiaomi eu ROM

And just maybe a AOSP ROM in the near future.
[Xiaomi Mi MIX 4] radoinc:
No, when I compiled with the Omni 10 repo I changed only BOARD_BOOTIMG_HEADER_VERSION and a boot image was created.
[Xiaomi Mi MIX 4] jjjhitel:
My device tree is based on the official twrp tree for zenfone 8. And it will be open to the public if I release twrp someday.

Commands are already well documented in this thread.
[Xiaomi Mi MIX 4] SanHelios:
Hey, i was able to create a boot.img file by using the twrp10 repository and the bootheader-workaround. I used fastboot to boot the image, but my phone just went black and i had to restart it. Sooooo, back to the drawing board for us.
[Xiaomi Mi MIX 4] vamsi209:
try taking the log, connect your mix 4 to computer, use command

adb logcat > logcat.txt

and check the logcat.txt file for references of whats going wrong.

you can use official twrp pages for help
[Xiaomi Mi MIX 4] vamsi209:
what all are not working mate?
[Xiaomi Mi MIX 4] jjjhitel:
For now, I have fixed almost everything except vibration. But it still needs more tests including usb otg, flashing packages, and backup/restore. There might be some issues in flashing, because Xiaomi uses the EROFS filesystem on Mix 4. So I had to modify TWRP sources and now it can mount EROFS, but not sure about flashing.

I will release the dt very soon, and anyone who wants can work with it.
[Xiaomi Mi MIX 4] vamsi209:
oh nicee thanks so much, are you planning to work on Rom device trees too?
[Xiaomi Mi MIX 4] jjjhitel:
I think I won't, but thanks to @Cozzmy13 there are unofficial LineageOS builds for Mi 11. So It will save a lot of time.
[Xiaomi Mi MIX 4] vamsi209:
but but , that device is SM8350(888) and our device is sm8350-ac(888+), will that make any difference mate?
[Xiaomi Mi MIX 4] vamsi209:
so one of the dev who helped me by building aospa rom for g8x built a partially working twrp for mix 4

and these are the trees he made public for now, be careful, its trees need a lot of work i guess, dont know if the dev will make the required changes,

trees that he made public for now https://github.com/imjyotiraditya/msm-5.4-odin

also lets hope jjjhitel gets us the working twrp and trees :),

but from what jjjhitel was mentioning about mi 11 lineage rom, i think twrp will be of no use, as the mi 11 lineage rom uses its lineage recovery to install the rom, and flashing twrp is soft bricking mi 11 device , lets hope for the best
[Xiaomi Mi MIX 4] SanHelios:
That's a really good question... I'm thinking about creating a pure devicetree from scratch
[Xiaomi Mi MIX 4] vamsi209:
i am new to this lets team up helios
[Xiaomi Mi MIX 4] SanHelios:
Me too, even Linux is still a mystery to me, but let's do this.... :)
[Xiaomi Mi MIX 4] Cozzmy13:
It won't. Someone is already working on a device tree for Mix4 based on my stuff. They got it booting and they are still working through the issues.
[Xiaomi Mi MIX 4] vamsi209:
nicee thanks so much for the update sir, really appreciate it
[Xiaomi Mi MIX 4] SanHelios:
All of this is really nice to see... i had the Mi 11 Ultra (star) before i sold it and got the Mi Mix 4. I don't know why, but the members of the Mi11Ultra-forum are more focused on keeping MIUI... a discussion, why there's no sign of custom roms, ended with insults...
[Xiaomi Mi MIX 4] vamsi209:
lol dont worry, every xiaomi device i owned before this device, are full screen notchless(only one device k20 pro), only bought k20 pro after seeing the custom rom support, i really hate miui, even after using it for a month or so, i just dont feel like using it, i really wish the devs who r doing their (gods) work for us come out as soon as they are done working on it.

thanks devs :)
[Xiaomi Mi MIX 4] vamsi209:
https://xdaforums.com/t/recovery-unofficial-twrp-3-5-2_11-odin-mi-mix-4.4341271/

@SanHelios
[Xiaomi Mi MIX 4] SanHelios:
Well someone obviously beat us to the punch.. ;) We should be very thankful for this. 👏👏👏
[Xiaomi Mi MIX 4] vamsi209:
Lol I was talking about this Dev only, he was the one who helped me with aospa rom for my old mobile g8x
[Xiaomi Mi MIX 4] vamsi209:
This Dev had already booted lineage to mix 4, he is fixing bugs and stuff, so let's keep our fingers crossed for him to get the bugs fixed :)
[Xiaomi Mi MIX 4] SanHelios:
I don't know, where i red it, but one dev told that there are some lines in the devicetreee somewhere, that prevent the device from working properly, when you try to use kernel/devicetree/vendor without the original software (in our case MIUI)... maybe that's the problem of the published stuff by Xiaomi.
[Xiaomi Mi MIX 4] SanHelios:
so now there's an stable build available, can we use this for extracting propietary files vis-a-vis creating a custom rom? Haven't tried it yet.
[Xiaomi Mi MIX 4] Rayekk:
Hey @vamsi209, is there any new information about the custom rom for the Mix 4?

I just bought a Mix 4 and it is an amazing phone, but sadly MIUI breaks the whole experience of using it
[Xiaomi Mi MIX 4] geecko:
I'm about to buy one. Does anyone have any info about either a custom ROM or the viability of flashing a GSI rom?
[Samsung Galaxy S9+ Themes, Apps, and Mods] AlexisXDA:
Hi guys I want to share with you some apps from OneUI 4.0 Beta. This zip is compatible with all devices running OneUI 3.0+

At the moment just some apps are included into my zip such as:

- Clock

- Messaging

- Calendar

- Digital Wellbeing

- Keyboard and Emoji's (Thanks to @TechDev18)

- Dialer and InCall backgrounds

- Gallery

- Bixby Routines

- Always ON Display

- Finder

- Game Launcher

- Weather

- Samsung Reminder

- More to come very soon!

HOW TO INSTALL?

Download the "FLASH_THIS_BEFORE.zip

Flash it and then reboot system

Reboot again to recovery and flash OneUI4.0_Ported_Apps.zip

DISCLAIMER

I will be aware of your problems caused by root like tripped knox... When you flash something like this you may know about the risks you are going to find in! Remember that these apps come from a BETA FIRMWARE so could be unstable or simply can't work for all devices. Also the zip is made to work on TWRP 3.3.1.0 with system/system partition. Other zips will come later. Make a backup before flashing this, otherwise don't report for bootlooped device. Just report for app freezing/force closing. This project is open to all, who wants to share other ported apps is free to write to me and I'll add credits to him obviously

BUGS:

Let me know

DOWNLOAD LINK

Downloads for : -Android- Generic Device/Other | AndroidFileHost.com | Download GApps, Roms, Kernels, Themes, Firmware and more. Free file hosting for all Android developers.

Download GApps, Roms, Kernels, Themes, Firmware, and more. Free file hosting for all Android developers.

www.androidfilehost.com

IF YOU LIKE MY WORKS YOU CAN DONATE ME AT THIS email/link WITH PAYPAL:

alexrubino13@gmail.com
[Samsung Galaxy S9+ Themes, Apps, and Mods] noradhm:
Thanks for the excellent work

I will try it
[Samsung Galaxy S9+ Themes, Apps, and Mods] jonski89:
Awesome.. will try this... Downloading now.
[Samsung Galaxy S9+ Themes, Apps, and Mods] jonski89:
It says in twrp "file is corrupt" install failed
[Samsung Galaxy S9+ Themes, Apps, and Mods] tutibreaker:
same issue as previous versions, dont install or made any change in device ( Galaxy A30 with Anndroid 11 OneUI 3.1 )
[Samsung Galaxy S9+ Themes, Apps, and Mods] hotboy_ist:
Same issue... S10+... I installed on twrp as instructed but no change in the system like never installed. I put manually with root explorer...
[Samsung Galaxy S9+ Themes, Apps, and Mods] maglise:
Perfect, everything is working good on S10+. Fyi I use the incallUi 13.0.00.38 version from beta 12 as well and it's working good too 😉

I didn't use the zip, I directly replaced apks with root explorer on my rooted device.

Thank you for your work Alexis 😀
[Samsung Galaxy S9+ Themes, Apps, and Mods] giuresurbis:
Everything working good on my s9+ with noble rom 1.5. I flash the zip with twrp 3.3.1.0. Thanks for the excellent work.
[Samsung Galaxy S9+ Themes, Apps, and Mods] Aboody Shaker:
can you tell how to replace apks ? where to put them ?

thanks in advance.
[Samsung Galaxy S9+ Themes, Apps, and Mods] Techguy777:
I don't understand these zips because I thought you would have to be on android 12 api to have them work. I havent tried it yet but ive tried them in the past and it always fails. So I don't see how it can work. Maybe an explanation could help.
[Samsung Galaxy S9+ Themes, Apps, and Mods] Techguy777:
She probably wont tell you because on XDA whenever someone figures something out they think it makes them special or more knowledgeable and they ignore people asking.

I however don't do that. The way it works is you have to extract the apks into a select folder and than you have to have root access to put them in your system folder that already has the clock apk for example. But heres the trick no one will tell you that makes the difference. You have to sign the apk and you do with apk signer pro on the playstore for a 1 or 2 dollars or theres other ways. Than you want to keep backups of the apk and remove it out of the system folder and replace it with the new apk with the same name and 644 permissions. I did it with the clock app to test it and it worked. Its takes forever and there really isnt nothing new so its pointless in some sense. However thats how you do it. What I gave was an explanation youll notice that on a website designed for people who want to do more with their phones you see short answers without any explanation at all and the truth is because they dont want to tell anyone. They say I dont spoon feed noobs. Cant ask for ETAs because the truth is they dont know if they can figure out how to update it or fix anything. Good luck

The biggest feature is no ads with the apps however if your rooted with AdAway you shouldn't have any ads because Ive never had a an ad in the weather app. Think of this way when you ask their thinking hahaha I know something you dont know lol. Than when you figure it out youll be resentful and bitter so youll do the same thing to anyone that ask you because you'll say to yourself no one ever helped me out so they can figure out themselves and of course hahaha I know something you dont know lol. This has to stop
[Samsung Galaxy S9+ Themes, Apps, and Mods] hesoyam308:
can you please make zip for magisk?
[Samsung Galaxy S9+ Themes, Apps, and Mods] Techguy777:
You guys want to a know how to get the S21 ultra Google/Samsung messages app that was only for the S21 ultra? You download it off apkmirror and install it I've been using it on my S10 lite now since it came out. You can actually use it on other phones to my S7 has it on Pixel rom Android 11.
[Samsung Galaxy S9+ Themes, Apps, and Mods] Aboody Shaker:
Thanks bro you are a hero 👌👌💖
[Samsung Galaxy S9+ Themes, Apps, and Mods] bahaeddin:
Thanks for the work, however I lost my dailer app when flashed this thing as instructed on my note 9.

Restoring my backup now.

:)
[Samsung Galaxy S9+ Themes, Apps, and Mods] Aman gee:
Any chance Its will b works at 2.5 OneUi ?
[Samsung Galaxy S9+ Themes, Apps, and Mods] tutibreaker:
try and tell
[Samsung Galaxy S9+ Themes, Apps, and Mods] xdagee:
Can we have individual apps ported for non-rooted devices?
[Samsung Galaxy S9+ Themes, Apps, and Mods] Belco02:
When will beta 2 apps be released?
[Samsung Galaxy S9+ Themes, Apps, and Mods] Kusznier:
Does it work for anyone? I installed everything on clean rom but my apps are just in old version. Notning changed.