We're hiring! Apply Now

Hovatek Forum DEVELOPMENT Android Can't flash custom vbmeta

Can't flash custom vbmeta

Can't flash custom vbmeta

Dg_09
Dg_09
Dg_09
Enthusiastic Member
10
25-08-2024, 11:11 AM
#1



Hey there.
So I own a SC9863A device and I followed these guides:
https://www.hovatek.com/forum/thread-32287.html
https://www.hovatek.com/forum/thread-32664.html
And after creating the custom vbmeta, I went fastboot mode and tried to flash it.

Code:

fastboot flash vbmeta vbmeta_custom.img
It send the file and hangs in writing...

Things I've tried:
- Flashing stock vbmeta -> no error reported, flashes in few seconds
- fastboot reboot fastboot -> the tablet boots normally to the system instead of fastboot
- Replacing vbmeta in RESEARCH_DOWNLOAD -> After few seconds it throws unplugged error

Did I miss some crucial step?
Gargoyle
Gargoyle
Gargoyle
Contributor
539
25-08-2024, 02:07 PM
#2
What device is it?
If you used the "copy and paste" command, so it can't even work.

Compare stock vbmeta with your custom.
Dg_09
Dg_09
Dg_09
Enthusiastic Member
10
26-08-2024, 04:00 PM
#3
The device  brand isn't popular, seems generic, SPC. The model is GRAVITY_OCTACORE, comes by default with android 9 pie. Extracted all the firmware from a pac file provided by the manufacturer.
The image_info command out for both images is equal except for the flag. The modified one's flag is 2 and the stock is 0. Size and public keys sha1 are equal for both.

The custom vbmeta was created with the following command:

Code:

python2 avbtool make_vbmeta_image \
--key rsa4096_vbmeta.pem \
--algorithm SHA256_RSA4096 \
--flag 2 \
--chain_partition boot:1:public_keys/boot_key.bin \
--chain_partition system:3:public_keys/system_key.bin \
--chain_partition vendor:4:public_keys/vendor_key.bin \
--chain_partition product:10:public_keys/product_key.bin \
--chain_partition dtbo:9:public_keys/dtbo_key.bin \
--chain_partition recovery:2:public_keys/custom.bin \
--chain_partition l_modem:5:public_keys/l_modem_key.bin \
--chain_partition l_ldsp:6:public_keys/l_ldsp_key.bin \
--chain_partition l_gdsp:7:public_keys/l_gdsp_key.bin \
--chain_partition pm_sys:8:public_keys/pm_sys_key.bin \
--chain_partition dtb:11:public_keys/dtb_key.bin \
--padding_size 16384 \
--output vbmeta-sign-custom.img


I've already verified the padding size.
The public keys were extracted using the tool by ProKn1fe

Is the flag number the issue? Should I set it to 0?

I attach both images down below

Regards
This post was last modified: 26-08-2024, 04:02 PM by Dg_09.
Attached Files
.img
vbmeta_custom.img
Size: 1 MB / Downloads: 2
.img
vbmeta-sign.img
Size: 1 MB / Downloads: 2
maxpayne
maxpayne
maxpayne
Intern
4,101
27-08-2024, 12:12 PM
#4
(26-08-2024, 04:00 PM)Dg_09 Is the flag number the issue? Should I set it to 0?

I attach both images down below

Regards

Neither Flag 0 nor 2 should stop you from flashing. Worst case scenario is you get a loop if yours is a type of device that requires flag to always be 0.
Such hanging while flashing issue is when your vbmeta is not signed properly.
Comparing both images in HxD, the problem appears to be your DHTB (the padding script)
This post was last modified: 27-08-2024, 12:19 PM by maxpayne.

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Dg_09
Dg_09
Dg_09
Enthusiastic Member
10
27-08-2024, 02:51 PM
#5



Thanks for your help huys.
So apparently swapping the flag to 0 allowed me flashing vbmeta, but both ported twrp and magisk patched images (signed with the custom key) will cause the device to freeze on the vendor logo.

As well tried to do

fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img

This one stucks at writing as in the beginning

I think the issue might be AVB verity now. Any way to bypass it?
Thanks for the assistance again Smile
Dg_09
Dg_09
Dg_09
Enthusiastic Member
10
27-08-2024, 03:02 PM
#6
(27-08-2024, 12:12 PM)maxpayne
(26-08-2024, 04:00 PM)Dg_09 Is the flag number the issue? Should I set it to 0?

I attach both images down below

Regards

Neither Flag 0 nor 2 should stop you from flashing. Worst case scenario is you get a loop if yours is a type of device that requires flag to always be 0.
Such hanging while flashing issue is when your vbmeta is not signed properly.
Comparing both images in HxD, the problem appears to be your DHTB (the padding script)

Thanks for your help guys.
So apparently swapping the flag to 0 allowed me flashing vbmeta (fastboot flash vbmeta vbmeta.img), but both ported twrp and magisk patched images (signed with the custom key) will cause the device to freeze on the vendor logo.

As well when I flash any image now in fastboot I see this message
Quote:Warning: skip copying (ipartition) image avb footer ( (partition) partition size: 0, (partition) image size: 134217728).


Also, tried to do
Code:

fastboot flash --disable-verity --disable-verification vbmeta vbmeta.img
This one stucks at writing as in the beginning

Any help?
Thanks for the assistance again Smile

PD: What is DHTB? All I did was to search the corentponding vbmeta_pad as specified in https://www.hovatek.com/forum/thread-32664.html so I'm probably missing that :/
Gargoyle
Gargoyle
Gargoyle
Contributor
539
27-08-2024, 03:47 PM
#7
The key with which you signed twrp and boot must be entered in vbmeta.

I assume you signed with the same key as vbmeta_custom "rsa4096_vbmeta",
so you have to replace boot_key.bin and recovery_key.bin with what you signed "rsa4096_vbmeta"
This post was last modified: 27-08-2024, 03:48 PM by Gargoyle.
maxpayne
maxpayne
maxpayne
Intern
4,101
01-09-2024, 02:16 PM
#8
(27-08-2024, 03:02 PM)Dg_09 ..
This one stucks at writing as in the beginning

Any help?

You should try taking only few steps at a time.
1. Did the phone boot up fine when you flashed only the custom vbmeta (flag 0, no keys swapped)
2. Try unpack and repack the stock recovery/boot with Android Image Kitchen (no change made) then sign and flash. See if it boots fine

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Users browsing this thread:
 1 Guest(s)
Users browsing this thread:
 1 Guest(s)
Join us
WhTlYt