Hovatek Forum DEVELOPMENT Android Problem in flashing custom signed vbmeta
Can't login? Please, reset your password.
Hovatek is recruiting! Apply Now


Problem in flashing custom signed vbmeta

Problem in flashing custom signed vbmeta

davideakc
davideakc
davideakc
Enthusiastic Member
5
01-07-2021, 09:00 PM
#1



Hi,

I followed carrefully this guide https://www.hovatek.com/forum/thread-326...94145.html but, after creating my custom signed vbmeta, I can't flash it on my Teclast P20HD tablet.

Here are what I've done:

1) I've downloaded all the necessary files
2) I've extracted all the keys from my original vbmeta-sign
3) I've used OpenSSL for the hovatek.pem
4) I've checked my padding size, that it's 00 40 00 00 (so it's 16384)
5) I've checked, with "info_image" command, my vbmeta-sign:
Code:

Minimum libavb version:   1.0
Header Block:             256 bytes
Authentication Block:     576 bytes
Auxiliary Block:          13568 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: 10
      Public key (sha1):       ea410c1b46cdb2e40e526880ff383f083bd615d5
    Chain Partition descriptor:
      Partition Name:          recovery
      Rollback Index Location: 2
      Public key (sha1):       d9093b9a181bdb5731b44d60a9f850dc724e2874
    Chain Partition descriptor:
      Partition Name:          socko
      Rollback Index Location: 11
      Public key (sha1):       bc688cacacd959cfaafbf0549d080d6fc2d50a08
    Chain Partition descriptor:
      Partition Name:          odmko
      Rollback Index Location: 12
      Public key (sha1):       425215859f49f31809f16491c2a67e04df79baaf
    Chain Partition descriptor:
      Partition Name:          vbmeta_system
      Rollback Index Location: 3
      Public key (sha1):       e2c66ff8a1d787d7bf898711187bff150f691d27
    Chain Partition descriptor:
      Partition Name:          vbmeta_vendor
      Rollback Index Location: 4
      Public key (sha1):       9885bf5bf909e5208dfd42abaf51ad9b104ee117
    Chain Partition descriptor:
      Partition Name:          l_modem
      Rollback Index Location: 6
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_ldsp
      Rollback Index Location: 7
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_gdsp
      Rollback Index Location: 8
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          pm_sys
      Rollback Index Location: 9
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26

I typed this command:
Code:

python avbtool extract_public_key --key hovatek.pem --output keys/hovatek.bin

Then, on Ubuntu, I typed this (I changed the boot key because I want to flash the boot patched by Magisk for the root):
Code:

python avbtool make_vbmeta_image --key hovatek.pem --algorithm SHA256_RSA4096 --flag 2 --chain_partition boot:1:keys/hovatek.bin --chain_partition dtbo:10:keys/key_dtbo.bin --chain_partition recovery:2:keys/key_recovery.bin --chain_partition socko:11:keys/key_socko.bin --chain_partition odmko:12:keys/key_odmko.bin --chain_partition vbmeta_system:3:keys/key_system.bin --chain_partition vbmeta_vendor:4:keys/key_vendor.bin --chain_partition l_modem:6:keys/key_lmodem.bin --chain_partition l_ldsp:7:keys/key_ldsp.bin --chain_partition l_gdsp:8:keys/key_lgdsp.bin --chain_partition pm_sys:9:keys/key_pmsys.bin --padding_size 16384 --output vbmeta-sign-custom.img

After that command, I typed this one:
Code:

python vbmeta_pad.py
And I've the 1MB vbmeta-sign-custom.img.

Here's my vbmeta-sign-custom.img info_image:
Code:

Minimum libavb version:   1.0
Header Block:             256 bytes
Authentication Block:     576 bytes
Auxiliary Block:          13568 bytes
Algorithm:                SHA256_RSA4096
Rollback Index:           0
Flags:                    2
Release String:           'avbtool 1.1.0'
Descriptors:
    Chain Partition descriptor:
      Partition Name:          boot
      Rollback Index Location: 1
      Public key (sha1):       e932ab427b4d63f8c6b2b9f22ed781bff80b291c
    Chain Partition descriptor:
      Partition Name:          dtbo
      Rollback Index Location: 10
      Public key (sha1):       ea410c1b46cdb2e40e526880ff383f083bd615d5
    Chain Partition descriptor:
      Partition Name:          recovery
      Rollback Index Location: 2
      Public key (sha1):       d9093b9a181bdb5731b44d60a9f850dc724e2874
    Chain Partition descriptor:
      Partition Name:          socko
      Rollback Index Location: 11
      Public key (sha1):       bc688cacacd959cfaafbf0549d080d6fc2d50a08
    Chain Partition descriptor:
      Partition Name:          odmko
      Rollback Index Location: 12
      Public key (sha1):       425215859f49f31809f16491c2a67e04df79baaf
    Chain Partition descriptor:
      Partition Name:          vbmeta_system
      Rollback Index Location: 3
      Public key (sha1):       e2c66ff8a1d787d7bf898711187bff150f691d27
    Chain Partition descriptor:
      Partition Name:          vbmeta_vendor
      Rollback Index Location: 4
      Public key (sha1):       9885bf5bf909e5208dfd42abaf51ad9b104ee117
    Chain Partition descriptor:
      Partition Name:          l_modem
      Rollback Index Location: 6
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_ldsp
      Rollback Index Location: 7
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_gdsp
      Rollback Index Location: 8
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          pm_sys
      Rollback Index Location: 9
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26

Now it's time to flash the vbmeta-sign-custom.img via fastboot:
Code:

fastboot flash vbmeta vbmeta-sign-custom.img
target didn't report max-download-size
sending 'vbmeta' (1024 KB)...
OKAY [  0.039s]
writing 'vbmeta'...
And nothing more happens.

The only thing (that I think can help) it's that if I compare the two vbmeta files (the original and the custom one), the DHTB isn't like before.
The originale one has 00 40 00 00
The custom one has 00 50 00 00
But I didn't touched the part of command where is specified "--padding_size 16384"

So what the problem can be?

Thank you for all the replies and sorry for the long thread.
If you need more information, just ask Smile
X3non
X3non
X3non
Recognized Contributor
22,062
02-07-2021, 10:03 AM
#2
(01-07-2021, 09:00 PM)davideakc ...
So what the problem can be?

Thank you for all the replies and sorry for the long thread.
If you need more information, just ask Smile

Your stock vbmeta has flag 0, your make vbmeta command should have --flag 0

Also you should use the python vbmeta_pad script for Android 9 seeing as you have 00 40 00 00
davideakc
davideakc
davideakc
Enthusiastic Member
5
02-07-2021, 12:38 PM
#3
(02-07-2021, 10:03 AM)X3non Your stock vbmeta has flag 0, your make vbmeta command should have --flag 0
Yes, I saw this but the video in the guide says it's normal to have "flag 2" in the custom signed vbmeta for disable verity checks.

(02-07-2021, 10:03 AM)X3non Also you should use the python vbmeta_pad script for Android 9 seeing as you have 00 40 00 00
I used the one for Android 10 because the tablet has Android 10.

Anyway I will try your suggestions tonight!
davideakc
davideakc
davideakc
Enthusiastic Member
5
03-07-2021, 01:52 AM
#4
I tried to change the string on the make vbmeta command. Now it has "--flag 0" option (and the info_image command confirm it).
I downloaded the vbmeta_pad script for Android 9 (and now the DHTB of vbmeta-sign-custom.img it's 00 40 00 00, like the original one).

But I still have this problem:
Code:

D:\Programmi\adb>fastboot flash vbmeta vbmeta-sign-custom.img
target didn't report max-download-size
sending 'vbmeta' (1024 KB)...
OKAY [  0.038s]
writing 'vbmeta'...

I really don't know what the error can be...
X3non
X3non
X3non
Recognized Contributor
22,062
03-07-2021, 09:58 AM
#5



(03-07-2021, 01:52 AM)davideakc ...
I really don't know what the error can be...

just gone through your make vbmeta command again and i see now that you used hovatek.pem instead of the rsa4096_vbmeta.pem key from the bootloader unlock requirements
retry again using the rsa4096_vbmeta.pem and flag 2, if you have difficulty flashing then use flag 0 as in stock vbmeta
davideakc
davideakc
davideakc
Enthusiastic Member
5
03-07-2021, 01:00 PM
#6
(03-07-2021, 09:58 AM)X3non retry again using the rsa4096_vbmeta.pem and flag 2
With this suggestion, I flashed the vbmeta-sign-custom correctly to my tablet!

Now I've another problem but I think is Magisk side: I've patched boot image and when I flash it and reboot, the tablet shows the first boot screen and then it dies. I have to manually power on the tablet (that keeps turning off after the first boot screen) and flash the stock ROM.

I also followed this guide https://www.hovatek.com/forum/thread-32674.html replacing "recovery" and other things like image size, algorithm and partition name, with my stock boot image.

I don't know if it's normal but I even tried to restart the tablet after the fastboot flash vbmeta command (it worked) but the tablet won't start (it does what I wrote before).

EDIT: I was on this all the whole day. After 985 tries, I made it, with these commands (and I've succesfully rooter my tablet):

Code:

python avbtool extract_public_key --key hovatek.pem --output keys/hovatek.bin

python avbtool make_vbmeta_image --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096 --flag 2 --chain_partition boot:1:keys/hovatek.bin --chain_partition dtbo:10:keys/key_dtbo.bin --chain_partition recovery:2:keys/key_recovery.bin --chain_partition socko:11:keys/key_socko.bin --chain_partition odmko:12:keys/key_odmko.bin --chain_partition vbmeta_system:3:keys/key_system.bin --chain_partition vbmeta_vendor:4:keys/key_vendor.bin --chain_partition l_modem:6:keys/key_lmodem.bin --chain_partition l_ldsp:7:keys/key_ldsp.bin --chain_partition l_gdsp:8:keys/key_lgdsp.bin --chain_partition pm_sys:9:keys/key_pmsys.bin --padding_size 16384 --output vbmeta-sign-custom.img

python vbmeta_pad.py

python avbtool add_hash_footer --image boot_patched.img --partition_name boot --partition_size 36700160 --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096

Thank you very much for your help! Smile
This post was last modified: 03-07-2021, 10:41 PM by davideakc.
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
YtWhTl
live chat
whatsapp telegram instagram