mirror of
https://github.com/i2p/i2p.i2p.git
synced 2026-10-23 23:53:08 +00:00
Adds the ability to use $OS and $ARCH variables in clients.config and plugins.config(updateURL.* only)
This commit is contained in:
1 parent
b4e2366458
commit
73e34b3941
3 files changed
+67
-3
No files matched your search
@@ -117,6 +117,56 @@ public abstract class SystemVersion {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the OS of the system running I2P as a lower-case string
|
||||
* for reference in clients.config and plugin.config files.
|
||||
*
|
||||
* matches the conventions of the Go cross compiler
|
||||
*
|
||||
* @return the OS of the system running I2P as a lower-case string
|
||||
* @since 0.9.53
|
||||
*/
|
||||
public static String getOS() {
|
||||
if (isWindows())
|
||||
return "windows";
|
||||
if (isMac())
|
||||
return "mac";
|
||||
if (isGNU())
|
||||
return "linux"; /* actually... */
|
||||
if (isLinuxService())
|
||||
return "linux";
|
||||
if (isAndroid())
|
||||
return "android";
|
||||
/** Everybody else knows if they're on a Windows machine or a
|
||||
* Mac, so for now, assume linux here.
|
||||
*/
|
||||
return "linux";
|
||||
}
|
||||
|
||||
/**
|
||||
* returns the architecture of the system running I2P as a string
|
||||
* for reference in clients.config and plugin.config files.
|
||||
*
|
||||
* matches the conventions of the Go cross compiler
|
||||
*
|
||||
* @return the architecture of the system running I2P as a string
|
||||
* @since 0.9.53
|
||||
*/
|
||||
public static String getArch() {
|
||||
if (is64Bit()){
|
||||
if (isARM())
|
||||
return "arm64";
|
||||
if (isX86())
|
||||
return "amd64";
|
||||
}
|
||||
if (isARM())
|
||||
return "arm";
|
||||
if (isX86())
|
||||
return "386";
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
|
||||
public static boolean isWindows() {
|
||||
return _isWin;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user