• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Error: "Invalid Cen Header" when signing ZIP file?

zijincheng

Well-Known Member
Jan 14, 2012
195
13
Hello all, I figured this is the most appropriate place to ask this.

Long story short, I have a chinese phone with a reseller modded ROM that is preventing updates from happening. Therefore, I'm removing the first line in the update-script file in META-INF

getprop("ro.product.device") == "osborn_haiwai" || abort("E3004: This package is for \"osborn_haiwai\" devices; this is a \"" + getprop


in order to bypass verification, but that means editing the OTA zip file. I'm by no means a developer and am trying to get the updated zip file properly signed using signapk. However, I constantly get the error:


Signing - 4.1.6-nodevice.zip java.util.zip.ZipException: invalid CEN header (bad signature)

at java.util.zip.ZipFile.open(Native Method)

at java.util.zip.ZipFile.<init>(Unknown Source)

at java.util.zip.ZipFile.<init>(Unknown Source)

at java.util.jar.JarFile.<init>(Unknown Source)

at java.util.jar.JarFile.<init>(Unknown Source)

at com.android.signapk.SignApk.main(SignApk.java:454)

Any ideas?
 
Hey there :).

Not a big fan of simply removing the first expression in a ROM like that where all of the device-specific safety checks are typically done (i.e., is this the right device with the right version of Android, etc.). Those are there to protect you from flashing a ROM not intended or appropriate for your device...

Just sayin'...

But to the core of the question you asked: are you actually (trying) to use the SignApk app (on your phone)? Or are you doing this from your desktop PC?

If it's the former (on phone), do you have enough space (i.e., is the ROM very large)?

If it's the latter, you might want to try the Java jarsigner utility instead as I'm not sure that SignApk actually expects that you have a .apk file and you're trying to feed it a ROM .zip file...

Cheers!

edit: ah, I see https://play.google.com/store/apps/details?id=kellinwood.zipsigner2 is source-file agnostic, so it would/could try to sign a ROM .zip file, but maybe your file is still too large to do this on your device?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones