Hovatek Forum DEVELOPMENT Android [Development] Help needed with avbtool script Unisoc T610
Try our Online TWRP Builder..its free!
Can't login? Please, reset your password.


[Development] Help needed with avbtool script Unisoc T610

[Development] Help needed with avbtool script Unisoc T610

Pages (2): 1 2 Next
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
26-09-2022, 01:49 PM
#1



hi i read and followed all the info on the below notes:
How to create a custom signed vbmeta.img for Unisoc using AVBtool (hovatek.com)

 I got stuck at this script:

python avbtool make_vbmeta_image --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096 --flag 2 --chain_partition
boot:1:keys/key_boot.bin --chain_partition system:3:keys/key_system.bin --chain_partition vendor:4:keys/key_vendor.bin
--chain_partition product:10:keys/key_product.bin --chain_partition dtbo:9:keys/key_dtbo.bin --chain_partition
recovery:2:keys/hovatek.bin --chain_partition l_modem:5:keys/key_l_modem.bin --chain_partition
l_ldsp:6:keys/key_l_ldsp.bin --chain_partition l_gdsp:7:keys/key_l_gdsp.bin --chain_partition
pm_sys:8:keys/key_pm_sys.bin --chain_partition dtb:11:keys/key_dtb.bin --padding_size 16384 --output vbmeta-signcustom.img


error:

python avbtool make_vbmeta_image --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096 --flag 2 --chain_partition
usage: avbtool make_vbmeta_image [-h] [--output OUTPUT]
                                [--padding_size NUMBER]
                                [--algorithm ALGORITHM] [--key KEY]
                                [--signing_helper APP]
                                [--signing_helper_with_files APP]
                                [--public_key_metadata KEY_METADATA]
                                [--rollback_index ROLLBACK_INDEX]
                                [--append_to_release_string STR]
                                [--prop KEY:VALUE]
                                [--prop_from_file KEY[Image: tongue.gif]ATH]
                                [--kernel_cmdline CMDLINE]
                                [--setup_rootfs_from_kernel IMAGE]
                                [--include_descriptors_from_image IMAGE]
                                [--print_required_libavb_version]
                                [--chain_partition PART_NAME:ROLLBACK_SLOT:KEY_PATH]
                                [--flags FLAGS]
                                [--set_hashtree_disabled_flag]
avbtool make_vbmeta_image: error: argument --chain_partition: expected one argument
PS E:\z\`1> boot:1:keys/key_boot.bin --chain_partition system:3:keys/key_system.bin --chain_partition vendor:4:keys/key_vendor.bin
boot:1:keys/key_boot.bin : The term 'boot:1:keys/key_boot.bin' is not
recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ boot:1:keys/key_boot.bin --chain_partition system:3:keys/key_system.b ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (boot:1:keys/key_boot.bin:String
  ) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS E:\z\`1> --chain_partition product:10:keys/key_product.bin --chain_partition dtbo:9:keys/key_dtbo.bin --chain_partition
At line:1 char:3
+ --chain_partition product:10:keys/key_product.bin --chain_partition d ...
+  ~
Missing expression after unary operator '--'.
At line:1 char:3
+ --chain_partition product:10:keys/key_product.bin --chain_partition d ...
+  ~~~~~~~~~~~~~~~
Unexpected token 'chain_partition' in expression or statement.
    + CategoryInfo          : ParserError: ([Image: smile.gif] [], ParentContainsErrorRecordEx
  ception
    + FullyQualifiedErrorId : MissingExpressionAfterOperator

PS E:\z\`1> recovery:2:keys/hovatek.bin --chain_partition l_modem:5:keys/key_l_modem.bin --chain_partition
recovery:2:keys/hovatek.bin : The term 'recovery:2:keys/hovatek.bin' is not
recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ recovery:2:keys/hovatek.bin --chain_partition l_modem:5:keys/key_l_mo ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (recovery:2:keys/hovatek.bin:Str
  ing) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS E:\z\`1> l_ldsp:6:keys/key_l_ldsp.bin --chain_partition l_gdsp:7:keys/key_l_gdsp.bin --chain_partition
l_ldsp:6:keys/key_l_ldsp.bin : The term 'l_ldsp:6:keys/key_l_ldsp.bin' is not
recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ l_ldsp:6:keys/key_l_ldsp.bin --chain_partition l_gdsp:7:keys/key_l_gd ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (l_ldsp:6:keys/key_l_ldsp.bin:St
  ring) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

PS E:\z\`1> pm_sys:8:keys/key_pm_sys.bin --chain_partition dtb:11:keys/key_dtb.bin --padding_size 16384 --output vbmeta-sign^Bcustom.img
pm_sys:8:keys/key_pm_sys.bin : The term 'pm_sys:8:keys/key_pm_sys.bin' is not
recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify
that the path is correct and try again.
At line:1 char:1
+ pm_sys:8:keys/key_pm_sys.bin --chain_partition dtb:11:keys/key_dtb.bi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (pm_sys:8:keys/key_pm_sys.bin:St
  ring) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


I am total noob and just need to get my phone rooted for advert blocking. I will submit my vbmeta-sign in hopes that you may be able to help. 

info if needed:
PS E:\z\`1> python avbtool.py info_image --image vbmeta-sign.img
Minimum libavb version:  1.0
Header Block:            256 bytes
Authentication Block:    576 bytes
Auxiliary Block:          16960 bytes
Algorithm:                SHA256_RSA4096
Rollback Index:          0
Flags:                    0
Release String:          'avbtool 1.1.0'
Descriptors:
    Chain Partition descriptor:
      Partition Name:          boot
      Rollback Index Location: 1
      Public key (sha1):      ea410c1b46cdb2e40e526880ff383f083bd615d5
    Chain Partition descriptor:
      Partition Name:          dtbo
      Rollback Index Location: 6
      Public key (sha1):      ea410c1b46cdb2e40e526880ff383f083bd615d5
    Chain Partition descriptor:
      Partition Name:          socko
      Rollback Index Location: 13
      Public key (sha1):      bc688cacacd959cfaafbf0549d080d6fc2d50a08
    Chain Partition descriptor:
      Partition Name:          odmko
      Rollback Index Location: 14
      Public key (sha1):      425215859f49f31809f16491c2a67e04df79baaf
    Chain Partition descriptor:
      Partition Name:          vbmeta_system
      Rollback Index Location: 2
      Public key (sha1):      e2c66ff8a1d787d7bf898711187bff150f691d27
    Chain Partition descriptor:
      Partition Name:          vbmeta_system_ext
      Rollback Index Location: 3
      Public key (sha1):      f204332ee2d0bec13ea120b73c5adcf7866bf889
    Chain Partition descriptor:
      Partition Name:          vbmeta_vendor
      Rollback Index Location: 4
      Public key (sha1):      9885bf5bf909e5208dfd42abaf51ad9b104ee117
    Chain Partition descriptor:
      Partition Name:          vbmeta_product
      Rollback Index Location: 5
      Public key (sha1):      766a95798206f6e980e42414e3cb658617c27daf
    Chain Partition descriptor:
      Partition Name:          l_modem
      Rollback Index Location: 7
      Public key (sha1):      e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_ldsp
      Rollback Index Location: 8
      Public key (sha1):      e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_gdsp
      Rollback Index Location: 9
      Public key (sha1):      e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          pm_sys
      Rollback Index Location: 10
      Public key (sha1):      e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_agdsp
      Rollback Index Location: 11
      Public key (sha1):      e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_cdsp
      Rollback Index Location: 12
      Public key (sha1):      e93e7d91ba1a46b81a5f15129b4dc5769bf41f26


i am also using python 2.7.10 

Thanks in advance for any help.
Attached Files
.img
vbmeta-sign.img
Size: 1 MB / Downloads: 2
hovatek
hovatek
hovatek
Administrator
49,570
27-09-2022, 07:10 PM
#2
(26-09-2022, 01:49 PM)gtr.fingers hi i read and followed all the info on the below notes:
How to create a custom signed vbmeta.img for Unisoc using AVBtool (hovatek.com)

Are you using Windows or Ubuntu?

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
27-09-2022, 09:14 PM
#3
(27-09-2022, 07:10 PM)hovatek
(26-09-2022, 01:49 PM)gtr.fingers hi i read and followed all the info on the below notes:
How to create a custom signed vbmeta.img for Unisoc using AVBtool (hovatek.com)

Are you using Windows or Ubuntu?

Hi i tried on both W11 and Manjaro. I had to quit linux due to my keyrings being outdated. Not sure why...

During my visit to your amazing support site. I came across a few threads with some good tips. 

So here is where i'm at with the above listed problem. I went through all my keys and renamed them according to the script. I also changed the flag from 2 to 0. I then ran the script in Windows and it created a vbmeta-sign-custom which was originally 20kb to 1mb. So it seems that it worked with your hovatek.pem > hovatek.bin key

Now i am in the process of getting ready to flash the phone. I have a few questions as i can't seem to find a proper way to flash this phone.

1.Do you have a link or tutorial i can follow for my next steps?.

My procedure next would be to create a magisk patched boot image. Flash phone with that and the custom vbmeta image. I am a bit familiar with adb. I have used it before for basic root stuff.

i will give examples of what i have used and worked before but not sure if it would work with the t610.

adb reboot bootloader
fastboot flashing unlock
fastboot flash vbmeta vbmeta.img
fastboot flash boot magiskpatched.img
fastboot reboot

or would i have to use these commands instead?

fastboot --disable-verity --disable-verification flash boot magisk_patched.img
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot reboot

2.I also read on the site that i can flash the vbmeta through SPD Research tool, but can't find any info on how to do that. Do you have a tutorial for this?

Thanks for any assistance, and please keep in mind. I'm a noob when it comes to this new secure device lock stuff.
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
27-09-2022, 09:17 PM
#4
test....
hovatek
hovatek
hovatek
Administrator
49,570
29-09-2022, 05:21 AM
#5



(27-09-2022, 09:14 PM)gtr.fingers Are you using Windows or Ubuntu?

Hi i tried on both W11 and Manjaro. I had to quit linux due to my keyrings being outdated. Not sure why...

During my visit to your amazing support site. I came across a few threads with some good tips. 

So here is where i'm at with the above listed problem. I went through all my keys and renamed them according to the script. I also changed the flag from 2 to 0. I then ran the script in Windows and it created a vbmeta-sign-custom which was originally 20kb to 1mb. So it seems that it worked with your hovatek.pem > hovatek.bin key

Now i am in the process of getting ready to flash the phone. I have a few questions as i can't seem to find a proper way to flash this phone.

1.Do you have a link or tutorial i can follow for my next steps?.

My procedure next would be to create a magisk patched boot image. Flash phone with that and the custom vbmeta image. I am a bit familiar with adb. I have used it before for basic root stuff.

i will give examples of what i have used and worked before but not sure if it would work with the t610.

adb reboot bootloader
fastboot flashing unlock
fastboot flash vbmeta vbmeta.img
fastboot flash boot magiskpatched.img
fastboot reboot

or would i have to use these commands instead?

fastboot --disable-verity --disable-verification flash boot magisk_patched.img
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
fastboot reboot

2.I also read on the site that i can flash the vbmeta through SPD Research tool, but can't find any info on how to do that. Do you have a tutorial for this?

Thanks for any assistance, and please keep in mind. I'm a noob when it comes to this new secure device lock stuff.

You first need to unlock bootloader. See https://www.hovatek.com/forum/thread-32287.html

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
29-09-2022, 02:34 PM
#6
(29-09-2022, 05:21 AM)hovatek "You first need to unlock bootloader. See https://www.hovatek.com/forum/thread-32287.html"



Hi and thanks for the reply.

This is where i am at so far.

i read and followed the link. I was able to get to here:


~/De/B/.\fastboot ./signidentifier_unlockbootloader.sh 41313350343132
38355932303430373030323638 rsa4096_vbmeta.pem signature.bin
Identifier sign script, ver 0.10
1+0 records in
1+0 records out
44 bytes copied, 8.5907e-05 s, 512 kB/s
Identifier sign successfully
~/De/Build/.\fastboot ./fastboot flashing unlock_bootloader signature
.bin
2downloading 'unlock_message'...
OKAY [  0.000s]
unlocking bootloader...

Its been stuck there for 10 min so far....Not sure how long its supposed to take if in fact it is working...
Ok  so it finished with:


~/De/Build/.\fastboot ./fastboot flashing unlock_bootloader signature
.bin
2downloading 'unlock_message'...
OKAY [  0.000s]
unlocking bootloader...
Info:Unlock bootloader success!   OKAY [1193.813s]
finished. total time: 1193.813s

I hope i am on the right track and can continue to do the other steps. Please let me know.

Thanks in advance.
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
29-09-2022, 08:52 PM
#7
Update:

I got to the point of flashing vbmeta.img. It got stuck at the final stage or writing. I let it sit for an hour. Still no go.

I then rebooted into fastbootd and ran it again. This time is finished rather quickly. I then flashed magisk_patched.img.

After a reboot. The phone was bootlooping after it showed "state unlocked" on the screen. I could not turn it off properly as it would start back up at times after holding the vol- button or continuous rebooting...

I then connected it to the pc and used the Research download tool to flash the stock .pac firmware. It is back to normal almost. It states that the bootloader is unlocked. 

So this is where i'm at and not sure what to try next. Please advise


I also checked the stock vbmeta and custom key images.

stock:
Minimum libavb version:  1.0
Header Block:            256 bytes
Authentication Block:    576 bytes
Auxiliary Block:          16960 bytes
Algorithm:                SHA256_RSA4096
Rollback Index:          0
Flags:                    0
Release String:          'avbtool 1.1.0'


Custom:
Minimum libavb version:  1.0
Header Block:            256 bytes
Authentication Block:    576 bytes
Auxiliary Block:          16960 bytes
Algorithm:                SHA256_RSA4096
Rollback Index:          0
Flags:                    0
Release String:          'avbtool 1.1.0'


i had created  custom vbmeta.img with a flag 0. Not sure if any of this info helps with your assistance. I also created another image with flag 2, but haven't tried it as i'm worried i might damage the phone.

So far everything has worked until this point. 

Thanks again for all your assistance.
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
30-09-2022, 02:14 AM
#8
Just another small update. I can't seem to get the magisk_patched.img signed to flash on the this phone. I get an error with the script. Syntax error..

python avbtool add_hash_footer --image boot_magisk.img --partition_name boot --partition_size 67108864 --key hovatek.pem --algorithm SHA256_RSA4096

under linux:
File "avbtool", line 411
b = 2L**32
^
SyntaxError: invalid syntax

It also errors out under Windows.

python avbtool add_hash_footer --image boot_magisk.img --partition_name boot --partition_size 67108864 --key hovatek.pem --algorithm SHA256_RSA4096
usage: avbtool add_hash_footer [-h] [--image IMAGE]
[--partition_size PARTITION_SIZE]
[--partition_name PARTITION_NAME]
[--hash_algorithm HASH_ALGORITHM] [--salt SALT]
[--calc_max_image_size]
[--output_vbmeta_image OUTPUT_VBMETA_IMAGE]
[--do_not_append_vbmeta_image]
[--algorithm ALGORITHM] [--key KEY]
[--signing_helper APP]
[--signing_helper_with_files APP]
[--public_key_metadata KEY_METADATA]
[--rollback_index ROLLBACK_INDEX]
[--append_to_release_string STR]
[--prop KEY:VALUE] [--prop_from_file KEYTongueATH]
[--kernel_cmdline CMDLINE]
[--setup_rootfs_from_kernel IMAGE]
[--include_descriptors_from_image IMAGE]
[--print_required_libavb_version]
[--chain_partition PART_NAME:ROLLBACK_SLOT:KEY_PATH]
[--flags FLAGS] [--set_hashtree_disabled_flag]
[--use_persistent_digest] [--do_not_use_ab]
avbtool add_hash_footer: error: argument --image: invalid FileType('rab+') value: 'boot_magisk.img'

I am confused at this point.

Thanks in advance.
hovatek
hovatek
hovatek
Administrator
49,570
30-09-2022, 08:10 AM
#9
(29-09-2022, 08:52 PM)gtr.fingers i had created  custom vbmeta.img with a flag 0. Not sure if any of this info helps with your assistance. I also created another image with flag 2, but haven't tried it as i'm worried i might damage the phone.

So far everything has worked until this point. 

Thanks again for all your assistance.

You need to go one step at a time else you'll get confused.
After bootloader unlock, you create a custom vbmeta with flag 2, no other change then you flash and see if the device boots up normally

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
gtr.fingers
gtr.fingers
gtr.fingers
Enthusiastic Member
9
30-09-2022, 01:55 PM
#10



(30-09-2022, 08:10 AM)hovatek
(29-09-2022, 08:52 PM)gtr.fingers i had created  custom vbmeta.img with a flag 0. Not sure if any of this info helps with your assistance. I also created another image with flag 2, but haven't tried it as i'm worried i might damage the phone.

So far everything has worked until this point. 



Thanks again for all your assistance.

You need to go one step at a time else you'll get confused.
After bootloader unlock, you create a custom vbmeta with flag 2, no other change then you flash and see if the device boots up normally

Hi another update. I flashed in fastbood, vbmeta with flag 2. With this flag2 the device randomly reboots. Please advise what should i do.


Thanks
Pages (2): 1 2 Next
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
YtWhTl
live chat
whatsapp telegram instagram