start pure-java solution
Former-commit-id: 9bbb7b926a
Former-commit-id: d0c7e337a6382f59e4ba48e2c01c675917825761
This commit is contained in:
5
gngr.sh
Normal file
5
gngr.sh
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
|
rm lib/jars/gngr.jar
|
||||||
|
mkdir -p lib/jars/
|
||||||
|
wget -c -O lib/jars/gngr.jar https://github.com/gngrOrg/gngr/releases/download/v0.3.16/gngr-0.3.16.jar
|
@ -17,6 +17,7 @@
|
|||||||
<pathelement location="${jettylib}/jetty-xml.jar" />
|
<pathelement location="${jettylib}/jetty-xml.jar" />
|
||||||
<pathelement location="${jettylib}/commons-logging.jar" />
|
<pathelement location="${jettylib}/commons-logging.jar" />
|
||||||
<pathelement location="${jettylib}/commons-el.jar" />
|
<pathelement location="${jettylib}/commons-el.jar" />
|
||||||
|
<pathelement location="lib/jars/gngr.jar" />
|
||||||
</path>
|
</path>
|
||||||
|
|
||||||
<target name="all" depends="clean, build" />
|
<target name="all" depends="clean, build" />
|
||||||
|
@ -150,7 +150,6 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
|||||||
if (line.startsWith(key)) {
|
if (line.startsWith(key)) {
|
||||||
String[] splitLine = line.split(" ");
|
String[] splitLine = line.split(" ");
|
||||||
kb.close();
|
kb.close();
|
||||||
logger.info("line "+ line);
|
|
||||||
String finalValue = splitLine[splitLine.length - 1].trim();
|
String finalValue = splitLine[splitLine.length - 1].trim();
|
||||||
if (!finalValue.equals("")) {
|
if (!finalValue.equals("")) {
|
||||||
return finalValue;
|
return finalValue;
|
||||||
@ -217,12 +216,12 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
|||||||
String defaultValue = registryQuery(hkeyquery, "(Default)");
|
String defaultValue = registryQuery(hkeyquery, "(Default)");
|
||||||
if (defaultValue != null) {
|
if (defaultValue != null) {
|
||||||
if (!defaultValue.equals(""))
|
if (!defaultValue.equals(""))
|
||||||
return defaultValue.split(" ")[0];
|
return defaultValue;
|
||||||
} else {
|
} else {
|
||||||
defaultValue = followUserConfiguredBrowserToCommand(hkeyquery);
|
defaultValue = followUserConfiguredBrowserToCommand(hkeyquery);
|
||||||
if (defaultValue != null) {
|
if (defaultValue != null) {
|
||||||
if (!defaultValue.equals(""))
|
if (!defaultValue.equals(""))
|
||||||
return defaultValue.split(" ")[0];
|
return defaultValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -278,7 +277,7 @@ public class I2PGenericUnsafeBrowser extends I2PCommonBrowser {
|
|||||||
//
|
//
|
||||||
public ProcessBuilder baseProcessBuilder(String[] args) {
|
public ProcessBuilder baseProcessBuilder(String[] args) {
|
||||||
|
|
||||||
String browser = findUnsafeBrowserAnywhere();
|
String browser = findUnsafeBrowserAnywhere().split(" -")[0].trim();
|
||||||
if (browser == null)
|
if (browser == null)
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
if (browser.contains("edge.exe") || browser.contains("msedge.exe")){
|
if (browser.contains("edge.exe") || browser.contains("msedge.exe")){
|
||||||
|
Reference in New Issue
Block a user