@@ -51,6 +51,7 @@ public class TSS extends Task<String> {
51
51
private static final Pattern ipswURLPattern = Pattern .compile ("(https?://|file:/).*\\ .(ipsw|plist)" );
52
52
private static final Pattern versionPattern = Pattern .compile ("[0-9]+\\ .[0-9]+\\ .?[0-9]*(?<!\\ .)" );
53
53
54
+ private final String name ;
54
55
private final String deviceIdentifier ;
55
56
private final String ecid ;
56
57
private final String savePath ;
@@ -68,7 +69,8 @@ public class TSS extends Task<String> {
68
69
/**
69
70
* Private constructor; use {@link TSS.Builder} instead
70
71
*/
71
- private TSS (String deviceIdentifier , String ecid , String savePath , String boardConfig , boolean includeBetas , String manualVersion , String manualIpswURL , String apnonce , String generator , boolean saveToTSSSaver , boolean saveToSHSHHost ) {
72
+ private TSS (String name , String deviceIdentifier , String ecid , String savePath , String boardConfig , boolean includeBetas , String manualVersion , String manualIpswURL , String apnonce , String generator , boolean saveToTSSSaver , boolean saveToSHSHHost ) {
73
+ this .name = name ;
72
74
this .deviceIdentifier = deviceIdentifier ;
73
75
this .ecid = ecid ;
74
76
this .boardConfig = boardConfig ;
@@ -189,7 +191,8 @@ private String parsePath(String input) {
189
191
if (!input .contains ("${" )) return input ;
190
192
String template = input ;
191
193
192
- var variables = Map .of ("${DeviceIdentifier}" , deviceIdentifier ,
194
+ var variables = Map .of ("${Name}" , Utils .defIfNull (name , "UnknownName" ),
195
+ "${DeviceIdentifier}" , deviceIdentifier ,
193
196
"${BoardConfig}" , getBoardConfig (),
194
197
"${APNonce}" , Utils .defIfNull (apnonce , "UnknownAPNonce" ),
195
198
"${Generator}" , Utils .defIfNull (generator , "UnknownGenerator" ),
@@ -382,9 +385,13 @@ && containsIgnoreCase(tsscheckerLog, "checking tss status failed")) {
382
385
383
386
@ SuppressWarnings ("UnusedReturnValue" )
384
387
public static class Builder {
385
- private String device , ecid , savePath , boardConfig , manualVersion , manualIpswURL , apnonce , generator ;
388
+ private String name , device , ecid , savePath , boardConfig , manualVersion , manualIpswURL , apnonce , generator ;
386
389
private boolean includeBetas , saveToTSSSaver , saveToSHSHHost ;
387
390
391
+ public Builder setName (String name ) {
392
+ this .name = name ;
393
+ return this ;
394
+ }
388
395
public Builder setDevice (String device ) {
389
396
this .device = device ;
390
397
return this ;
@@ -443,7 +450,8 @@ public Builder saveToSHSHHost(boolean saveToSHSHHost) {
443
450
}
444
451
445
452
public TSS build () {
446
- return new TSS (Objects .requireNonNull (device , "Device" ),
453
+ return new TSS (name ,
454
+ Objects .requireNonNull (device , "Device" ),
447
455
Objects .requireNonNull (ecid , "ECID" ),
448
456
Objects .requireNonNull (savePath , "Save Path" ),
449
457
boardConfig , includeBetas , manualVersion , manualIpswURL , apnonce , generator , saveToTSSSaver , saveToSHSHHost );
0 commit comments