I have been using Proguard 1.6 for some time without
any problems. After upgrading to version 1.7 I started
having problem with manifest files. When obfuscating a
jar file with a manifest file I get the following error:
Warning: can't write resource zip entry [META-
INF/MANIFEST.MF] (Can't add manifest file as an
ordinary zip entry)
I traced the corresponding exception in the source code
to the file JarEntry.java, line 89:
public OutputStream openDataEntry(String name)
throws IOException
{
// The manifest file should be set in the
constructor; it should not
// be added as another entry (perhaps read as a
file from a directory
// or as a rogue entry in a zip file).
if (name.equals(JarFile.MANIFEST_NAME))
{
throw new IOException("Can't add manifest file
as an ordinary zip entry");
}
This only happens with 1.7, not with 1.6.
My name is Nuno Santos (nsantos@dei.uc.pt).
Logged In: YES
user_id=555208
As discussed on the forum, this seems to happens due to a
bug in the java.util.jar classes. They don't recognize a
manifest file as such if it is not the first entry in the
jar/zip file. Instead, they present it as an ordinary
resource file. As of version 1.7, ProGuard detects this,
issues a warning, and ignores the manifest file. Adding it
can cause even worse problems. I'll think about a better
workaround.
Current solution: make sure your jar files have their
manifest files as their first entries by creating them using
the traditional 'jar -cfm ...'.