chriswoope / resign-android-image

Resign Android OS (esp. GrapheneOS) images with your signing keys and add ADB root and other modifications
MIT License
86 stars 6 forks source link

ERROR : Footer is wrong (oriole) #7

Closed Didyme33 closed 2 years ago

Didyme33 commented 2 years ago

Hi, First, thank you for your excellent project !

I have a bug : I tried to resign the last OTA of GrapheneOS for Pixel 6 (oriole), this is what I get :

resign-android-image# ./resign-android-image ../work/ ../work/keys/ grapheneos oriole ../oriole-ota_update-2022051100.zip --ota --adb-root --allowbackup --adb-backup --generate-keys
Déjà à jour.
La branche courante master est à jour.
Déjà à jour.
Déjà à jour.
La branche courante 12.1 est à jour.
La branche courante 12.1 est à jour.
MAKING ../work//out_resign/target_files.zip with make_target_files_zip
        MAKING ../work//out_resign/target_files with make_target_files_base
                MAKING ../work//out_resign/target_files_signed with make_target_files_signed
                        MAKING ../work//out_resign/target_files_intermediates.zip with make_target_files_intermediates_zip
                                MAKING ../work//out_resign/target_files_intermediates.done with make_target_files_intermediates
                                        MAKING ../work//out_resign/target_files_intermediates with make_target_files_intermediates_base
                                                MAKING ../work//out_resign/target_files_extracted.done with make_target_files_extracted
                                                        MAKING ../work//ota_payload with make_extract_ota_payload
                                                                MAKING ../work//ota with make_extract_ota
                                                                        MAKING ../work//ota.zip.ok with download_ota
** Resuming transfer from byte position 146
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0   146    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
Package: ../work//ota.zip
Certificate: /home/didyme/Programmes/resign-android-image/grapheneos-otacerts/oriole.pem

    ERROR: Footer is wrong.

Failed to verify OTA update signature!
Failed to run: download_ota ../work//ota.zip.ok.Q9fkA7.tmp 
Failed to run: make_extract_ota ../work//ota.e3uVMI.tmp 
Failed to run: make_extract_ota_payload ../work//ota_payload.RXmXDT.tmp 
Failed to run: make_target_files_extracted ../work//out_resign/target_files_extracted.done.DjQMfb.tmp 
Failed to run: make_target_files_intermediates_base ../work//out_resign/target_files_intermediates.iJqIvb.tmp 
Failed to run: make_target_files_intermediates ../work//out_resign/target_files_intermediates.done.wT2jhn.tmp 
Failed to run: make_target_files_intermediates_zip ../work//out_resign/target_files_intermediates.zip.CIpnTo.tmp 
Failed to run: make_target_files_signed ../work//out_resign/target_files_signed.PFXIvr.tmp 
Failed to run: make_target_files_base ../work//out_resign/target_files.NgqRlo.tmp 
Failed to run: make_target_files_zip ../work//out_resign/target_files.zip.STcjIY.tmp 

Any idea on how to solve this ? Thanks !

chriswoope commented 2 years ago

Maybe the downloaded OTA is corrupted? You could try to delete work directory or specify a different one and start from scratch

Didyme33 commented 2 years ago

I retried on an other machine. Redownloaded the OTA. Same problem :( Also tried with the whole factory image, same.

chriswoope commented 2 years ago

Looks like curl is getting a 146 byte long error response instead of the actual OTA file.

Can you read the "../work/ota.zip" file with less or a text editor and see if it contains an error response from the server?

Can you download files with curl from releases.grapheneos.org or from other places like kernel.org? Maybe you need a proxy to be set to access the Internet or perhaps your IP address is triggering some sort of abuse protection mechanism on releases.grapheneos.org?

You can also work around the issue by manually downloading the proper ota_update zip with a web browser from releases.grapheneos.org and copying the file to "../work/ota.zip" (you might also need to verify it manually with ~/.resign-android-image/otatools/bin/check_ota_package_signature and create ../work/ota.zip.ok).

Didyme33 commented 2 years ago

Good guess ! Here is the content of the ota.zip :

<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>

I'm going to try like you said, i'll copy directly the image manually. I'll keep you informed.

chriswoope commented 2 years ago

I reread your first message and the issue is that you are specifying "../oriole-ota_update-2022051100.zip" on the command line, but you need to just specify "2022051100" and the script will download the OTA automatically.

Didyme33 commented 2 years ago

I reread your first message and the issue is that you are specifying "../oriole-ota_update-2022051100.zip" on the command line, but you need to just specify "2022051100" and the script will download the OTA automatically.

OK, I'm going to do that first lol. Thank you.