mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-12 16:23:32 +01:00
Compare commits
11 Commits
xcode-26-b
...
spidy/cell
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
625389ab96 | ||
|
|
f7e34cbbe9 | ||
|
|
0fe8d7fed9 | ||
|
|
1a1aa42e02 | ||
|
|
7ff4b48223 | ||
|
|
4801f6e8f2 | ||
|
|
ff28f6fa8f | ||
|
|
2d141afbaf | ||
|
|
06e38aae00 | ||
|
|
d8783230a7 | ||
|
|
6c479bfede |
@@ -993,6 +993,7 @@ extension AppManager
|
|||||||
case .failure(let error): completionHandler(.failure(error))
|
case .failure(let error): completionHandler(.failure(error))
|
||||||
case .success(let installedApp): completionHandler(.success(installedApp))
|
case .success(let installedApp): completionHandler(.success(installedApp))
|
||||||
}
|
}
|
||||||
|
//UIApplication.shared.open(shortcutURLon, options: [:], completionHandler: nil)
|
||||||
}
|
}
|
||||||
installOperation.addDependency(sendAppOperation)
|
installOperation.addDependency(sendAppOperation)
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import AltSign
|
|||||||
import Roxas
|
import Roxas
|
||||||
import minimuxer
|
import minimuxer
|
||||||
|
|
||||||
|
let shortcutURLonDelay = URL(string: "shortcuts://run-shortcut?name=TurnOnDataDelay")!
|
||||||
|
|
||||||
@objc(InstallAppOperation)
|
@objc(InstallAppOperation)
|
||||||
final class InstallAppOperation: ResultOperation<InstalledApp>
|
final class InstallAppOperation: ResultOperation<InstalledApp>
|
||||||
{
|
{
|
||||||
@@ -204,6 +206,10 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
|||||||
let alert = UIAlertController(title: "Finish Refresh", message: "Please reopen SideStore after the process is finished.To finish refreshing, SideStore must be moved to the background. To do this, you can either go to the Home Screen manually or by hitting Continue. Please reopen SideStore after doing this.", preferredStyle: .alert)
|
let alert = UIAlertController(title: "Finish Refresh", message: "Please reopen SideStore after the process is finished.To finish refreshing, SideStore must be moved to the background. To do this, you can either go to the Home Screen manually or by hitting Continue. Please reopen SideStore after doing this.", preferredStyle: .alert)
|
||||||
alert.addAction(UIAlertAction(title: NSLocalizedString("Continue", comment: ""), style: .default, handler: { _ in
|
alert.addAction(UIAlertAction(title: NSLocalizedString("Continue", comment: ""), style: .default, handler: { _ in
|
||||||
print("Going home")
|
print("Going home")
|
||||||
|
// Cell Shortcut
|
||||||
|
UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in
|
||||||
|
print("Cell OFF Shortcut finished execution.")}
|
||||||
|
|
||||||
UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
|
UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
|
||||||
}))
|
}))
|
||||||
|
|
||||||
@@ -220,6 +226,8 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Cell Shortcut
|
||||||
|
UIApplication.shared.open(shortcutURLonDelay, options: [:]) { _ in print("Cell OFF Shortcut finished execution.")}
|
||||||
UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
|
UIApplication.shared.perform(#selector(NSXPCConnection.suspend))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -212,7 +212,6 @@ private extension PatchAppOperation
|
|||||||
#if targetEnvironment(simulator)
|
#if targetEnvironment(simulator)
|
||||||
throw PatchAppError.unsupportedOperatingSystemVersion(ProcessInfo.processInfo.operatingSystemVersion)
|
throw PatchAppError.unsupportedOperatingSystemVersion(ProcessInfo.processInfo.operatingSystemVersion)
|
||||||
#else
|
#else
|
||||||
|
|
||||||
let spotlightPath = "Applications/Spotlight.app/Spotlight"
|
let spotlightPath = "Applications/Spotlight.app/Spotlight"
|
||||||
let spotlightFileURL = self.patchDirectory.appendingPathComponent(spotlightPath)
|
let spotlightFileURL = self.patchDirectory.appendingPathComponent(spotlightPath)
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,10 @@ final class SendAppOperation: ResultOperation<()>
|
|||||||
self.progress.totalUnitCount = 1
|
self.progress.totalUnitCount = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
override func main()
|
override func main() {
|
||||||
{
|
|
||||||
super.main()
|
super.main()
|
||||||
|
|
||||||
if let error = self.context.error
|
if let error = self.context.error {
|
||||||
{
|
|
||||||
return self.finish(.failure(error))
|
return self.finish(.failure(error))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,26 +38,37 @@ final class SendAppOperation: ResultOperation<()>
|
|||||||
return self.finish(.failure(OperationError.invalidParameters("SendAppOperation.main: self.resignedApp is nil")))
|
return self.finish(.failure(OperationError.invalidParameters("SendAppOperation.main: self.resignedApp is nil")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// self.context.resignedApp.fileURL points to the app bundle, but we want the .ipa.
|
let shortcutURLoff = URL(string: "shortcuts://run-shortcut?name=TurnOffData")!
|
||||||
|
|
||||||
let app = AnyApp(name: resignedApp.name, bundleIdentifier: self.context.bundleIdentifier, url: resignedApp.fileURL, storeApp: nil)
|
let app = AnyApp(name: resignedApp.name, bundleIdentifier: self.context.bundleIdentifier, url: resignedApp.fileURL, storeApp: nil)
|
||||||
let fileURL = InstalledApp.refreshedIPAURL(for: app)
|
let fileURL = InstalledApp.refreshedIPAURL(for: app)
|
||||||
|
|
||||||
print("AFC App `fileURL`: \(fileURL.absoluteString)")
|
print("AFC App `fileURL`: \(fileURL.absoluteString)")
|
||||||
|
|
||||||
if let data = NSData(contentsOf: fileURL) {
|
// Wait for Shortcut to Finish Before Proceeding
|
||||||
do {
|
UIApplication.shared.open(shortcutURLoff, options: [:]) { _ in
|
||||||
let bytes = Data(data).toRustByteSlice()
|
print("Shortcut finished execution. Proceeding with file transfer.")
|
||||||
try yeet_app_afc(app.bundleIdentifier, bytes.forRust())
|
|
||||||
self.progress.completedUnitCount += 1
|
DispatchQueue.global().async {
|
||||||
self.finish(.success(()))
|
self.processFile(at: fileURL, for: app.bundleIdentifier)
|
||||||
} catch {
|
|
||||||
self.finish(.failure(MinimuxerError.RwAfc))
|
|
||||||
self.progress.completedUnitCount += 1
|
|
||||||
self.finish(.success(()))
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private func processFile(at fileURL: URL, for bundleIdentifier: String) {
|
||||||
|
guard let data = NSData(contentsOf: fileURL) else {
|
||||||
print("IPA doesn't exist????")
|
print("IPA doesn't exist????")
|
||||||
self.finish(.failure(OperationError(.appNotFound(name: resignedApp.name))))
|
return self.finish(.failure(OperationError(.appNotFound(name: bundleIdentifier))))
|
||||||
|
}
|
||||||
|
|
||||||
|
do {
|
||||||
|
let bytes = Data(data).toRustByteSlice()
|
||||||
|
try yeet_app_afc(bundleIdentifier, bytes.forRust())
|
||||||
|
self.progress.completedUnitCount += 1
|
||||||
|
self.finish(.success(()))
|
||||||
|
} catch {
|
||||||
|
self.finish(.failure(MinimuxerError.RwAfc))
|
||||||
|
self.progress.completedUnitCount += 1
|
||||||
|
self.finish(.success(()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user