[Tutorial] How to use AVBtool and a private key to sign a Unisoc (SPD) image
[Tutorial] How to use AVBtool and a private key to sign a Unisoc (SPD) image
(13-03-2020, 05:32 PM)hovatek ...Hi, thanks for the work! Do I have to repeat the same procedure key signing for all other partitions to flash recovery magisk_patched_recovery_signed.img?
Important Notice
- Recall I'd used hovatek.pem private key to create hovatek.bin public key which I'd then used to sign recovery partition when creating my custom signed vbmeta. The custom signed vbmeta first needs to have been flashed to the device else it won't accept this newly signed recovery image
- You can repeat the same procedure for other partitions. Just replace recovery in the command with the partition name e.g system. You also need to have signed that partition using your custom public key back when creating your custom signed vbmeta
- Credits goes to Petercxy
(26-11-2020, 12:38 PM)_Jaqb_(13-03-2020, 05:32 PM)hovatek ...Hi, thanks for the work! Do I have to repeat the same procedure key signing for all other partitions to flash recovery magisk_patched_recovery_signed.img?
Important Notice
- Recall I'd used hovatek.pem private key to create hovatek.bin public key which I'd then used to sign recovery partition when creating my custom signed vbmeta. The custom signed vbmeta first needs to have been flashed to the device else it won't accept this newly signed recovery image
- You can repeat the same procedure for other partitions. Just replace recovery in the command with the partition name e.g system. You also need to have signed that partition using your custom public key back when creating your custom signed vbmeta
- Credits goes to Petercxy
Can the Tablet P80X (model G5K4) be rooting only by flash patched image without signing?
Which img flashing: magisk_patched_recovery.img/magisk_patched_boot.img or magisk_patched_recovery_signed.img/magisk_patched_boot_signed.img?
(26-11-2020, 12:38 PM)_Jaqb_ ...Do I have to repeat the same procedure key signing for all other partitions to flash recovery magisk_patched_recovery_signed.img?
(26-11-2020, 12:38 PM)_Jaqb_ Can the Tablet P80X (model G5K4) be rooting only by flash patched image without signing?
(26-11-2020, 12:38 PM)_Jaqb_ Which img flashing: magisk_patched_recovery.img/magisk_patched_boot.img or magisk_patched_recovery_signed.img/magisk_patched_boot_signed.img?
(30-12-2020, 07:21 PM)vano1678 Please tell me, I collected vbmeta_custom.img with a public key. And I signed boot.img and recovery.img and my relatives. So recovery.img is stitched, but boot.img does not hang on the boot. I've been trying to flash it for 3 days, and everything is useless.
Here is a link to my question and files.
https://www.hovatek.com/forum/thread-37665.html
(17-09-2020, 10:42 PM)ch3mn3y I'm trying to sign magisk patched boot.img using rsa4096_vbmeta.pem which I have as my publickey.bin file.I have the same issue... Have u solved it?
Unfortunately avbtool seems to not treat patched boot as boot...
I got error like this:
Code:>python avbtool.py add_hash_footer --image boot.img --partition_name boot --partition_size 36700160 --key publickey.bin --algorithm SHA256_RSA4096 usage: avbtool.py 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 KEY:PATH] [--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.py add_hash_footer: error: argument --image: invalid FileType('rab+') value: 'boot.img'
Tried different file names (thought that may be the problem, like standard "magisk_patched" or "boot_magisk".
EDIT: Same problem with stock boot...
(09-02-2021, 10:10 PM)getoverwith I have the same issue... Have u solved it?
(12-04-2021, 07:38 AM)per Noman Running this command: python avbtool info_image --image recovery_stock.img
Give me this error:
File "avbtool", line 411
b = 2L**32
^
(12-04-2021, 07:38 AM)per Noman But running this command: python3 avbtool.py info_image --image vbmeta_stock.img
work perfectly and give me thes output:
what am i doing wrong?Code:cd@cd:~/Desktop/avbtool$ python3 avbtool.py info_image --image vbmeta_stock.img Minimum libavb version: 1.0 Header Block: 256 bytes Authentication Block: 320 bytes Auxiliary Block: 3264 bytes Public key (sha1): cdbb77177f731920bbe0a0f94f84d9038ae0617d Algorithm: SHA256_RSA2048 Rollback Index: 0 Flags: 0 Rollback Index Location: 0 Release String: 'avbtool 1.1.0' Descriptors: Chain Partition descriptor: Partition Name: recovery Rollback Index Location: 1 Public key (sha1): 0aa0987116fc792f36bc909b0a4d530413f02a54 Chain Partition descriptor: Partition Name: vbmeta_system Rollback Index Location: 2 Public key (sha1): fa41159a5d696abdef93176a07d0b0d001263f01 Chain Partition descriptor: Partition Name: vbmeta_vendor Rollback Index Location: 4 Public key (sha1): 9577bc6c0772975ecce93c4d8a178662c728dadf Chain Partition descriptor: Partition Name: boot Rollback Index Location: 3 Public key (sha1): 9d808b0995768d0677fccb1efcddb7cf9e153d99 Hash descriptor: Image Size: 49776 bytes Hash Algorithm: sha256 Partition Name: dtbo Salt: 836908ce5dc44be62c8cee40cff79fb14aef98065e181ab6f909dd7fd2f1e89e Digest: 9e4eb8d861f2c6b3d0a46c1d524470fbd18a4935b3bbcd72b945e2143c587da5 Flags: 0
And how do I modify the script to fit my vbmeta.img file info, as seen above, for signing Empty_vbmeta/recovery/magisk_patched boot images?
Code:
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-sign-custom.img