Hovatek
  • Private Support
  • Blog
  • Home
Login Register Ask Question Hello There, Guest!
Login
Username:
Password: Lost Password?
 

OR

       

Telegram Channel: Join the discussions @ t.me/Hovatek


  1. Hovatek Forum
  2. MOBILE PHONES HELP SECTION
  3. Android
Pages (2): 1 2 Next »
 
Thread Rating:
  • 0 Vote(s) - 0 Average

Thread Modes

AVBtool and a private key to sign a Unisoc tutorial help

soymilk0401
Enthusiastic Member
Posts: 8
Threads: 2
Joined: Feb 2021
Reputation: 0
#1
Wink 

08-02-2021, 06:09 AM


I am doing this to successfully unlock the iplay 40 (T1020S)'s bootloader and use magisk or twrp.
I am a beginner who is not familiar with Linux or Python, but I will try my best.
I want to solve this.
Code:
python avbtool extract_public_key --key hovatek.pem --output keys/hovatek.bin
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
(This post was last modified: 08-02-2021, 11:56 AM by X3non.)
Find
Reply
X3non
Hovatek Representative
Posts: 19,049
Threads: 557
Joined: Jul 2014
Reputation: 326
#2

08-02-2021, 11:57 AM
(08-02-2021, 06:09 AM)soymilk0401 Wrote:  I am doing this to successfully unlock the iplay 40 (T1020S)'s bootloader and use magisk or twrp.
I am a beginner who is not familiar with Linux or Python, but I will try my best.
I want to solve this.
...

what OS and python version are you using?
have you tried using a fresh ubuntu OS?

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Find
Reply
soymilk0401
Enthusiastic Member
Posts: 8
Threads: 2
Joined: Feb 2021
Reputation: 0
#3

08-02-2021, 12:18 PM
(08-02-2021, 06:09 AM)soymilk0401 Wrote:  I am doing this to successfully unlock the iplay 40 (T1020S)'s bootloader and use magisk or twrp.
I am a beginner who is not familiar with Linux or Python, but I will try my best.
I want to solve this.
Code:
python avbtool extract_public_key --key hovatek.pem --output keys/hovatek.bin
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512

Ubuntu at a time after one failure I installed the latest version of Ubuntu (downloaded from the homepage) and 2.7.10 Python from the key guide.
Can you get vbmeta_signed.img for iplay40?
(This post was last modified: 08-02-2021, 12:19 PM by soymilk0401.)
Find
Reply
soymilk0401
Enthusiastic Member
Posts: 8
Threads: 2
Joined: Feb 2021
Reputation: 0
#4
Exclamation 

08-02-2021, 04:34 PM
I reinstalled Ubuntu and Python, learned how to use it, and tried again.

Most of them worked well,
but IOError: [Errno 2] No such file or directory:'keys/key_l_gdsp.bin'

An error occurred and the names of the keys were changed (the name of the downloaded key key_lgdsp.bin -> l_gdsp.bin)

I don't know how to fix the error that appeared after that. I hope you can help.
I think it will be possible to root my device with just this.

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

avbtool: Error signing: The command rsautl was deprecated in version 3.0. Use 'pkeyutl' instead.
RSA operation error
8062E3F7927F0000:error:1C8000A8Tonguerovider routines:rsa_check_padding:invalid padding mode:providers/implementations/signature/rsa.c:126:
(This post was last modified: 08-02-2021, 04:42 PM by soymilk0401.)
Find
Reply
X3non
Hovatek Representative
Posts: 19,049
Threads: 557
Joined: Jul 2014
Reputation: 326
#5

09-02-2021, 10:10 AM
(08-02-2021, 04:34 PM)soymilk0401 Wrote:  ...

i hope you are using python2 not python3 or you'll keep running into errors
on latest ubuntu, python3 is installed by default no longer python2
if you installed python 2, you can try calling python 2 using e.g python2 avbtool .....


(08-02-2021, 12:18 PM)soymilk0401 Wrote:  Can you get vbmeta_signed.img for iplay40?

you'll get this file from the firmware of your device, if it's pac format then you can extract using the guide @ https://forum.hovatek.com/thread-6236.html


Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Find
Reply
soymilk0401
Enthusiastic Member
Posts: 8
Threads: 2
Joined: Feb 2021
Reputation: 0
#6

09-02-2021, 10:49 AM
(09-02-2021, 10:10 AM)X3non Wrote:  
(08-02-2021, 04:34 PM)soymilk0401 Wrote:  ...

i hope you are using python2 not python3 or you'll keep running into errors
on latest ubuntu, python3 is installed by default no longer python2
if you installed python 2, you can try calling python 2 using e.g python2 avbtool .....


(08-02-2021, 12:18 PM)soymilk0401 Wrote:  Can you get vbmeta_signed.img for iplay40?

you'll get this file from the firmware of your device, if it's pac format then you can extract using the guide @ https://forum.hovatek.com/thread-6236.html


It solved both Ubuntu and Python problems. vbmeta-sign.img was also successfully produced. But my device goes into bootloop.

Here is the original vbmeta-sign.img

Minimum libavb version: 1.0
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 15808 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: 5
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: 6
Public key (sha1): bc688cacacd959cfaafbf0549d080d6fc2d50a08
Chain Partition descriptor:
Partition Name: odmko
Rollback Index Location: 7
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: 8
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_ldsp
Rollback Index Location: 9
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_gdsp
Rollback Index Location: 10
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: pm_sys
Rollback Index Location: 11
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_agdsp
Rollback Index Location: 12
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_cdsp
Rollback Index Location: 13
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26

This is the img I patched

Minimum libavb version: 1.0
Header Block: 256 bytes
Authentication Block: 576 bytes
Auxiliary Block: 13504 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: system
Rollback Index Location: 3
Public key (sha1): e2c66ff8a1d787d7bf898711187bff150f691d27
Chain Partition descriptor:
Partition Name: vendor
Rollback Index Location: 4
Public key (sha1): 9885bf5bf909e5208dfd42abaf51ad9b104ee117
Chain Partition descriptor:
Partition Name: product
Rollback Index Location: 10
Public key (sha1): 766a95798206f6e980e42414e3cb658617c27daf
Chain Partition descriptor:
Partition Name: dtbo
Rollback Index Location: 9
Public key (sha1): ea410c1b46cdb2e40e526880ff383f083bd615d5
Chain Partition descriptor:
Partition Name: recovery
Rollback Index Location: 2
Public key (sha1): 419ecbc83e132f7da710abfb5ca7791d0d97829f
Chain Partition descriptor:
Partition Name: l_modem
Rollback Index Location: 5
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_ldsp
Rollback Index Location: 6
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: l_gdsp
Rollback Index Location: 7
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: pm_sys
Rollback Index Location: 8
Public key (sha1): e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
Chain Partition descriptor:
Partition Name: dtb
Rollback Index Location: 11
Public key (sha1): ea410c1b46cdb2e40e526880ff383f083bd615d5

model:iplay40 (T1020S)
How do I fix the bootloop? Thank you for your help


Attached Files
.img vbmeta-sign.img Size: 1 MB  Downloads: 0
.img vbmeta-sign-custom.img Size: 16 KB  Downloads: 0
(This post was last modified: 09-02-2021, 02:19 PM by soymilk0401.)
Find
Reply
X3non
Hovatek Representative
Posts: 19,049
Threads: 557
Joined: Jul 2014
Reputation: 326
#7

10-02-2021, 01:30 AM
(09-02-2021, 10:49 AM)soymilk0401 Wrote:  ...
model:iplay40 (T1020S)
How do I fix the bootloop? Thank you for your help

your created vbmeta has different partitions from your original vbmeta
you're to create the new vbmeta to have the same partitions as your original vbmeta, only change the private key for the partition you wish to flash a custom image to e.g boot or recovery

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Find
Reply
soymilk0401
Enthusiastic Member
Posts: 8
Threads: 2
Joined: Feb 2021
Reputation: 0
#8

10-02-2021, 07:23 AM
(10-02-2021, 01:30 AM)X3non Wrote:  
(09-02-2021, 10:49 AM)soymilk0401 Wrote:  ...
model:iplay40 (T1020S)
How do I fix the bootloop? Thank you for your help

your created vbmeta has different partitions from your original vbmeta
you're to create the new vbmeta to have the same partitions as your original vbmeta, only change the private key for the partition you wish to flash a custom image to e.g boot or recovery

Thanks to help, I read the guide and created a new image like this

Modified command
Code:
python avbtool make_vbmeta_image --key rsa4096_vbmeta.pem --algorithm SHA256_RSA4096 --flag 0 --chain_partition boot:1:keys/hovatek.bin --chain_partition dtbo:5:keys/dtbo_key.bin --chain_partition recovery:2:keys/recovery_key.bin --chain_partition socko:6:keys/socko_key.bin --chain_partition odmko:7:keys/odmko_key.bin --chain_partition vbmeta_system:3:keys/vbmeta_system_key.bin --chain_partition vbmeta_vendor:4:keys/vbmeta_vender_key.bin --chain_partition l_modem:8:keys/l_modem_key.bin --chain_partition l_ldsp:9:keys/l_ldsp_key.bin --chain_partition l_gdsp:10:keys/l_gdsp_key.bin --chain_partition pm_sys:11:keys/pm_sys_keys.bin --chain_partition l_agdsp:12:keys/l_agdsp_keys.bin --chain_partition l_cdsp:13:keys/l_cdsp_keys.bin --padding_size 20480 --output vbmeta-sign-custom.img
(Use .bin extracted from original image except boot)

Code:
Minimum libavb version:   1.0
Header Block:             256 bytes
Authentication Block:     576 bytes
Auxiliary Block:          15808 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):       419ecbc83e132f7da710abfb5ca7791d0d97829f
    Chain Partition descriptor:
      Partition Name:          dtbo
      Rollback Index Location: 5
      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: 6
      Public key (sha1):       bc688cacacd959cfaafbf0549d080d6fc2d50a08
    Chain Partition descriptor:
      Partition Name:          odmko
      Rollback Index Location: 7
      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: 8
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_ldsp
      Rollback Index Location: 9
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_gdsp
      Rollback Index Location: 10
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          pm_sys
      Rollback Index Location: 11
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_agdsp
      Rollback Index Location: 12
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26
    Chain Partition descriptor:
      Partition Name:          l_cdsp
      Rollback Index Location: 13
      Public key (sha1):       e93e7d91ba1a46b81a5f15129b4dc5769bf41f26

However, the problem is that if I flash the new image, it boots normally,
but if I flash the magisk patched boot miage together, It won't boot
Is there anything else I need to do?

In addition, when patching through iplay 40, the AVB2.0/dm-verity option (advanced option) did not appear, so I just patched it.
Appeared when using s8, but not used in the above flash

Thank you all the time for your help


Attached Files
.img vbmeta-sign-customboot.img Size: 1 MB  Downloads: 1
(This post was last modified: 10-02-2021, 10:41 AM by X3non.)
Find
Reply
X3non
Hovatek Representative
Posts: 19,049
Threads: 557
Joined: Jul 2014
Reputation: 326
#9

10-02-2021, 10:44 AM
(10-02-2021, 07:23 AM)soymilk0401 Wrote:  ...
However, the problem is that if I flash the new image, it boots normally,
but if I flash the magisk patched boot miage together, It won't boot
Is there anything else I need to do?

In addition, when patching through iplay 40, the AVB2.0/dm-verity option (advanced option) did not appear, so I just patched it.
Appeared when using s8, but not used in the above flash

Thank you all the time for your help

did you sign the magisk patched boot? if yes, you can try patching boot using magisk canary then sign using avbtool. flash and see if magisk canary patched boot works
there's a link to magisk canary @ https://forum.hovatek.com/thread-37734.html ; step 1

Note!
We have a reply schedule for Free Support. Please upgrade to Private Support if you can't wait.
Find
Reply
soymilk0401
Enthusiastic Member
Posts: 8
Threads: 2
Joined: Feb 2021
Reputation: 0
#10

10-02-2021, 01:29 PM
(10-02-2021, 10:44 AM)X3non Wrote:  
(10-02-2021, 07:23 AM)soymilk0401 Wrote:  ...
However, the problem is that if I flash the new image, it boots normally,
but if I flash the magisk patched boot miage together, It won't boot
Is there anything else I need to do?

In addition, when patching through iplay 40, the AVB2.0/dm-verity option (advanced option) did not appear, so I just patched it.
Appeared when using s8, but not used in the above flash

Thank you all the time for your help

did you sign the magisk patched boot? if yes, you can try patching boot using magisk canary then sign using avbtool. flash and see if magisk canary patched boot works
there's a link to magisk canary @ https://forum.hovatek.com/thread-37734.html ; step 1


I flashed the vbmeta above and booted well. However, as you said, even if you use boot.img signed by reducing the capacity through AIK after patching through magisk canary, the device stops at the boot logo.


I hope you can help me root the iplay40. Is there anything else I should do?
Find
Reply
« Next Oldest | Next Newest »
Pages (2): 1 2 Next »


Possibly Related Threads…
Thread / Author Replies Views Last Post
How to solved unwritten tee key & unwritten google key Problem
Mozibur
10
10,779
Last Post by maxpayne
25-01-2021, 05:38 PM
elephone a7h UNWRITTEN TEE KEY
francisco2006
2
162
Last Post by francisco2006
24-01-2021, 05:17 PM
Samsung A10 Emergency Call Problem solution Tested & Free Tips/Tutorial
sumonhasan110
0
171
Last Post by sumonhasan110
09-12-2020, 02:08 PM
sign .img file
lolvatveo
5
364
Last Post by hovatek
30-11-2020, 04:53 AM
IMO Q2 Plus -> bootload error. id: 1 with Miracle Thunder v2.82 + key
erzieher
5
948
Last Post by X3non
30-09-2020, 10:30 AM

  • View a Printable Version


Users browsing this thread: 1 Guest(s)
  1. Hovatek Forum
  2. MOBILE PHONES HELP SECTION
  3. Android

About

The Hovatek Forum is a free Tech. Support Forum. We provide solutions to all your device related problems and questions. We'll love to have you participate in discussions here whether you're a Newbie or Experienced.

         

Forum Team

Powered By MyBB. Crafted by EreeCorp.




Linear Mode
Threaded Mode

Share

Share Tweet Share Share Pin