Skip to content

Commit

Permalink
Update dependencies (qzind#1000)
Browse files Browse the repository at this point in the history
* Bump Java and internal versions to use "-SNAPSHOT" notation between builds
* Handle JDK-8240734 for older JDKs too.
* Add workaround for broken commons-io copyDirectory behavior.

Per qzind#1011

Co-authored-by: lite1979 <[email protected]>
  • Loading branch information
tresf and lite1979 authored Aug 21, 2022
1 parent 14d249e commit 0e151fb
Show file tree
Hide file tree
Showing 45 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions js/qz-tray.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

/**
* @version 2.2.1
* @version 2.2.2-SNAPSHOT
* @overview QZ Tray Connector
* <p/>
* Connects a web client to the QZ Tray software.
Expand Down Expand Up @@ -38,7 +38,7 @@ var qz = (function() {
///// PRIVATE METHODS /////

var _qz = {
VERSION: "2.2.1", //must match @version above
VERSION: "2.2.2-SNAPSHOT", //must match @version above
DEBUG: false,

log: {
Expand Down
Binary file removed lib/commons-codec-1.10.jar
Binary file not shown.
Binary file added lib/commons-codec-1.15.jar
Binary file not shown.
Binary file added lib/commons-io-2.11.0.jar
Binary file not shown.
Binary file removed lib/commons-io-2.4.jar
Binary file not shown.
Binary file added lib/commons-lang3-3.12.0.jar
Binary file not shown.
Binary file removed lib/commons-lang3-3.4.jar
Binary file not shown.
Binary file added lib/commons-pool2-2.11.1.jar
Binary file not shown.
Binary file removed lib/commons-pool2-2.4.2.jar
Binary file not shown.
Binary file added lib/communication/jna-5.12.1.jar
Binary file not shown.
Binary file removed lib/communication/jna-5.8.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed lib/imaging/common-lang-3.6.jar
Binary file not shown.
Binary file added lib/imaging/common-lang-3.8.2.jar
Binary file not shown.
Binary file removed lib/imaging/imageio-core-3.6.jar
Binary file not shown.
Binary file added lib/imaging/imageio-core-3.8.2.jar
Binary file not shown.
Binary file removed lib/imaging/imageio-jpeg-3.6.jar
Binary file not shown.
Binary file added lib/imaging/imageio-jpeg-3.8.2.jar
Binary file not shown.
Binary file removed lib/imaging/imageio-metadata-3.6.jar
Binary file not shown.
Binary file added lib/imaging/imageio-metadata-3.8.2.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed lib/mslinks-1.0.7.jar
Binary file not shown.
Binary file added lib/mslinks-1.1.0.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
7 changes: 3 additions & 4 deletions src/qz/build/JLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public class JLink {
private static final Logger log = LogManager.getLogger(JLink.class);
private static final String JAVA_AMD64_VENDOR = "AdoptOpenJDK";
private static final String JAVA_ARM64_VENDOR = "BellSoft";
private static final String JAVA_VERSION = "11.0.12+7";
private static final String JAVA_VERSION = "11.0.16+8";
private static final String JAVA_MAJOR = JAVA_VERSION.split("\\.")[0];
private static final String JAVA_MINOR = JAVA_VERSION.split("\\.")[1];
private static final String JAVA_PATCH = JAVA_VERSION.split("\\.|\\+|-")[2];
Expand Down Expand Up @@ -92,12 +92,11 @@ private static boolean needsDownload(Version want, Version installed) {
// Per JDK-8240734: Major versions checks aren't enough starting with 11.0.16+8
// see also https://github.com/adoptium/adoptium-support/issues/557
Version bad = SystemUtilities.getJavaVersion("11.0.16+8");
if(installed.greaterThanOrEqualTo(bad)) {
if(want.lessThan(bad)) {
if(want.greaterThanOrEqualTo(bad) && installed.lessThan(bad) ||
installed.greaterThanOrEqualTo(bad) && want.lessThan(bad)) {
// Force download
// Fixes "Hash of java.rmi differs from expected hash"
downloadJdk = true;
}
}
return downloadJdk;
}
Expand Down
2 changes: 1 addition & 1 deletion src/qz/common/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Constants {
public static final String HEXES = "0123456789ABCDEF";
public static final char[] HEXES_ARRAY = HEXES.toCharArray();
public static final int BYTE_BUFFER_SIZE = 8192;
public static final Version VERSION = Version.valueOf("2.2.1");
public static final Version VERSION = Version.valueOf("2.2.2-SNAPSHOT");
public static final Version JAVA_VERSION = SystemUtilities.getJavaVersion();
public static final String JAVA_VENDOR = System.getProperty("java.vendor");

Expand Down
3 changes: 2 additions & 1 deletion src/qz/installer/Installer.java
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ public Installer deployApp() throws IOException {

// Delete the JDK blindly
FileUtils.deleteDirectory(dest.resolve(JRE_LOCATION).toFile());
FileUtils.copyDirectory(src.toFile(), dest.toFile());
// Note: preserveFileDate=false per https://github.com/qzind/tray/issues/1011
FileUtils.copyDirectory(src.toFile(), dest.toFile(), false);
FileUtilities.setPermissionsRecursively(dest, false);

if(!SystemUtilities.isWindows()) {
Expand Down
5 changes: 3 additions & 2 deletions src/qz/utils/JsonWriter.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Iterator;

/**
Expand Down Expand Up @@ -50,7 +51,7 @@ public static boolean write(String path, String data, boolean overwrite, boolean
remove(config, append);
}

FileUtils.write(f, config.toString(2));
FileUtils.write(f, config.toString(2), StandardCharsets.UTF_8);

return true;
}
Expand All @@ -61,7 +62,7 @@ public static boolean contains(File path, String data) {
return false;
}

String jsonData = FileUtils.readFileToString(path, Charsets.UTF_8);
String jsonData = FileUtils.readFileToString(path, StandardCharsets.UTF_8);
JSONObject before = new JSONObject(jsonData);
JSONObject after = new JSONObject(jsonData);
merge(after, new JSONObject(data), true);
Expand Down
3 changes: 2 additions & 1 deletion src/qz/utils/LinuxUtilities.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ public class LinuxUtilities {
public static boolean elevatedFileCopy(Path source, Path destination) {
// Don't prompt if it's not needed
try {
FileUtils.copyFile(source.toFile(), destination.toFile());
// Note: preserveFileDate=false per https://github.com/qzind/tray/issues/1011
FileUtils.copyFile(source.toFile(), destination.toFile(), false);
return true;
} catch(IOException ignore) {}
if(foundElevator == null) {
Expand Down

0 comments on commit 0e151fb

Please sign in to comment.