Skip to content

Commit 0c37783

Browse files
committed
Java 20
1 parent bab3820 commit 0c37783

File tree

16 files changed

+178
-40
lines changed

16 files changed

+178
-40
lines changed

.github/workflows/main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Set up JDK
1616
uses: actions/setup-java@v3
1717
with:
18-
java-version: '19'
18+
java-version: '20'
1919
distribution: 'zulu'
2020
- name: Install Linux dependencies
2121
run: sudo apt-get install libplist-dev libimobiledevice-dev libirecovery-1.0-dev

.idea/compiler.xml

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

.idea/icon.svg

+17
Loading

.idea/inspectionProfiles/Project_Default.xml

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

.idea/misc.xml

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

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ bugs/problems or have a feature request.
2929

3030
## Built With
3131

32-
- JDK 19
32+
- JDK 20
3333
- [IntelliJ Idea](https://www.jetbrains.com/idea/)
3434
- [Gradle](https://gradle.org/)
3535
- [JLink Plugin](https://github.com/beryx/badass-jlink-plugin)
36-
- [Inno Setup](http://www.jrsoftware.org/isinfo.php) (Windows installer)
36+
- [Inno Setup](http://www.jrsoftware.org/isinfo.php) (Windows)
3737

3838
See the full credits [here](libraries_used.txt).
3939

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def os = DefaultNativePlatform.currentOperatingSystem
4040

4141
startScripts.enabled = distZip.enabled = distTar.enabled = false
4242

43-
java.toolchain.languageVersion = JavaLanguageVersion.of(19)
43+
java.toolchain.languageVersion = JavaLanguageVersion.of(20)
4444

4545
repositories {
4646
mavenCentral()

gradle/wrapper/gradle-wrapper.jar

346 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+2-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum

libraries_used.txt

+124-20
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, [email protected]
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/Controller.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ public void darkModeHandler(ObservableValue<?> a, RadioMenuItem old, RadioMenuIt
296296
Prefs.setDarkMode((Prefs.DarkMode) darkMode.getUserData());
297297
}
298298

299-
@SuppressWarnings("ConstantConditions")
299+
@SuppressWarnings("DataFlowIssue")
300300
private void updateDarkMode(boolean enable) {
301301
if (enable) {
302302
// eventually replace with https://github.com/openjdk/jfx/pull/511 once released

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public JavaFxApplication() {
131131
}
132132

133133
@Override
134-
@SuppressWarnings("ConstantConditions")
134+
@SuppressWarnings("DataFlowIssue")
135135
public void start(Stage primaryStage) {
136136
Main.primaryStage = primaryStage;
137137
Parent root = null;

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

+4-6
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323

2424
import java.io.FileNotFoundException;
2525
import java.io.IOException;
26-
import java.net.MalformedURLException;
2726
import java.net.URI;
2827
import java.net.URISyntaxException;
29-
import java.net.URL;
3028
import java.net.http.HttpResponse;
3129
import java.nio.file.Files;
3230
import java.nio.file.Path;
@@ -265,10 +263,10 @@ private void checkInputs() throws TSSException {
265263
if (manualIpswURL != null) { // check URL
266264
try {
267265
if (!ipswURLPattern.matcher(manualIpswURL).matches()) {
268-
throw new MalformedURLException("Doesn't match ipsw URL regex");
266+
throw new URISyntaxException(manualIpswURL, "Doesn't match ipsw URL regex");
269267
}
270-
new URL(manualIpswURL); // check URL
271-
} catch (MalformedURLException e) {
268+
new URI(manualIpswURL); // check URL
269+
} catch (URISyntaxException e) {
272270
throw new TSSException("The IPSW URL is not valid.\n\nMake sure it's a valid URL that ends with \".ipsw\" or \".plist\"", false, e);
273271
}
274272
if (manualIpswURL.startsWith("file:")) try {
@@ -456,7 +454,7 @@ public TSS build() {
456454
/**
457455
* Checked exception for all TSS related errors.
458456
*/
459-
static class TSSException extends Exception {
457+
public static class TSSException extends Exception {
460458

461459
public final String tssLog;
462460
public final boolean isReportable;

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.io.StringWriter;
3838
import java.io.UncheckedIOException;
3939
import java.net.URI;
40-
import java.net.URL;
4140
import java.nio.ByteOrder;
4241
import java.nio.channels.SeekableByteChannel;
4342
import java.nio.file.Files;
@@ -411,11 +410,12 @@ record IOSVersion(String versionString, String buildid, String ipswURL, Boolean
411410
}
412411
}
413412

413+
// assumes that ipswUrl has been checked with `new URI(ipswUrl)`
414414
static Path extractBuildManifest(String ipswUrl) throws IOException {
415415
Path buildManifest = Files.createTempFile("BuildManifest", ".plist");
416416
buildManifest.toFile().deleteOnExit();
417417
if (ipswUrl.matches("https?://.*apple.*\\.ipsw")) {
418-
var fileName = Path.of(new URL(ipswUrl).getPath()).getFileName().toString();
418+
var fileName = Path.of(URI.create(ipswUrl).getPath()).getFileName().toString();
419419
var manifestURL = ipswUrl.replace(fileName, "BuildManifest.plist");
420420
try {
421421
return Network.downloadFile(manifestURL, buildManifest).body().toRealPath();
@@ -442,7 +442,7 @@ static Path extractBuildManifest(String ipswUrl) throws IOException {
442442
private static void extractManifestFromZip(String ipswUrl, Path extractTo) throws IOException {
443443
SeekableByteChannel channel = ipswUrl.startsWith("file:")
444444
? Files.newByteChannel(Path.of(URI.create(ipswUrl)), StandardOpenOption.READ)
445-
: new Network.HttpChannel(new URL(ipswUrl));
445+
: new Network.HttpChannel(URI.create(ipswUrl).toURL());
446446
try (channel; var ipsw = new ZipFile(channel, "ipsw", "UTF8", true, true);
447447
var stream = ipsw.getInputStream(ipsw.getEntry("BuildManifest.plist"))) {
448448
Files.copy(stream, extractTo, StandardCopyOption.REPLACE_EXISTING);

src/main/java/airsquared/blobsaver/app/natives/Libirecovery.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
/**
2727
* https://github.com/libimobiledevice/libirecovery/blob/master/src/libirecovery.c
2828
*/
29-
public class Libirecovery {
29+
@SuppressWarnings("UnusedReturnValue")
30+
public final class Libirecovery {
3031

3132
public static int open(PointerByReference irecv_client) {
3233
return irecv_open_with_ecid(irecv_client, 0);

0 commit comments

Comments
 (0)