diff --git a/history.txt b/history.txt index 64a8cb911..2b77c3537 100644 --- a/history.txt +++ b/history.txt @@ -1,3 +1,7 @@ +2014-02-20 zzz + * i2ptunnel: Add inproxy block option to HTTP server + * Router: Allow null args to main() (broke Android) + 2014-02-17 zzz * HMAC: - Replace BC MD5 with JVM version, refactor I2PHMAC to use diff --git a/router/java/src/net/i2p/router/Router.java b/router/java/src/net/i2p/router/Router.java index 04dae1e8f..600c35f71 100644 --- a/router/java/src/net/i2p/router/Router.java +++ b/router/java/src/net/i2p/router/Router.java @@ -1109,30 +1109,32 @@ public class Router implements RouterClock.ClockShiftListener { * Usage: Router [rebuild] * No other options allowed, for now * - * @param args non-null + * @param args null ok * @throws IllegalArgumentException */ public static void main(String args[]) { - boolean error = false; - Getopt g = new Getopt("router", args, ""); - int c; - while ((c = g.getopt()) != -1) { - switch (c) { - default: + boolean rebuild = false; + if (args != null) { + boolean error = false; + Getopt g = new Getopt("router", args, ""); + int c; + while ((c = g.getopt()) != -1) { + switch (c) { + default: + error = true; + } + } + int remaining = args.length - g.getOptind(); + if (remaining > 1) { + error = true; + } else if (remaining == 1) { + rebuild = args[g.getOptind()].equals("rebuild");; + if (!rebuild) error = true; } + if (error) + throw new IllegalArgumentException(); } - boolean rebuild = false; - int remaining = args.length - g.getOptind(); - if (remaining > 1) { - error = true; - } else if (remaining == 1) { - rebuild = args[g.getOptind()].equals("rebuild");; - if (!rebuild) - error = true; - } - if (error) - throw new IllegalArgumentException(); System.out.println("Starting I2P " + RouterVersion.FULL_VERSION); //verifyWrapperConfig(); diff --git a/router/java/src/net/i2p/router/RouterLaunch.java b/router/java/src/net/i2p/router/RouterLaunch.java index 5ebe0e16b..f1fcbc09e 100644 --- a/router/java/src/net/i2p/router/RouterLaunch.java +++ b/router/java/src/net/i2p/router/RouterLaunch.java @@ -14,7 +14,7 @@ public class RouterLaunch { * Usage: RouterLaunch [rebuild] * No other options allowed, for now * - * @param args non-null + * @param args null ok * @throws IllegalArgumentException */ public static void main(String args[]) { diff --git a/router/java/src/net/i2p/router/RouterVersion.java b/router/java/src/net/i2p/router/RouterVersion.java index f2522cd4e..7ca1a3ec2 100644 --- a/router/java/src/net/i2p/router/RouterVersion.java +++ b/router/java/src/net/i2p/router/RouterVersion.java @@ -18,7 +18,7 @@ public class RouterVersion { /** deprecated */ public final static String ID = "Monotone"; public final static String VERSION = CoreVersion.VERSION; - public final static long BUILD = 9; + public final static long BUILD = 10; /** for example "-test" */ public final static String EXTRA = "";