update plugins. Use user's homedir if we're not running in a jpackage.

This commit is contained in:
eyedeekay
2024-07-08 13:03:57 -04:00
parent bdf9ca5548
commit 7f409bfc1f
5 changed files with 56 additions and 41 deletions

View File

@ -12,17 +12,17 @@ noscript
11.4.29 11.4.29
https://addons.mozilla.org/firefox/downloads/file/4206186/noscript-11.4.29.xpi https://addons.mozilla.org/firefox/downloads/file/4206186/noscript-11.4.29.xpi
localcdn-fork-of-decentraleyes localcdn-fork-of-decentraleyes
2.6.64 2.6.69
https://addons.mozilla.org/firefox/downloads/file/4243456/localcdn_fork_of_decentraleyes-2.6.64.xpi https://addons.mozilla.org/firefox/downloads/file/4303757/localcdn_fork_of_decentraleyes-2.6.69.xpi
onion-in-container-browsing onion-in-container-browsing
0.82 0.82
https://addons.mozilla.org/firefox/downloads/file/3904685/onion_in_container_browsing-0.82.xpi https://addons.mozilla.org/firefox/downloads/file/3904685/onion_in_container_browsing-0.82.xpi
javascript-restrictor javascript-restrictor
0.17 0.18.1
https://addons.mozilla.org/firefox/downloads/file/4190089/javascript_restrictor-0.17.xpi https://addons.mozilla.org/firefox/downloads/file/4310951/javascript_restrictor-0.18.1.xpi
ublock-origin ublock-origin
1.56.0 1.58.0
https://addons.mozilla.org/firefox/downloads/file/4237670/ublock_origin-1.56.0.xpi https://addons.mozilla.org/firefox/downloads/file/4290466/ublock_origin-1.58.0.xpi
``` ```
## Chromium ## Chromium
@ -32,15 +32,15 @@ __MSG_extensionName__
1.29 1.29
https://clients2.google.com/service/update2/crx https://clients2.google.com/service/update2/crx
NoScript NoScript
11.4.18 11.4.30
https://clients2.google.com/service/update2/crx https://clients2.google.com/service/update2/crx
LocalCDN LocalCDN
2.6.65 2.6.67
https://clients2.google.com/service/update2/crx https://clients2.google.com/service/update2/crx
uBlock Origin uBlock Origin
1.56.0 1.58.0
https://clients2.google.com/service/update2/crx https://clients2.google.com/service/update2/crx
__MSG_extensionName__ __MSG_extensionName__
0.17 0.18.1
https://clients2.google.com/service/update2/crx https://clients2.google.com/service/update2/crx
``` ```

View File

@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit! #Build Number for ANT. Do not edit!
#Tue Mar 19 18:47:29 EDT 2024 #Mon Jul 08 13:00:28 EDT 2024
build.number=717 build.number=720

View File

@ -295,7 +295,7 @@ public class I2PChromium extends I2PChromiumProfileUnpacker {
} }
// now, do the same thing, but with user.dir instead of plugin // now, do the same thing, but with user.dir instead of plugin
// list the directories in the user.dir directory // list the directories in the user.dir directory
File userDir = new File(System.getProperty("user.dir")); File userDir = userHomeDir();
if (userDir.exists()) { if (userDir.exists()) {
if (isWindows()) { if (isWindows()) {
File searchResult = searchFile(userDir, "ungoogled-chromium.exe"); File searchResult = searchFile(userDir, "ungoogled-chromium.exe");

View File

@ -65,7 +65,9 @@ public class I2PCommonBrowser {
* *
* @return the properties of the object * @return the properties of the object
*/ */
public Properties getProperties() { return prop; } public Properties getProperties() {
return prop;
}
/** /**
* Validates the user directory. * Validates the user directory.
@ -87,7 +89,7 @@ public class I2PCommonBrowser {
if (!userDirFile.getAbsolutePath().contains("Program Files")) { if (!userDirFile.getAbsolutePath().contains("Program Files")) {
if (!userDirFile.getAbsolutePath().equals( if (!userDirFile.getAbsolutePath().equals(
userHomeFile.getAbsolutePath())) { userHomeFile.getAbsolutePath())) {
logger.info("user.dir is not inconvenient"); logger.info("user.dir is not inconvenient");
if (userDirFile.exists()) { if (userDirFile.exists()) {
logger.info("user.dir exists"); logger.info("user.dir exists");
@ -194,15 +196,17 @@ public class I2PCommonBrowser {
* *
* @return the log file for the browser launcher * @return the log file for the browser launcher
*/ */
/*private File logFile() { /*
// validateUserDirectory(); * private File logFile() {
String userDirectory = System.getProperty("user.dir"); * // validateUserDirectory();
File logDirectory = new File(userDirectory, "logs"); * String userDirectory = System.getProperty("user.dir");
if (!logDirectory.exists()) { * File logDirectory = new File(userDirectory, "logs");
logDirectory.mkdirs(); * if (!logDirectory.exists()) {
} * logDirectory.mkdirs();
return new File(logDirectory, "browserlauncher.log"); * }
}*/ * return new File(logDirectory, "browserlauncher.log");
* }
*/
/** /**
* Get the runtime directory, creating it if create=true. * Get the runtime directory, creating it if create=true.
@ -225,7 +229,7 @@ public class I2PCommonBrowser {
* Returns the runtime directory path based on the given override parameter. * Returns the runtime directory path based on the given override parameter.
* *
* @param override the name of the environment variable to override the * @param override the name of the environment variable to override the
* runtime * runtime
* directory * directory
* @return the runtime directory path as a string * @return the runtime directory path as a string
*/ */
@ -283,7 +287,7 @@ public class I2PCommonBrowser {
* @since 0.0.19 * @since 0.0.19
*/ */
protected String profileDirectory(String envVar, String browser, String base, protected String profileDirectory(String envVar, String browser, String base,
boolean app) { boolean app) {
String profileDir = System.getenv(envVar); String profileDir = System.getenv(envVar);
if (profileDir != null && !profileDir.isEmpty()) { if (profileDir != null && !profileDir.isEmpty()) {
File profileDirFile = new File(profileDir); File profileDirFile = new File(profileDir);
@ -305,10 +309,9 @@ public class I2PCommonBrowser {
* @return description of return value * @return description of return value
*/ */
protected String profileDir(String file, String browser, String base, protected String profileDir(String file, String browser, String base,
boolean app) { boolean app) {
String appString = app ? ".app" : ""; String appString = app ? ".app" : "";
String profileDirName = String profileDirName = String.format("i2p.%s.profile.%s%s", browser, base, appString);
String.format("i2p.%s.profile.%s%s", browser, base, appString);
File profileDir = new File(file, profileDirName); File profileDir = new File(file, profileDirName);
return profileDir.getAbsolutePath(); return profileDir.getAbsolutePath();
} }
@ -322,12 +325,11 @@ public class I2PCommonBrowser {
* @return true if the profile was successfully unpacked, false otherwise * @return true if the profile was successfully unpacked, false otherwise
*/ */
protected boolean unpackProfile(String profileDirectory, String browser, protected boolean unpackProfile(String profileDirectory, String browser,
String base) { String base) {
logger.info("Unpacking base profile to " + profileDirectory); logger.info("Unpacking base profile to " + profileDirectory);
try { try {
final InputStream resources = final InputStream resources = this.getClass().getClassLoader().getResourceAsStream(
this.getClass().getClassLoader().getResourceAsStream( "i2p." + browser + "." + base + ".profile.zip");
"i2p." + browser + "." + base + ".profile.zip");
if (resources == null) { if (resources == null) {
logger.info("Could not find resources"); logger.info("Could not find resources");
return false; return false;
@ -377,7 +379,7 @@ public class I2PCommonBrowser {
* @throws IOException if an I/O error occurs during copying * @throws IOException if an I/O error occurs during copying
*/ */
protected void copyDirectory(File sourceDir, File destDir, String browser, protected void copyDirectory(File sourceDir, File destDir, String browser,
String base) throws IOException { String base) throws IOException {
destDir = new File(destDir.toString().replace( destDir = new File(destDir.toString().replace(
"i2p." + browser + "." + base + ".profile", "")); "i2p." + browser + "." + base + ".profile", ""));
if (!destDir.exists()) { if (!destDir.exists()) {
@ -385,7 +387,7 @@ public class I2PCommonBrowser {
} }
for (String file : sourceDir.list()) { for (String file : sourceDir.list()) {
copyDirectoryCompatibilityMode(new File(sourceDir, file), copyDirectoryCompatibilityMode(new File(sourceDir, file),
new File(destDir, file), browser, base); new File(destDir, file), browser, base);
} }
} }
@ -399,8 +401,8 @@ public class I2PCommonBrowser {
* @throws IOException if an I/O error occurs * @throws IOException if an I/O error occurs
*/ */
private void copyDirectoryCompatibilityMode(File sourceDirectory, private void copyDirectoryCompatibilityMode(File sourceDirectory,
File destinationDirectory, File destinationDirectory,
String browser, String base) String browser, String base)
throws IOException { throws IOException {
if (sourceDirectory.isDirectory()) { if (sourceDirectory.isDirectory()) {
copyDirectory(sourceDirectory, destinationDirectory, browser, base); copyDirectory(sourceDirectory, destinationDirectory, browser, base);
@ -435,7 +437,7 @@ public class I2PCommonBrowser {
private void copyFile(File sourceFile, File destinationFile) private void copyFile(File sourceFile, File destinationFile)
throws IOException { throws IOException {
try (InputStream in = new FileInputStream(sourceFile); try (InputStream in = new FileInputStream(sourceFile);
OutputStream out = new FileOutputStream(destinationFile)) { OutputStream out = new FileOutputStream(destinationFile)) {
byte[] buffer = new byte[1024]; byte[] buffer = new byte[1024];
int length; int length;
while ((length = in.read(buffer)) > 0) { while ((length = in.read(buffer)) > 0) {
@ -473,7 +475,9 @@ public class I2PCommonBrowser {
* @return true if the proxy is ready, false if it is not. * @return true if the proxy is ready, false if it is not.
* @since 0.0.1 * @since 0.0.1
*/ */
public boolean waitForProxy() { return waitForProxy(CONFIGURED_TIMEOUT); } public boolean waitForProxy() {
return waitForProxy(CONFIGURED_TIMEOUT);
}
/** /**
* Waits for an HTTP proxy on port 4444 to be ready. * Waits for an HTTP proxy on port 4444 to be ready.
@ -551,7 +555,9 @@ public class I2PCommonBrowser {
* *
* @param time * @param time
*/ */
public void setProxyTimeoutTime(int time) { CONFIGURED_TIMEOUT = time; } public void setProxyTimeoutTime(int time) {
CONFIGURED_TIMEOUT = time;
}
/** /**
* Joins the elements of the given string array into a single string. * Joins the elements of the given string array into a single string.
@ -602,4 +608,13 @@ public class I2PCommonBrowser {
} }
return null; return null;
} }
public File userHomeDir() {
File hd = new File(System.getProperty("user.dir"));
if (hd == null || !hd.exists()) {
hd = new File(System.getProperty("user.home"));
}
logger.info("Runtime directory discovered at: "+ hd);
return hd;
}
} }

View File

@ -292,7 +292,7 @@ public class I2PFirefox extends I2PFirefoxProfileUnpacker {
} }
// now, do the same thing, but with user.dir instead of plugin // now, do the same thing, but with user.dir instead of plugin
// list the directories in the user.dir directory // list the directories in the user.dir directory
File userDir = new File(System.getProperty("user.dir")); File userDir = userHomeDir();
if (userDir.exists()) { if (userDir.exists()) {
if (isWindows()) { if (isWindows()) {
File searchResult = searchFile(userDir, "firefox-esr.exe"); File searchResult = searchFile(userDir, "firefox-esr.exe");