Rename WUPP

This commit is contained in:
eyedeekay
2024-03-12 19:52:20 -04:00
parent 57b500a614
commit 6dfeaded43
4 changed files with 21 additions and 63 deletions

View File

@ -125,7 +125,7 @@ cd "$SCRIPT_DIR"/java
net/i2p/router/CopyConfigDir.java \ net/i2p/router/CopyConfigDir.java \
net/i2p/router/WindowsServiceUtil.java \ net/i2p/router/WindowsServiceUtil.java \
net/i2p/router/WindowsAppUtil.java \ net/i2p/router/WindowsAppUtil.java \
net/i2p/router/WindowsUpdatePostProcessor.java \ net/i2p/router/WinUpdatePostProcessor.java \
net/i2p/router/WinLauncher.java \ net/i2p/router/WinLauncher.java \
net/i2p/router/WinUpdateProcess.java \ net/i2p/router/WinUpdateProcess.java \
net/i2p/router/ZipUpdateProcess.java net/i2p/router/ZipUpdateProcess.java

View File

@ -26,7 +26,7 @@ import net.i2p.util.Log;
*/ */
public class WinLauncher extends WindowsAppUtil { public class WinLauncher extends WindowsAppUtil {
private final CopyConfigDir copyConfigDir; private final CopyConfigDir copyConfigDir;
WindowsUpdatePostProcessor wupp = null; WinUpdatePostProcessor wupp = null;
private Router i2pRouter; private Router i2pRouter;
private final Log logger; private final Log logger;
public WinLauncher() { public WinLauncher() {
@ -56,47 +56,6 @@ public class WinLauncher extends WindowsAppUtil {
var launcher = new WinLauncher(); var launcher = new WinLauncher();
launcher.setupLauncher(); launcher.setupLauncher();
int proxyTimeoutTime = 200; int proxyTimeoutTime = 200;
ArrayList<String> newArgsList = new ArrayList<String>();
if (args != null) {
if (args.length > 0) {
for (String arg : args) {
if (arg.equals("-private")) {
launcher.logger.info(
"Private browsing is true, profile will be discarded at end of session.");
} else if (arg.equals("-chromium")) {
launcher.logger.info("Chromium will be selected before Firefox.");
} else if (arg.equals("-usability")) {
launcher.logger.info(
"Usability mode is true, using alternate extensions loadout.");
} else if (arg.equals("-noproxycheck")) {
proxyTimeoutTime = 0;
launcher.logger.info("Proxy timeout time set to zero");
} else {
// make an effort to not let people launch into sites if the proxy
// isn't quite ready yet, but also disable the proxy timeout if
// they're reaching a router console
if (arg.startsWith("http://localhost:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("http://127.0.0.1:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("https://localhost:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (arg.startsWith("https://127.0.0.1:76")) {
newArgsList.add(arg);
proxyTimeoutTime = 0;
} else if (proxyTimeoutTime > 0) {
newArgsList.add(arg);
} else if (!launcher.isAvailable(4444)) {
newArgsList.add(arg);
}
}
}
}
}
launcher.logger.info("\t" + System.getProperty("user.dir")); launcher.logger.info("\t" + System.getProperty("user.dir"));
launcher.logger.info("\t" + System.getProperty("i2p.dir.base")); launcher.logger.info("\t" + System.getProperty("i2p.dir.base"));
@ -197,7 +156,7 @@ public class WinLauncher extends WindowsAppUtil {
null) { null) {
sleep(1000); sleep(1000);
} }
WindowsUpdatePostProcessor wupp = new WindowsUpdatePostProcessor(ctx); WinUpdatePostProcessor wupp = new WinUpdatePostProcessor(ctx);
um.register(wupp, UpdateType.ROUTER_SIGNED_SU3, SU3File.TYPE_EXE); um.register(wupp, UpdateType.ROUTER_SIGNED_SU3, SU3File.TYPE_EXE);
um.register(wupp, UpdateType.ROUTER_DEV_SU3, SU3File.TYPE_EXE); um.register(wupp, UpdateType.ROUTER_DEV_SU3, SU3File.TYPE_EXE);
}; };

View File

@ -16,7 +16,7 @@ import net.i2p.update.UpdateType;
import net.i2p.util.Log; import net.i2p.util.Log;
import net.i2p.util.SystemVersion; import net.i2p.util.SystemVersion;
public class WindowsUpdatePostProcessor implements UpdatePostProcessor { public class WinUpdatePostProcessor implements UpdatePostProcessor {
private final Log _log; private final Log _log;
private final RouterContext ctx; private final RouterContext ctx;
private final AtomicBoolean hook = new AtomicBoolean(); private final AtomicBoolean hook = new AtomicBoolean();
@ -26,9 +26,9 @@ public class WindowsUpdatePostProcessor implements UpdatePostProcessor {
private volatile File positionedFile = null; private volatile File positionedFile = null;
WindowsUpdatePostProcessor(RouterContext ctx) { WinUpdatePostProcessor(RouterContext ctx) {
this.ctx = ctx; this.ctx = ctx;
this._log = ctx.logManager().getLog(WindowsUpdatePostProcessor.class); this._log = ctx.logManager().getLog(WinUpdatePostProcessor.class);
} }
public String getVersion() { return version; } public String getVersion() { return version; }

View File

@ -4,33 +4,32 @@ import java.io.File;
import net.i2p.util.Log; import net.i2p.util.Log;
public class WindowsAppUtil extends WindowsServiceUtil { public class WindowsAppUtil extends WindowsServiceUtil {
protected File selectHome() { // throws Exception { private File checkPathEnvironmentVariable(String name) {
String path_override = System.getenv("I2P_CONFIG"); String path_override = System.getenv(name);
if (path_override != null) { if (path_override != null) {
File path = new File(path_override); File path = new File(path_override);
if (path != null && path.exists()) { if (path != null && path.exists()) {
if (path.isDirectory()) if (path.isDirectory())
return path.getAbsoluteFile(); return path.getAbsoluteFile();
else else
throw new RuntimeException("I2P_CONFIG is not a directory: " + path); throw new RuntimeException(name + " is not a directory: " + path);
} }
} }
File i2p = appImageHome(); return null;
}
protected File selectHome() { // throws Exception {
File i2p = checkPathEnvironmentVariable("I2P_CONFIG");
String path_override = System.getenv("I2P_CONFIG");
if (i2p == null)
i2p = appImageHome();
return i2p; return i2p;
} }
protected File selectProgramFile() { protected File selectProgramFile() {
String path_override = System.getenv("I2P"); File i2p = checkPathEnvironmentVariable("I2P");
if (path_override != null) { if (i2p == null)
File path = new File(path_override); i2p = appImageHome();
if (path.exists()) {
if (path.isDirectory())
return path.getAbsoluteFile();
else
throw new RuntimeException("I2P is not a directory: " + path);
}
}
File i2p = appImageHome();
return i2p; return i2p;
} }