0

I have an update.zip which include an APK in the system/priv-app/ folder, a boot and shutdown animations and an SSH server among other things. I have the private and public keys of the OEM who sold me tablet so I used sigapk.jar to sign the update.zip file. The command I used is the following:

java -jar signapk.jar -w certificate.x509.pem key.pk8 update.zip update-signed.zip

Then after trying to flash this file via stock recovery using sideload (adb sideload update-signed.zip) I get the following error:

Verifying update package...
E:failed to verify whole-file signature
E:signature verification failed
Restarting adbd...
Installation aborted.

Previously, I was trying to flash the update.zip without signing it and the result was the following:

Verifying update package...
E:footer is wrong
E:signature verification failed
Restarting adbd...
Installation aborted.

Actually I do not know if the difference in the error (footer is wrong --> failed to verify whole-file signature) is because the keys are working or not, or maybe because the file didn't have any signature at all. Can someone help me with this and tell my why is it not working if I am using the OEM's .pem and .pk8 keys?

EDIT:

I also tried adding the certificate.x509.pem file inside the META-INF/com/android/otacert folder inside the update.zip file and then sign it, but that also didn't work.

  • The correct tool for signing is apksigner.jar from the Android SDK build-tools. – Robert Jul 9 '18 at 16:50
  • Try @Robert's suggestions. Also, are you sure that those keys are correct? How did you verify that the key you get is the preinstalled key on your device? – Minh Duc Vo Jul 9 '18 at 17:18
  • I have not verified. How can I do it? – Storo Jul 9 '18 at 17:20
  • @Robert apksigned.jar does not use pk8 and pem files so how can I do it? – Storo Jul 9 '18 at 17:29
  • Use KeyStore Explorer to convert it to a JKS keystore (new keystore and the import). – Robert Jul 9 '18 at 17:51

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.