Skip to content

Commit 7621f80

Browse files
committed
Fix about menu
1 parent 095f49f commit 7621f80

File tree

13 files changed

+149
-56
lines changed

13 files changed

+149
-56
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Declare files that will always have CRLF line endings on checkout.
22
/dist/windows/files/LICENSE text eol=crlf
3-
/libraries_used.txt text eol=lf
3+
/dist/libraries_used.txt text eol=lf
44
/dist/windows/files/libraries_used.txt text eol=crlf
55
gradlew.bat text eol=crlf
66
gradlew text eol=lf

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ bugs/problems or have a feature request.
3535
- [JLink Plugin](https://github.com/beryx/badass-jlink-plugin)
3636
- [Inno Setup](http://www.jrsoftware.org/isinfo.php) (Windows)
3737

38-
See the full credits [here](libraries_used.txt).
38+
See the full credits [here](dist/libraries_used.txt).
3939

4040
## License [![GitHub license](https://img.shields.io/github/license/airsquared/blobsaver.svg)](https://github.com/airsquared/blobsaver/blob/master/LICENSE)
4141
This project is licensed under GNU GPL v3.0-only - see the [LICENSE](https://github.com/airsquared/blobsaver/blob/master/LICENSE) file for details

build.gradle

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ test {
9393

9494
jlink {
9595
if (findProperty('noCompress') != 'true') {
96-
addOptions '--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages', '--strip-native-commands',
96+
addOptions '--strip-debug', '--compress=2', '--no-header-files', '--no-man-pages', '--strip-native-commands',
9797
'--dedup-legal-notices=error-if-not-same-content'
9898
}
9999
launcher {
@@ -114,33 +114,21 @@ jlink {
114114
installerName = "${name}-${arch}"
115115
//noinspection GroovyAssignabilityCheck
116116
imageOptions.addAll '--mac-package-identifier', appIdentifier,
117-
'--app-content', "${projectDir}/dist/macos/Contents/Frameworks," +
118-
"${projectDir}/dist/macos/Contents/MacOS"
119-
icon = "${projectDir}/dist/macos/Contents/Resources/blob.icns"
117+
'--app-content', file('dist/macos/Contents').listFiles().join(',')
118+
icon = 'dist/macos/blob.icns'
120119
} else if (os.isWindows()) {
121-
installerOptions.addAll '--win-dir-chooser', '--win-menu', '--win-shortcut'
122-
icon = "${projectDir}/dist/windows/blob.ico"
123-
imageOptions.addAll '--app-content', file("${projectDir}/dist/windows/files").listFiles().join(',')
120+
icon = 'dist/windows/blob.ico'
121+
imageOptions.addAll '--app-content', file('dist/windows/files').listFiles().join(',')
124122
} else {
125123
installerOptions.addAll '--linux-shortcut', '--linux-menu-group', 'Utility;Archiving;Java',
126124
'--linux-rpm-license-type', 'GPLv3'
127-
icon = "${projectDir}/src/main/resources/airsquared/blobsaver/app/blob.png"
128-
imageOptions.addAll '--app-content', fileTree("${projectDir}/dist/linux").join(',') + ',' +
129-
"${projectDir}/LICENSE,${projectDir}/libraries_used.txt"
125+
icon = 'src/main/resources/airsquared/blobsaver/app/blob.png'
126+
imageOptions.addAll '--app-content', file('dist/linux').listFiles().join(',')
130127
}
131128
if (findProperty('installerType') != null) {
132129
installerType = findProperty('installerType')
133130
}
134131
}
135-
if (os.isMacOsX()) jpackageImage.doLast {
136-
copy {
137-
from "${projectDir}/LICENSE", "${projectDir}/libraries_used.txt"
138-
into layout.buildDirectory.dir('jpackage/blobsaver.app/Contents/Resources')
139-
}
140-
exec { // needed to prevent "application is damaged" error when opening quarantined app
141-
commandLine 'codesign', '--force', '--deep', '--sign', '-', "${layout.buildDirectory.get()}/jpackage/blobsaver.app"
142-
}
143-
}
144132
}
145133

146134
task createZip(type: Zip, dependsOn: jpackageImage) {
@@ -169,10 +157,10 @@ task createTgz(type: Tar, dependsOn: jpackageImage) {
169157
task windowsInstaller(type: Exec, dependsOn: jpackageImage) { // requires inno setup to be installed
170158
doFirst {
171159
copy {
172-
from "${projectDir}/dist/windows/blob.ico" into layout.buildDirectory.dir('jpackage')
160+
from 'dist/windows/blob.ico' into layout.buildDirectory.dir('jpackage')
173161
}
174162
copy {
175-
from "${projectDir}/dist/windows/blobsaver.iss" into layout.buildDirectory.dir('jpackage')
163+
from '/dist/windows/blobsaver.iss' into layout.buildDirectory.dir('jpackage')
176164
filter(ReplaceTokens, tokens: [AppName: project.name, AppVersion: version, AppCopyright: copyright,
177165
OutputDir: "${layout.buildDirectory.get()}\\distributions".toString()])
178166
}
File renamed without changes.

dist/linux/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../LICENSE

dist/linux/libraries_used.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../libraries_used.txt

dist/macos/Contents/Resources/LICENSE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../LICENSE
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../libraries_used.txt
File renamed without changes.

dist/windows/files/libraries_used.txt

Lines changed: 124 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Libraries used by blobsaver:
22

33
============================================================================
44

5-
tsschecker (https://github.com/tihmstar/tsschecker)
5+
tsschecker (https://github.com/1Conan/tsschecker)
66

77
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
88

@@ -25,6 +25,36 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
2525

2626
============================================================================
2727

28+
Java Native Access (https://github.com/java-native-access/jna)
29+
30+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
31+
32+
Java Native Access (JNA) is licensed under the LGPL, version 2.1
33+
or later, or (from version 4.0 onward) the Apache License,
34+
version 2.0.
35+
36+
You can freely decide which license you want to apply to the project.
37+
38+
You may obtain a copy of the LGPL License at:
39+
40+
http://www.gnu.org/licenses/licenses.html
41+
42+
A copy is also included in the downloadable source code package
43+
containing JNA, in file "LGPL2.1", under the same directory
44+
as this file.
45+
46+
You may obtain a copy of the Apache License at:
47+
48+
http://www.apache.org/licenses/
49+
50+
A copy is also included in the downloadable source code package
51+
containing JNA, in file "AL2.0", under the same directory
52+
as this file.
53+
54+
============================================================================
55+
56+
============================================================================
57+
2858
libimobiledevice (https://github.com/libimobiledevice)
2959

3060
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -48,31 +78,23 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
4878

4979
============================================================================
5080

51-
JSON in Java (https://github.com/stleary/JSON-java)
81+
Gson (https://github.com/google/gson)
5282

5383
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
5484

55-
Copyright (c) 2002 JSON.org
56-
57-
Permission is hereby granted, free of charge, to any person obtaining a copy
58-
of this software and associated documentation files (the "Software"), to deal
59-
in the Software without restriction, including without limitation the rights
60-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
61-
copies of the Software, and to permit persons to whom the Software is
62-
furnished to do so, subject to the following conditions:
85+
Copyright 2008 Google Inc.
6386

64-
The above copyright notice and this permission notice shall be included in all
65-
copies or substantial portions of the Software.
87+
Licensed under the Apache License, Version 2.0 (the "License");
88+
you may not use this file except in compliance with the License.
89+
You may obtain a copy of the License at
6690

67-
The Software shall be used for Good, not Evil.
91+
http://www.apache.org/licenses/LICENSE-2.0
6892

69-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
70-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
71-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
72-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
73-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
74-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
75-
SOFTWARE.
93+
Unless required by applicable law or agreed to in writing, software
94+
distributed under the License is distributed on an "AS IS" BASIS,
95+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
96+
See the License for the specific language governing permissions and
97+
limitations under the License.
7698

7799
============================================================================
78100

@@ -109,3 +131,85 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
109131

110132
============================================================================
111133

134+
============================================================================
135+
136+
Apache Commons Compress (https://github.com/apache/commons-compress)
137+
138+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
139+
140+
Copyright 2002-2023 The Apache Software Foundation
141+
142+
This product includes software developed at
143+
The Apache Software Foundation (https://www.apache.org/).
144+
145+
---
146+
147+
The files in the package org.apache.commons.compress.archivers.sevenz
148+
were derived from the LZMA SDK, version 9.20 (C/ and CPP/7zip/),
149+
which has been placed in the public domain:
150+
151+
"LZMA SDK is placed in the public domain." (http://www.7-zip.org/sdk.html)
152+
153+
---
154+
155+
The test file lbzip2_32767.bz2 has been copied from libbzip2's source
156+
repository:
157+
158+
This program, "bzip2", the associated library "libbzip2", and all
159+
documentation, are copyright (C) 1996-2019 Julian R Seward. All
160+
rights reserved.
161+
162+
Redistribution and use in source and binary forms, with or without
163+
modification, are permitted provided that the following conditions
164+
are met:
165+
166+
1. Redistributions of source code must retain the above copyright
167+
notice, this list of conditions and the following disclaimer.
168+
169+
2. The origin of this software must not be misrepresented; you must
170+
not claim that you wrote the original software. If you use this
171+
software in a product, an acknowledgment in the product
172+
documentation would be appreciated but is not required.
173+
174+
3. Altered source versions must be plainly marked as such, and must
175+
not be misrepresented as being the original software.
176+
177+
4. The name of the author may not be used to endorse or promote
178+
products derived from this software without specific prior written
179+
permission.
180+
181+
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
182+
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
183+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
184+
ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
185+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
186+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
187+
GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
188+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
189+
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
190+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
191+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
192+
193+
Julian Seward, jseward@acm.org
194+
195+
============================================================================
196+
197+
============================================================================
198+
199+
Picocli (https://github.com/remkop/picocli)
200+
201+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
202+
203+
Licensed under the Apache License, Version 2.0 (the "License");
204+
you may not use this file except in compliance with the License.
205+
You may obtain a copy of the License at
206+
207+
http://www.apache.org/licenses/LICENSE-2.0
208+
209+
Unless required by applicable law or agreed to in writing, software
210+
distributed under the License is distributed on an "AS IS" BASIS,
211+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
212+
See the License for the specific language governing permissions and
213+
limitations under the License.
214+
215+
============================================================================

src/main/java/airsquared/blobsaver/app/CLI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ private static Prefs.SavedDevice savedDeviceConverter(String name) {
285285
.findAny().orElseThrow(() -> new TypeConversionException("Must be one of " + Prefs.getSavedDevices() + "\n"));
286286
}
287287

288-
private static int handleExecutionException(Exception ex, CommandLine cmd, ParseResult parseResult) throws Exception {
288+
private static int handleExecutionException(Exception ex, CommandLine cmd, ParseResult __) throws Exception {
289289
boolean messageOnly = ex instanceof ExecutionException
290290
// if either the exception is not reportable or there is a tssLog present
291291
|| ex instanceof TSS.TSSException e && (!e.isReportable || e.tssLog != null)
@@ -300,7 +300,7 @@ private static int handleExecutionException(Exception ex, CommandLine cmd, Parse
300300
throw ex;
301301
}
302302

303-
private static int handleParameterException(ParameterException ex, String[] args) {
303+
private static int handleParameterException(ParameterException ex, String[] __) {
304304
CommandLine cmd = ex.getCommandLine();
305305
CommandSpec spec = cmd.getCommandSpec();
306306
boolean isRootCommand = spec == spec.root();

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ public void ipswURLHelp() {
354354

355355
public void aboutMenuHandler(Event ignored) {
356356
Alert alert = new Alert(Alert.AlertType.INFORMATION, "", new ButtonType("Libraries Used"),
357-
new ButtonType("License"), new ButtonType("Github Repo"), ButtonType.CLOSE);
357+
new ButtonType("License"), new ButtonType("GitHub Repo"), ButtonType.CLOSE);
358358
alert.initOwner(Main.primaryStage);
359359
alert.initModality(Modality.WINDOW_MODAL);
360360
alert.getDialogPane().getScene().getWindow().focusedProperty().addListener((_,_, focused) -> {
@@ -371,8 +371,8 @@ public void aboutMenuHandler(Event ignored) {
371371

372372
alert.showAndWait();
373373
switch (alert.getResult().getText()) {
374-
case "Github Repo" -> Utils.openURL("https://github.com/airsquared/blobsaver");
375-
case "View License" -> Utils.openURL(Utils.getLicenseFile().toURI().toString());
374+
case "GitHub Repo" -> Utils.openURL("https://github.com/airsquared/blobsaver");
375+
case "License" -> Utils.openURL(Utils.getLicenseFile().toURI().toString());
376376
case "Libraries Used" -> Utils.openURL(Utils.getLibrariesUsedFile().toURI().toString());
377377
}
378378
}

src/main/java/airsquared/blobsaver/app/Utils.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@ final class Utils {
6767
private static File tsschecker, blobsaverExecutable;
6868
private static File licenseFile, librariesUsedFile;
6969

70-
static ExecutorService threadPool;
70+
private final static ExecutorService threadPool = Executors.newCachedThreadPool(r -> {
71+
var t = new Thread(r);
72+
t.setDaemon(true); // don't prevent application from exiting
73+
return t;
74+
});
7175

7276
public static void executeInThreadPool(Runnable command) {
73-
if (threadPool == null) {
74-
threadPool = Executors.newCachedThreadPool(r -> {
75-
Thread t = new Thread(r);
76-
t.setDaemon(true); // don't prevent application from exiting
77-
return t;
78-
});
79-
}
8077
threadPool.execute(command);
8178
}
8279

0 commit comments

Comments
 (0)