mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
[AltServer] Downloads AltStore, no longer includes in app bundle
This commit is contained in:
Binary file not shown.
@@ -44,7 +44,7 @@ class ViewController: NSViewController
|
|||||||
switch state
|
switch state
|
||||||
{
|
{
|
||||||
case .notRunning: self.view.window?.title = ""
|
case .notRunning: self.view.window?.title = ""
|
||||||
case .connecting: self.view.window?.title = "Connecting..."
|
case .connecting: self.view.window?.title = "Connecting...."
|
||||||
case .running(let service): self.view.window?.title = service.name ?? ""
|
case .running(let service): self.view.window?.title = service.name ?? ""
|
||||||
case .failed(let error): self.view.window?.title = error.localizedDescription
|
case .failed(let error): self.view.window?.title = error.localizedDescription
|
||||||
}
|
}
|
||||||
@@ -135,24 +135,6 @@ private extension ViewController
|
|||||||
try? FileManager.default.removeItem(at: destinationDirectoryURL)
|
try? FileManager.default.removeItem(at: destinationDirectoryURL)
|
||||||
}
|
}
|
||||||
|
|
||||||
let ipaURL = Bundle.main.url(forResource: "App", withExtension: ".ipa")!
|
|
||||||
let application: ALTApplication
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
try FileManager.default.createDirectory(at: destinationDirectoryURL, withIntermediateDirectories: true, attributes: nil)
|
|
||||||
|
|
||||||
let appBundleURL = try FileManager.default.unzipAppBundle(at: ipaURL, toDirectory: destinationDirectoryURL)
|
|
||||||
|
|
||||||
guard let app = ALTApplication(fileURL: appBundleURL) else { throw ALTError(.invalidApp) }
|
|
||||||
application = app
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
finish(error, title: "Failed to Install App")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
self.authenticate() { (result) in
|
self.authenticate() { (result) in
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -172,40 +154,58 @@ private extension ViewController
|
|||||||
{
|
{
|
||||||
let certificate = try result.get()
|
let certificate = try result.get()
|
||||||
|
|
||||||
self.registerAppID(name: "AltStore", identifier: "com.rileytestut.AltStore", team: team) { (result) in
|
self.downloadApp { (result) in
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
let appID = try result.get()
|
let fileURL = try result.get()
|
||||||
|
|
||||||
self.updateFeatures(for: appID, app: application, team: team) { (result) in
|
try FileManager.default.createDirectory(at: destinationDirectoryURL, withIntermediateDirectories: true, attributes: nil)
|
||||||
|
|
||||||
|
let appBundleURL = try FileManager.default.unzipAppBundle(at: fileURL, toDirectory: destinationDirectoryURL)
|
||||||
|
|
||||||
|
guard let application = ALTApplication(fileURL: appBundleURL) else { throw ALTError(.invalidApp) }
|
||||||
|
|
||||||
|
self.registerAppID(name: "AltStore", identifier: "com.rileytestut.AltStore", team: team) { (result) in
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
let appID = try result.get()
|
let appID = try result.get()
|
||||||
|
|
||||||
self.fetchProvisioningProfile(for: appID, team: team) { (result) in
|
self.updateFeatures(for: appID, app: application, team: team) { (result) in
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
let provisioningProfile = try result.get()
|
let appID = try result.get()
|
||||||
|
|
||||||
self.install(application, to: device, team: team, appID: appID, certificate: certificate, profile: provisioningProfile) { (result) in
|
self.fetchProvisioningProfile(for: appID, team: team) { (result) in
|
||||||
finish(result.error, title: "Failed to Install AltStore")
|
do
|
||||||
|
{
|
||||||
|
let provisioningProfile = try result.get()
|
||||||
|
|
||||||
|
self.install(application, to: device, team: team, appID: appID, certificate: certificate, profile: provisioningProfile) { (result) in
|
||||||
|
finish(result.error, title: "Failed to Install AltStore")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
finish(error, title: "Failed to Fetch Provisioning Profile")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
finish(error, title: "Failed to Fetch Provisioning Profile")
|
finish(error, title: "Failed to Update App ID")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
finish(error, title: "Failed to Update App ID")
|
finish(error, title: "Failed to Register App")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
finish(error, title: "Failed to Register App")
|
finish(error, title: "Failed to Download AltStore")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -234,6 +234,25 @@ private extension ViewController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func downloadApp(completionHandler: @escaping (Result<URL, Error>) -> Void)
|
||||||
|
{
|
||||||
|
let appURL = URL(string: "https://www.dropbox.com/s/w1gn9iztlqvltyp/AltStore.ipa?dl=1")!
|
||||||
|
|
||||||
|
let downloadTask = URLSession.shared.downloadTask(with: appURL) { (fileURL, response, error) in
|
||||||
|
do
|
||||||
|
{
|
||||||
|
let (fileURL, _) = try Result((fileURL, response), error).get()
|
||||||
|
completionHandler(.success(fileURL))
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
completionHandler(.failure(error))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
downloadTask.resume()
|
||||||
|
}
|
||||||
|
|
||||||
func authenticate(completionHandler: @escaping (Result<ALTAccount, Error>) -> Void)
|
func authenticate(completionHandler: @escaping (Result<ALTAccount, Error>) -> Void)
|
||||||
{
|
{
|
||||||
ALTAppleAPI.shared.authenticate(appleID: self.emailAddressTextField.stringValue, password: self.passwordTextField.stringValue) { (account, error) in
|
ALTAppleAPI.shared.authenticate(appleID: self.emailAddressTextField.stringValue, password: self.passwordTextField.stringValue) { (account, error) in
|
||||||
|
|||||||
@@ -164,7 +164,6 @@
|
|||||||
BFE6326822A858F300F30809 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326722A858F300F30809 /* Account.swift */; };
|
BFE6326822A858F300F30809 /* Account.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326722A858F300F30809 /* Account.swift */; };
|
||||||
BFE6326A22A85DAF00F30809 /* ReplaceCertificateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326922A85DAF00F30809 /* ReplaceCertificateViewController.swift */; };
|
BFE6326A22A85DAF00F30809 /* ReplaceCertificateViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326922A85DAF00F30809 /* ReplaceCertificateViewController.swift */; };
|
||||||
BFE6326C22A86FF300F30809 /* AuthenticationOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326B22A86FF300F30809 /* AuthenticationOperation.swift */; };
|
BFE6326C22A86FF300F30809 /* AuthenticationOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = BFE6326B22A86FF300F30809 /* AuthenticationOperation.swift */; };
|
||||||
BFFC044E22A204F40066B31F /* App.ipa in Resources */ = {isa = PBXBuildFile; fileRef = BFFC044D22A204F30066B31F /* App.ipa */; };
|
|
||||||
DBAC68F8EC03F4A41D62EDE1 /* Pods_AltStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1039C07E517311FC499A0B64 /* Pods_AltStore.framework */; };
|
DBAC68F8EC03F4A41D62EDE1 /* Pods_AltStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1039C07E517311FC499A0B64 /* Pods_AltStore.framework */; };
|
||||||
/* End PBXBuildFile section */
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
@@ -394,7 +393,6 @@
|
|||||||
BFE6326722A858F300F30809 /* Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = "<group>"; };
|
BFE6326722A858F300F30809 /* Account.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Account.swift; sourceTree = "<group>"; };
|
||||||
BFE6326922A85DAF00F30809 /* ReplaceCertificateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplaceCertificateViewController.swift; sourceTree = "<group>"; };
|
BFE6326922A85DAF00F30809 /* ReplaceCertificateViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ReplaceCertificateViewController.swift; sourceTree = "<group>"; };
|
||||||
BFE6326B22A86FF300F30809 /* AuthenticationOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationOperation.swift; sourceTree = "<group>"; };
|
BFE6326B22A86FF300F30809 /* AuthenticationOperation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationOperation.swift; sourceTree = "<group>"; };
|
||||||
BFFC044D22A204F30066B31F /* App.ipa */ = {isa = PBXFileReference; lastKnownFileType = file; path = App.ipa; sourceTree = "<group>"; };
|
|
||||||
EA79A60285C6AF5848AA16E9 /* Pods-AltStore.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AltStore.debug.xcconfig"; path = "Target Support Files/Pods-AltStore/Pods-AltStore.debug.xcconfig"; sourceTree = "<group>"; };
|
EA79A60285C6AF5848AA16E9 /* Pods-AltStore.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AltStore.debug.xcconfig"; path = "Target Support Files/Pods-AltStore/Pods-AltStore.debug.xcconfig"; sourceTree = "<group>"; };
|
||||||
/* End PBXFileReference section */
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
@@ -619,7 +617,6 @@
|
|||||||
isa = PBXGroup;
|
isa = PBXGroup;
|
||||||
children = (
|
children = (
|
||||||
BF458693229872EA00BD7491 /* Assets.xcassets */,
|
BF458693229872EA00BD7491 /* Assets.xcassets */,
|
||||||
BFFC044D22A204F30066B31F /* App.ipa */,
|
|
||||||
);
|
);
|
||||||
name = Resources;
|
name = Resources;
|
||||||
sourceTree = "<group>";
|
sourceTree = "<group>";
|
||||||
@@ -1034,7 +1031,6 @@
|
|||||||
isa = PBXResourcesBuildPhase;
|
isa = PBXResourcesBuildPhase;
|
||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
BFFC044E22A204F40066B31F /* App.ipa in Resources */,
|
|
||||||
BF458694229872EA00BD7491 /* Assets.xcassets in Resources */,
|
BF458694229872EA00BD7491 /* Assets.xcassets in Resources */,
|
||||||
BF458697229872EA00BD7491 /* Main.storyboard in Resources */,
|
BF458697229872EA00BD7491 /* Main.storyboard in Resources */,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user