• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

Question Propietary blobs/files for Odin

Search This thread

dan079

Senior Member
Hey, does anyone know how to get the propietary blobs out of the device? I'm kinda done with MIUI and i wanna try to compile some custom rom and maybe a legit twrp.
Trying to look for the Chinese tool to flash the unofficial TWRP, once I manage to do that will try help on grabbing those needed proprietary blobs. May need guide on how to pull the blobs, am still a noob
 
  • Like
Reactions: SanHelios
Trying to look for the Chinese tool to flash the unofficial TWRP, once I manage to do that will try help on grabbing those needed proprietary blobs. May need guide on how to pull the blobs, am still a noob
Me too... TWRP is tricky, since it can only be done by this OneInject-function of TWRP, but it's possible. I tried the 'current' unofficial release of TWRP for this, but all i got was a reboot to BL.
 
yshalsager, who created the Firmware-script, told me the same.. here is his answer.

"
Hi,
Thanks for your words, glad to hear my work helps.

You can use LineageOS extract files script that will generate vendor tree for you. It is available in any device tree but you should use one of your device so it reads from its proprietary-files.txt or something.
"

Maybe LOS is closer than we think.
 

vamsi209

Senior Member
Nov 15, 2010
78
39
yshalsager, who created the Firmware-script, told me the same.. here is his answer.

"
Hi,
Thanks for your words, glad to hear my work helps.

You can use LineageOS extract files script that will generate vendor tree for you. It is available in any device tree but you should use one of your device so it reads from its proprietary-files.txt or something.
"

Maybe LOS is closer than we think.
niceee, so for mix 4, i extracted the twrp trees using this,
setup the local repo for building twrp trees, using these
tried building but the device doesn't lunch after following the steps shown above,
Code:
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 :)
 
  • Love
Reactions: SanHelios
niceee, so for mix 4, i extracted the twrp trees using this,
setup the local repo for building twrp trees, using these
tried building but the device doesn't lunch after following the steps shown above,
Code:
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 :)
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.
 
U used the same script for the recovery trees?
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?
 
Last edited:

radoinc

Member
Jun 5, 2015
17
4
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:
Code:
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.
 

Attachments

  • odin.zip
    42.7 MB · Views: 2
Last edited:
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:
Code:
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.
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..
 

radoinc

Member
Jun 5, 2015
17
4
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..
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.
 
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.
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

 
  • Like
Reactions: radoinc

radoinc

Member
Jun 5, 2015
17
4
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

Thanks! Now I managed to get the same result as you. The error seems to be raised by mkbootimg.py:

Python:
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:

Python:
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.
 
  • Like
Reactions: SanHelios
Thanks! Now I managed to get the same result as you. The error seems to be raised by mkbootimg.py:

Python:
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:

Python:
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.
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...
 

Top Liked Posts