[AltServer] Fixes session expiring when downloading apps on slow connection

This commit is contained in:
Riley Testut
2020-01-16 16:00:35 -08:00
parent 8ba41a9c5b
commit 345862c770

View File

@@ -108,6 +108,13 @@ extension ALTDeviceManager
guard let application = ALTApplication(fileURL: appBundleURL) else { throw ALTError(.invalidApp) } guard let application = ALTApplication(fileURL: appBundleURL) else { throw ALTError(.invalidApp) }
// Refresh anisette data to prevent session timeouts.
AnisetteDataManager.shared.requestAnisetteData { (result) in
do
{
let anisetteData = try result.get()
session.anisetteData = anisetteData
self.registerAppID(name: "AltStore", identifier: "com.rileytestut.AltStore", team: team, session: session) { (result) in self.registerAppID(name: "AltStore", identifier: "com.rileytestut.AltStore", team: team, session: session) { (result) in
do do
{ {
@@ -146,9 +153,14 @@ extension ALTDeviceManager
} }
} }
catch catch
{
finish(error, title: "Failed to Refresh Anisette Data")
}
}
}
catch
{ {
finish(error, title: "Failed to Download AltStore") finish(error, title: "Failed to Download AltStore")
return
} }
} }
} }