From cadedeb06cdbacf36d38ec96e70ca44d5abaa0f1 Mon Sep 17 00:00:00 2001 From: zzz Date: Thu, 1 Mar 2012 16:04:17 +0000 Subject: [PATCH] * Build: Add built-by to jars; check for corrupt jars on debug page --- apps/addressbook/build.xml | 2 ++ apps/i2psnark/java/build.xml | 2 ++ apps/i2ptunnel/java/build.xml | 2 ++ apps/jetty/build.xml | 1 + apps/ministreaming/java/build.xml | 1 + apps/routerconsole/java/build.xml | 2 ++ .../src/net/i2p/router/web/FileDumpHelper.java | 11 +++++++++-- apps/sam/java/build.xml | 2 ++ apps/streaming/java/build.xml | 1 + apps/susidns/src/build.xml | 1 + apps/susimail/build.xml | 1 + apps/systray/java/build.xml | 1 + build.properties | 2 ++ build.xml | 15 +++++++++++++++ core/java/build.xml | 1 + router/java/build.xml | 1 + 16 files changed, 44 insertions(+), 2 deletions(-) diff --git a/apps/addressbook/build.xml b/apps/addressbook/build.xml index ad27a00905..beff280f8c 100644 --- a/apps/addressbook/build.xml +++ b/apps/addressbook/build.xml @@ -56,6 +56,7 @@ + @@ -75,6 +76,7 @@ + diff --git a/apps/i2psnark/java/build.xml b/apps/i2psnark/java/build.xml index bded42a27f..3065ed9bc3 100644 --- a/apps/i2psnark/java/build.xml +++ b/apps/i2psnark/java/build.xml @@ -61,6 +61,7 @@ + @@ -108,6 +109,7 @@ + diff --git a/apps/i2ptunnel/java/build.xml b/apps/i2ptunnel/java/build.xml index 1b62279145..df8387b6d2 100644 --- a/apps/i2ptunnel/java/build.xml +++ b/apps/i2ptunnel/java/build.xml @@ -63,6 +63,7 @@ + @@ -136,6 +137,7 @@ basedir="../jsp/" excludes="web.xml, web-fragment.xml, web-out.xml, **/*.java, *.jsp"> + diff --git a/apps/jetty/build.xml b/apps/jetty/build.xml index e686e364a7..de9534274b 100644 --- a/apps/jetty/build.xml +++ b/apps/jetty/build.xml @@ -117,6 +117,7 @@ + diff --git a/apps/ministreaming/java/build.xml b/apps/ministreaming/java/build.xml index 235088fc31..451ecf0f4c 100644 --- a/apps/ministreaming/java/build.xml +++ b/apps/ministreaming/java/build.xml @@ -51,6 +51,7 @@ + diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml index 3dba335781..714bd17db5 100644 --- a/apps/routerconsole/java/build.xml +++ b/apps/routerconsole/java/build.xml @@ -92,6 +92,7 @@ + @@ -172,6 +173,7 @@ basedir="../jsp/" excludes="web.xml, *.css, **/*.java, *.jsp, *.jsi, web-fragment.xml, web-out.xml"> + diff --git a/apps/routerconsole/java/src/net/i2p/router/web/FileDumpHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/FileDumpHelper.java index eea306aa20..99026be16a 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/FileDumpHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/FileDumpHelper.java @@ -18,6 +18,7 @@ import java.util.jar.Manifest; import net.i2p.crypto.SHA256Generator; import net.i2p.data.DataHelper; +import net.i2p.util.FileUtil; /** * Dump info on jars and wars @@ -29,7 +30,7 @@ public class FileDumpHelper extends HelperBase { public String getFileSummary() { StringBuilder buf = new StringBuilder(16*1024); buf.append("" + - ""); + ""); // jars added in wrapper.config URLClassLoader urlClassLoader = (URLClassLoader) ClassLoader.getSystemClassLoader(); @@ -95,7 +96,9 @@ public class FileDumpHelper extends HelperBase { buf.append((new Date(mod)).toString()); else buf.append("Not found"); - buf.append("
FileSizeDateSHA 256RevisionJDKBuiltMods
JDKBuiltByMods
"); + buf.append(""); + if (mod > 0 && !FileUtil.verifyZip(f)) + buf.append("CORRUPT
"); byte[] hash = sha256(f); if (hash != null) { byte[] hh = new byte[16]; @@ -132,6 +135,10 @@ public class FileDumpHelper extends HelperBase { buf.append(s); buf.append("
"); s = getAtt(att, "Build-Date"); + if (s != null) + buf.append(s); + buf.append(""); + s = getAtt(att, "Built-By"); if (s != null) buf.append(s); buf.append(""); diff --git a/apps/sam/java/build.xml b/apps/sam/java/build.xml index 849fbd55d7..076c2e4533 100644 --- a/apps/sam/java/build.xml +++ b/apps/sam/java/build.xml @@ -72,6 +72,7 @@ + @@ -87,6 +88,7 @@ + diff --git a/apps/streaming/java/build.xml b/apps/streaming/java/build.xml index 5f278f307c..971ae21cf2 100644 --- a/apps/streaming/java/build.xml +++ b/apps/streaming/java/build.xml @@ -64,6 +64,7 @@ + diff --git a/apps/susidns/src/build.xml b/apps/susidns/src/build.xml index 3fff55a34c..49a1629c35 100644 --- a/apps/susidns/src/build.xml +++ b/apps/susidns/src/build.xml @@ -98,6 +98,7 @@ + diff --git a/apps/susimail/build.xml b/apps/susimail/build.xml index 3368283d11..3e22444d89 100644 --- a/apps/susimail/build.xml +++ b/apps/susimail/build.xml @@ -46,6 +46,7 @@ basedir="src/" excludes="WEB-INF/web.xml LICENSE src/**/*"> + diff --git a/apps/systray/java/build.xml b/apps/systray/java/build.xml index 5baf4ab622..eeec392303 100644 --- a/apps/systray/java/build.xml +++ b/apps/systray/java/build.xml @@ -45,6 +45,7 @@ + diff --git a/build.properties b/build.properties index f3ead75765..ab2fa1b991 100644 --- a/build.properties +++ b/build.properties @@ -16,3 +16,5 @@ wrapperdocs.url=http://wrapper.tanukisoftware.com/jdoc/ # these are only for unit test javadocs i2pdocs.url=http://docs.i2p-projekt.de/javadoc/ junitdocs.url=http://junit.org/apidocs/ +# This will go in the jar manifests +build.built-by=unknown diff --git a/build.xml b/build.xml index 9c9105e748..150db9b859 100644 --- a/build.xml +++ b/build.xml @@ -166,6 +166,7 @@ + @@ -241,6 +242,7 @@ + @@ -291,6 +293,7 @@ + @@ -304,6 +307,7 @@ + @@ -318,6 +322,7 @@ + @@ -331,6 +336,7 @@ + @@ -344,6 +350,7 @@ + @@ -357,6 +364,7 @@ + @@ -370,6 +378,7 @@ + @@ -1120,6 +1129,7 @@ + @@ -1128,6 +1138,7 @@ + @@ -1136,6 +1147,7 @@ + @@ -1235,6 +1247,7 @@ + @@ -1243,6 +1256,7 @@ + @@ -1251,6 +1265,7 @@ + diff --git a/core/java/build.xml b/core/java/build.xml index c3eaf5c078..dad75fc9b5 100644 --- a/core/java/build.xml +++ b/core/java/build.xml @@ -59,6 +59,7 @@ + diff --git a/router/java/build.xml b/router/java/build.xml index e933086cf8..990b3e4732 100644 --- a/router/java/build.xml +++ b/router/java/build.xml @@ -73,6 +73,7 @@ +