mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-16 18:23:53 +01:00
mdc v14
This commit is contained in:
@@ -8,8 +8,8 @@
|
||||
import Foundation
|
||||
import Network
|
||||
|
||||
import AltStoreCore
|
||||
import AltSign
|
||||
import AltStoreCore
|
||||
import Roxas
|
||||
|
||||
@objc(InstallAppOperation)
|
||||
@@ -44,8 +44,8 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
||||
else { return self.finish(.failure(OperationError.invalidParameters)) }
|
||||
|
||||
let backgroundContext = DatabaseManager.shared.persistentContainer.newBackgroundContext()
|
||||
backgroundContext.perform {
|
||||
|
||||
backgroundContext.perform
|
||||
{
|
||||
/* App */
|
||||
let installedApp: InstalledApp
|
||||
|
||||
@@ -141,8 +141,9 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
||||
installedApp.isActive = false
|
||||
}
|
||||
}
|
||||
|
||||
activeProfiles = Set(activeApps.flatMap { (installedApp) -> [String] in
|
||||
|
||||
activeProfiles = Set(activeApps.flatMap
|
||||
{ installedApp -> [String] in
|
||||
let appExtensionProfiles = installedApp.appExtensions.map { $0.resignedBundleIdentifier }
|
||||
return [installedApp.resignedBundleIdentifier] + appExtensionProfiles
|
||||
})
|
||||
@@ -152,11 +153,50 @@ final class InstallAppOperation: ResultOperation<InstalledApp>
|
||||
let ns_bundle_ptr = UnsafeMutablePointer<CChar>(mutating: ns_bundle.utf8String)
|
||||
|
||||
let res = minimuxer_install_ipa(ns_bundle_ptr)
|
||||
if res == 0 {
|
||||
if res == 0
|
||||
{
|
||||
installedApp.refreshedDate = Date()
|
||||
self.finish(.success(installedApp))
|
||||
|
||||
} else {
|
||||
}
|
||||
else if res == -15
|
||||
{
|
||||
// try again
|
||||
if UserDefaults.standard.enableMacDirtyCowExploit && UserDefaults.standard.isMacDirtyCowSupported
|
||||
{
|
||||
patch3AppLimit
|
||||
{ result in
|
||||
switch result
|
||||
{
|
||||
case .success:
|
||||
UserDefaults.standard.set(bootTime(), forKey: "mdcRanBootTime")
|
||||
print("patched sucessfully")
|
||||
case .failure(let err):
|
||||
switch err
|
||||
{
|
||||
case .NoFDA:
|
||||
self.finish(.failure(OperationError.mdcNoFDA))
|
||||
return
|
||||
case .FailedPatchd:
|
||||
self.finish(.failure(OperationError.mdcFailedPatchd))
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let res_try_again = minimuxer_install_ipa(ns_bundle_ptr)
|
||||
if res_try_again == 0
|
||||
{
|
||||
installedApp.refreshedDate = Date()
|
||||
self.finish(.success(installedApp))
|
||||
}
|
||||
else
|
||||
{
|
||||
self.finish(.failure(minimuxer_to_operation(code: res_try_again)))
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self.finish(.failure(minimuxer_to_operation(code: res)))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user