OnePlus 13 custom recovery with adb

Follow this guide and find that op13 won't boot after flashing custom recovery.img.

Find possible solution which is to sign the recovery.img.

Take a wild guess that oos will only check if there is a sign but won't verify it. Ask chatgpt to provide guide on how to sign a recovery image with AVBv2.

git clone https://android.googlesource.com/platform/external/avb
openssl genrsa -out avb_private_key.pem 2048
openssl rsa -in avb_private_key.pem -pubout -out avb_public_key.pem
./avb/avbtool.py add_hash_footer --partition_name recovery \
  --image recovery.img \
  --partition_size <partition_size_in_bytes> \
  --key avb_private_key.pem \
  --algorithm SHA256_RSA2048

Turns out to be a successsful guess.