mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-20 12:13:26 +01:00
[AltServer] Supports changing AltJIT timeout via defaults CLI
This commit is contained in:
@@ -36,3 +36,16 @@ extension UserDefaults
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// "Public" defaults configurable via CLI.
|
||||||
|
extension UserDefaults
|
||||||
|
{
|
||||||
|
private static let altJITTimeoutKey = "JITTimeout"
|
||||||
|
|
||||||
|
var altJITTimeout: TimeInterval? {
|
||||||
|
let timeout = self.double(forKey: UserDefaults.altJITTimeoutKey) // Coerces strings into doubles.
|
||||||
|
guard timeout != 0 else { return nil }
|
||||||
|
|
||||||
|
return timeout
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -137,6 +137,11 @@ private extension JITManager
|
|||||||
}
|
}
|
||||||
arguments += ["--udid", device.identifier]
|
arguments += ["--udid", device.identifier]
|
||||||
|
|
||||||
|
if let timeout = UserDefaults.standard.altJITTimeout
|
||||||
|
{
|
||||||
|
arguments += ["--timeout", String(timeout)]
|
||||||
|
}
|
||||||
|
|
||||||
self.authorization = try Process.runAsAdmin(URL.altjit.path, arguments: arguments, authorization: self.authorization)
|
self.authorization = try Process.runAsAdmin(URL.altjit.path, arguments: arguments, authorization: self.authorization)
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
|||||||
Reference in New Issue
Block a user