Skip to content

Commit 8bc04fc

Browse files
committed
misc fixes/enhancements, update copyright, allow portable installations on Windows
1 parent 5405efe commit 8bc04fc

24 files changed

+86
-73
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ Carthage/Build
7575
.idea/**/tasks.xml
7676
.idea/**/dictionaries
7777
.idea/**/shelf
78-
.idea/**/discord.xml # discord plugin
78+
.idea/discord.xml
7979

8080
# Sensitive or high-churn files
8181
.idea/**/dataSources/

.idea/blobsaver.iml

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/compiler.xml

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/blobsaver_main.iml renamed to .idea/modules/blobsaver.main.iml

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules/blobsaver_test.iml renamed to .idea/modules/blobsaver.test.iml

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

blobsaver.iss

+7-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
#define MyAppName "blobsaver"
55
#define MyAppVersion "2.4.0"
6-
#define MyAppPublisher "blobsaver"
6+
#define MyAppPublisher "airsquared"
77
#define MyAppURL "https://www.github.com/airsquared/blobsaver"
88
#define MyAppExeName "blobsaver.exe"
9+
#define MyAppCopyright "Copyright (c) 2020 airsquared"
910

1011
[Setup]
1112
; NOTE: The value of AppId uniquely identifies this application.
@@ -19,8 +20,11 @@ AppPublisher={#MyAppPublisher}
1920
AppPublisherURL={#MyAppURL}
2021
AppSupportURL={#MyAppURL}
2122
AppUpdatesURL={#MyAppURL}
23+
AppCopyright={#MyAppCopyright}
24+
ArchitecturesAllowed=x64 arm64
25+
ArchitecturesInstallIn64BitMode=x64 arm64
26+
Uninstallable=not IsTaskSelected('portableMode')
2227
DefaultDirName={pf}\{#MyAppName}
23-
DisableDirPage=yes
2428
DisableProgramGroupPage=yes
2529
LicenseFile=build\tmp\innosetup\LICENSE
2630
OutputDir=build\distributions
@@ -35,6 +39,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
3539
[Tasks]
3640
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
3741
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1
42+
Name: portableMode; Description: "Portable Mode"
3843

3944
[Files]
4045
Source: "build\tmp\innosetup\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs

build.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*
@@ -118,7 +118,7 @@ task createLinuxTargz(type: Tar, dependsOn: shadowJar) {
118118

119119
launch4j { // Windows only, don't use this, use createWindowsInstaller
120120
mainClassName = "com.airsquared.blobsaver.Main"
121-
copyright = "Copyright (c) 2019 airsquared"
121+
copyright = "Copyright (c) 2020 airsquared"
122122
downloadUrl = "https://java.com/inc/BrowserRedirect1.jsp"
123123
icon = "${projectDir}/icons/blob_emoji.ico"
124124
jreMinVersion = "1.8.0"

gradle/wrapper/gradle-wrapper.properties

+18
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
#
2+
# Copyright (c) 2020 airsquared
3+
#
4+
# This file is part of blobsaver.
5+
#
6+
# blobsaver is free software: you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation, version 3 of the License.
9+
#
10+
# blobsaver is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with blobsaver. If not, see <https://www.gnu.org/licenses/>.
17+
#
18+
119
distributionBase=GRADLE_USER_HOME
220
distributionPath=wrapper/dists
321
zipStoreBase=GRADLE_USER_HOME

settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*

src/main/java/com/airsquared/blobsaver/Background.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*

src/main/java/com/airsquared/blobsaver/Controller.java

+8-15
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*
@@ -37,9 +37,7 @@
3737
import javafx.stage.WindowEvent;
3838
import org.json.JSONArray;
3939

40-
import java.awt.Desktop;
4140
import java.io.File;
42-
import java.io.IOException;
4341
import java.util.ArrayList;
4442
import java.util.Arrays;
4543
import java.util.prefs.BackingStoreException;
@@ -353,7 +351,7 @@ private void loadPreset(int preset) {
353351

354352
private void presetButtonHandler(ActionEvent evt) {
355353
Button btn = (Button) evt.getTarget();
356-
int preset = Integer.valueOf(btn.getId().substring("preset".length()));
354+
int preset = Integer.parseInt(btn.getId().substring("preset".length()));
357355
if (editingPresets) {
358356
savePreset(preset);
359357
savePresetButton.fire();
@@ -577,11 +575,7 @@ public void aboutMenuHandler() {
577575
licenseFile = new File(Main.jarDirectory, "LICENSE");
578576
}
579577
licenseFile.setReadOnly();
580-
try {
581-
Desktop.getDesktop().edit(licenseFile);
582-
} catch (IOException e) {
583-
newReportableError("Unable to open the license file.", e.toString());
584-
}
578+
openURL(licenseFile.toURI().toString());
585579
break;
586580
case "Libraries Used":
587581
File librariesUsedFile;
@@ -594,11 +588,7 @@ public void aboutMenuHandler() {
594588
librariesUsedFile = new File(Main.jarDirectory, "libraries_used.txt");
595589
}
596590
librariesUsedFile.setReadOnly();
597-
try {
598-
Desktop.getDesktop().edit(librariesUsedFile);
599-
} catch (IOException e) {
600-
newReportableError("Unable to open the libraries used file.", e.toString());
601-
}
591+
openURL(librariesUsedFile.toURI().toString());
602592
break;
603593
case "Donate!":
604594
donate();
@@ -744,7 +734,7 @@ public void chooseTimeToRunHandler() {
744734
alert.showAndWait();
745735
if ((alert.getResult() != null) && !ButtonType.CANCEL.equals(alert.getResult()) && !"".equals(textField.getText()) && (choiceBox.getValue() != null)) {
746736
log("info given");
747-
appPrefs.putInt("Time to run", Integer.valueOf(textField.getText()));
737+
appPrefs.putInt("Time to run", Integer.parseInt(textField.getText()));
748738
appPrefs.put("Time unit for background", choiceBox.getValue());
749739
} else {
750740
log("alert menu canceled");
@@ -761,6 +751,9 @@ public void chooseTimeToRunHandler() {
761751
}
762752

763753
public void startBackgroundHandler() {
754+
if (!java.awt.SystemTray.isSupported()) {
755+
newUnreportableError("System Tray is not supported on your OS/platform. Saving blobs in the background will not work without System Tray support.");
756+
}
764757
if (Background.inBackground) { //stops background if already in background
765758
Background.stopBackground(true);
766759
appPrefs.putBoolean("Show background startup message", true);

src/main/java/com/airsquared/blobsaver/DebugWindow.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*

src/main/java/com/airsquared/blobsaver/Devices.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*

src/main/java/com/airsquared/blobsaver/Libimobiledevice.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*
@@ -43,7 +43,7 @@
4343
public class Libimobiledevice {
4444

4545
public static long getEcid(boolean showErrorAlert) {
46-
return Long.valueOf(getKeyFromConnectedDevice("UniqueChipID", PlistType.INTEGER, showErrorAlert));
46+
return Long.parseLong(getKeyFromConnectedDevice("UniqueChipID", PlistType.INTEGER, showErrorAlert));
4747
}
4848

4949
public static String getDeviceModelIdentifier(boolean showErrorAlert) {
@@ -209,6 +209,7 @@ public static void throwIfNeeded(int errorCode, boolean showAlert, ErrorCodeType
209209
}
210210
}
211211

212+
@SuppressWarnings("unused")
212213
public static class LibimobiledeviceException extends RuntimeException {
213214
public LibimobiledeviceException() {
214215
super();

src/main/java/com/airsquared/blobsaver/Main.java

+12-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2019 airsquared
2+
* Copyright (c) 2020 airsquared
33
*
44
* This file is part of blobsaver.
55
*
@@ -74,14 +74,14 @@ public static void main(String[] args) {
7474
try {
7575
Class.forName("javafx.application.Application");
7676
if (PlatformUtil.isMac() || PlatformUtil.isWindows() || PlatformUtil.isLinux()) {
77-
JavaFxApplication.launchIt(args);
77+
JavaFxApplication.launch(JavaFxApplication.class, args);
7878
} else {
7979
int result = javax.swing.JOptionPane.showOptionDialog(null, "Cannot detect the OS. Assuming it is Linux. Continue?",
8080
"Warning", javax.swing.JOptionPane.OK_CANCEL_OPTION, javax.swing.JOptionPane.WARNING_MESSAGE, null, null, null);
8181
if (result == javax.swing.JOptionPane.CANCEL_OPTION) {
8282
System.exit(0);
8383
}
84-
JavaFxApplication.launchIt(args);
84+
JavaFxApplication.launch(JavaFxApplication.class, args);
8585
}
8686
} catch (ClassNotFoundException e) {
8787
javax.swing.JOptionPane.showMessageDialog(null, "JavaFX is not installed. " +
@@ -138,8 +138,15 @@ private static void setJNALibraryPath() {
138138

139139
public static class JavaFxApplication extends Application {
140140

141-
static void launchIt(String[] args) {
142-
launch(args);
141+
private static Application INSTANCE;
142+
143+
public static Application getInstance() {
144+
return INSTANCE;
145+
}
146+
147+
@Override
148+
public void init() {
149+
INSTANCE = this;
143150
}
144151

145152
@Override

0 commit comments

Comments
 (0)