From 94ac8b146067e2a225b6fa82afd1269613cf1946 Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Wed, 25 Apr 2018 22:02:41 -0400 Subject: [PATCH] Fixed upstream revision check. --- gradle/.idea/runConfigurations/GUI.xml | 16 ---------------- .../java/com/lyndir/masterpassword/gui/GUI.java | 10 +++++----- 2 files changed, 5 insertions(+), 21 deletions(-) delete mode 100644 gradle/.idea/runConfigurations/GUI.xml diff --git a/gradle/.idea/runConfigurations/GUI.xml b/gradle/.idea/runConfigurations/GUI.xml deleted file mode 100644 index 7c0766a3..00000000 --- a/gradle/.idea/runConfigurations/GUI.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - \ No newline at end of file diff --git a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java index ffd8582e..89fc71d5 100644 --- a/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java +++ b/platform-independent/gui-java/src/main/java/com/lyndir/masterpassword/gui/GUI.java @@ -71,14 +71,14 @@ public class GUI implements UnlockFrame.SignInCallback { continue; String manifestRevision = attributes.getValue( Attributes.Name.IMPLEMENTATION_VERSION ); - String upstreamRevisionURL = "http://masterpasswordapp.com/masterpassword-gui.jar.rev"; + String upstreamRevisionURL = "https://masterpasswordapp.com/masterpassword-gui.jar.rev"; CharSource upstream = Resources.asCharSource( URI.create( upstreamRevisionURL ).toURL(), Charsets.UTF_8 ); String upstreamRevision = upstream.readFirstLine(); - logger.inf( "Local Revision: <%s>", manifestRevision ); - logger.inf( "Upstream Revision: <%s>", upstreamRevision ); - if ((manifestRevision != null) && !manifestRevision.equalsIgnoreCase( upstreamRevision )) { + if ((manifestRevision != null) && (upstreamRevision != null) && !manifestRevision.equalsIgnoreCase( upstreamRevision )) { + logger.inf( "Local Revision: <%s>", manifestRevision ); + logger.inf( "Upstream Revision: <%s>", upstreamRevision ); logger.wrn( "You are not running the current official version. Please update from:\n" - + "http://masterpasswordapp.com/masterpassword-gui.jar" ); + + "https://masterpasswordapp.com/masterpassword-gui.jar" ); JOptionPane.showMessageDialog( null, "A new version of Master Password is available.\n" + "Please download the latest version from http://masterpasswordapp.com", "Update Available", JOptionPane.WARNING_MESSAGE );