* SystemVersion: New util, to consolidate duplicate code,

and determine Java version on Android
This commit is contained in:
zzz
2012-09-09 15:40:14 +00:00
parent 9bc54f27cf
commit 74e753934c
24 changed files with 148 additions and 47 deletions

View File

@@ -15,6 +15,7 @@ import java.io.File;
import net.i2p.I2PAppContext;
import net.i2p.util.SimpleScheduler;
import net.i2p.util.SimpleTimer;
import net.i2p.util.SystemVersion;
import snoozesoft.systray4j.SysTrayMenu;
import snoozesoft.systray4j.SysTrayMenuEvent;
@@ -37,8 +38,7 @@ public class SysTray implements SysTrayMenuListener {
private static String _portString;
private static boolean _showIcon;
private static UrlLauncher _urlLauncher = new UrlLauncher();
private static final boolean _is64 = "64".equals(System.getProperty("sun.arch.data.model")) ||
System.getProperty("os.arch").contains("64");
private static final boolean _is64 = SystemVersion.is64Bit();
static {
File config = new File(I2PAppContext.getGlobalContext().getConfigDir(), "systray.config");
@@ -54,7 +54,7 @@ public class SysTray implements SysTrayMenuListener {
//if (!(new File("router.config")).exists())
// openRouterConsole("http://localhost:" + _portString + "/index.jsp");
if ( (System.getProperty("os.name").startsWith("Windows")) && (!Boolean.getBoolean("systray.disable")) && (!_is64))
if ( (SystemVersion.isWindows()) && (!Boolean.getBoolean("systray.disable")) && (!_is64))
_instance = new SysTray();
}

View File

@@ -23,6 +23,7 @@ import java.util.Locale;
import net.i2p.I2PAppContext;
import net.i2p.util.ShellCommand;
import net.i2p.util.SystemVersion;
/**
* A quick and simple multi-platform URL launcher. It attempts to launch the
@@ -124,7 +125,7 @@ public class UrlLauncher {
if (_shellCommand.executeSilentAndWaitTimed("iexplore " + url, 5))
return true;
} else if (osName.startsWith("Windows")) {
} else if (SystemVersion.isWindows()) {
String browserString = "\"C:\\Program Files\\Internet Explorer\\iexplore.exe\" -nohome";
BufferedReader bufferedReader = null;