* Router: Allow null args to main() (broke Android)

This commit is contained in:
zzz
2014-02-20 14:08:05 +00:00
parent aab8b10adf
commit 91cdf85772
4 changed files with 26 additions and 20 deletions

View File

@@ -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

View File

@@ -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();

View File

@@ -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[]) {

View File

@@ -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 = "";