Skip to content

Commit 6161b54

Browse files
committed
Merge branch 'develop-lc' into LiveContainerSupport2
2 parents 05e7fa7 + 8f514e9 commit 6161b54

13 files changed

Lines changed: 155 additions & 1267 deletions

File tree

AltStore.xcodeproj/project.pbxproj

Lines changed: 154 additions & 17 deletions
Large diffs are not rendered by default.

AltStore/AltStore-Bridging-Header.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,4 @@
33
//
44

55
#import "NSAttributedString+Markdown.h"
6-
#import "ALTAppPatcher.h"
7-
8-
#include "fragmentzip.h"
96
#include "../LiveContainerSupport/XPCServer.h"

AltStore/Managing Apps/AppManager.swift

Lines changed: 0 additions & 140 deletions
Original file line numberDiff line numberDiff line change
@@ -941,70 +941,6 @@ extension AppManager
941941
self.run([enableJITOperation], context: context, requiresSerialQueue: true)
942942
}
943943

944-
func patch(resignedApp: ALTApplication, presentingViewController: UIViewController, context authContext: AuthenticatedOperationContext, completionHandler: @escaping (Result<InstalledApp, Error>) -> Void) -> PatchAppOperation
945-
{
946-
final class Context: InstallAppOperationContext, PatchAppContext
947-
{
948-
}
949-
950-
guard let originalBundleID = resignedApp.bundle.infoDictionary?[Bundle.Info.altBundleID] as? String else {
951-
let context = Context(bundleIdentifier: resignedApp.bundleIdentifier, authenticatedContext: authContext)
952-
completionHandler(.failure(OperationError.invalidApp))
953-
954-
return PatchAppOperation(context: context)
955-
}
956-
957-
let context = Context(bundleIdentifier: originalBundleID, authenticatedContext: authContext)
958-
context.resignedApp = resignedApp
959-
960-
let patchAppOperation = PatchAppOperation(context: context)
961-
let sendAppOperation = SendAppOperation(context: context)
962-
let installOperation = InstallAppOperation(context: context)
963-
964-
let installationProgress = Progress.discreteProgress(totalUnitCount: 100)
965-
installationProgress.addChild(sendAppOperation.progress, withPendingUnitCount: 40)
966-
installationProgress.addChild(installOperation.progress, withPendingUnitCount: 60)
967-
968-
/* Patch */
969-
patchAppOperation.resultHandler = { [weak patchAppOperation] (result) in
970-
switch result
971-
{
972-
case .failure(let error):
973-
context.error = error
974-
case .success:
975-
// Kinda hacky that we're calling patchAppOperation's progressHandler manually, but YOLO.
976-
patchAppOperation?.progressHandler?(installationProgress, NSLocalizedString("Patching placeholder app...", comment: ""))
977-
}
978-
}
979-
980-
/* Send */
981-
sendAppOperation.resultHandler = { (result) in
982-
switch result
983-
{
984-
case .failure(let error):
985-
context.error = error
986-
completionHandler(.failure(error))
987-
case .success(_): print("App sent over AFC")
988-
}
989-
}
990-
sendAppOperation.addDependency(patchAppOperation)
991-
992-
993-
/* Install */
994-
installOperation.resultHandler = { (result) in
995-
switch result
996-
{
997-
case .failure(let error): completionHandler(.failure(error))
998-
case .success(let installedApp): completionHandler(.success(installedApp))
999-
}
1000-
//UIApplication.shared.open(shortcutURLon, options: [:], completionHandler: nil)
1001-
}
1002-
installOperation.addDependency(sendAppOperation)
1003-
1004-
self.run([patchAppOperation, sendAppOperation, installOperation], context: context.authenticatedContext)
1005-
return patchAppOperation
1006-
}
1007-
1008944
func installationProgress(for app: AppProtocol) -> Progress?
1009945
{
1010946
os_unfair_lock_lock(self.progressLock)
@@ -1392,80 +1328,6 @@ private extension AppManager
13921328
}
13931329
deactivateAppsOperation.addDependency(fetchProvisioningProfilesOperation)
13941330

1395-
/* Patch App */
1396-
let patchAppOperation = RSTAsyncBlockOperation { operation in
1397-
do
1398-
{
1399-
// Only attempt to patch app if we're installing a new app, not refreshing existing app.
1400-
// Post reboot, we install the correct jailbreak app by refreshing the patched app,
1401-
// so this check avoids infinite recursion.
1402-
guard case .install = appOperation else {
1403-
operation.finish()
1404-
return
1405-
}
1406-
1407-
guard let presentingViewController = context.presentingViewController else { return operation.finish() }
1408-
1409-
if let error = context.error
1410-
{
1411-
throw error
1412-
}
1413-
1414-
guard let app = context.app else {
1415-
throw OperationError.invalidParameters("AppManager._install.patchAppOperation: context.app is nil")
1416-
}
1417-
1418-
guard let isUntetherRequired = app.bundle.infoDictionary?[Bundle.Info.untetherRequired] as? Bool,
1419-
let minimumiOSVersionString = app.bundle.infoDictionary?[Bundle.Info.untetherMinimumiOSVersion] as? String,
1420-
let maximumiOSVersionString = app.bundle.infoDictionary?[Bundle.Info.untetherMaximumiOSVersion] as? String,
1421-
case let minimumiOSVersion = OperatingSystemVersion(string: minimumiOSVersionString),
1422-
case let maximumiOSVersion = OperatingSystemVersion(string: maximumiOSVersionString)
1423-
else { return operation.finish() }
1424-
1425-
let iOSVersion = ProcessInfo.processInfo.operatingSystemVersion
1426-
let iOSVersionSupported = ProcessInfo.processInfo.isOperatingSystemAtLeast(minimumiOSVersion) &&
1427-
(!ProcessInfo.processInfo.isOperatingSystemAtLeast(maximumiOSVersion) || maximumiOSVersion == iOSVersion)
1428-
1429-
guard isUntetherRequired, iOSVersionSupported, UIDevice.current.supportsFugu14 else { return operation.finish() }
1430-
1431-
guard let patchAppLink = app.bundle.infoDictionary?[Bundle.Info.untetherURL] as? String,
1432-
let patchAppURL = URL(string: patchAppLink)
1433-
else { throw OperationError.invalidApp }
1434-
1435-
let patchApp = AnyApp(name: app.name, bundleIdentifier: context.bundleIdentifier, url: patchAppURL, storeApp: nil)
1436-
1437-
DispatchQueue.main.async {
1438-
let storyboard = UIStoryboard(name: "PatchApp", bundle: nil)
1439-
let navigationController = storyboard.instantiateInitialViewController() as! UINavigationController
1440-
1441-
let patchViewController = navigationController.topViewController as! PatchViewController
1442-
patchViewController.patchApp = patchApp
1443-
patchViewController.completionHandler = { [weak presentingViewController] (result) in
1444-
switch result
1445-
{
1446-
case .failure(OperationError.cancelled): break // Ignore
1447-
case .failure(let error): group.context.error = error
1448-
case .success: group.context.error = OperationError.cancelled
1449-
}
1450-
1451-
operation.finish()
1452-
1453-
DispatchQueue.main.async {
1454-
presentingViewController?.dismiss(animated: true, completion: nil)
1455-
}
1456-
}
1457-
presentingViewController.present(navigationController, animated: true, completion: nil)
1458-
}
1459-
}
1460-
catch
1461-
{
1462-
group.context.error = error
1463-
operation.finish()
1464-
}
1465-
}
1466-
patchAppOperation.addDependency(deactivateAppsOperation)
1467-
1468-
14691331
let modifyAppExBundleIdOperation = RSTAsyncBlockOperation { operation in
14701332
if !context.useMainProfile {
14711333
operation.finish()
@@ -1497,7 +1359,6 @@ private extension AppManager
14971359
self.exportResginedAppsToDocsDir(resignedApp)
14981360
}
14991361
}
1500-
resignAppOperation.addDependency(patchAppOperation)
15011362
resignAppOperation.addDependency(modifyAppExBundleIdOperation)
15021363
progress.addChild(resignAppOperation.progress, withPendingUnitCount: 20)
15031364

@@ -1548,7 +1409,6 @@ private extension AppManager
15481409
verifyOperation,
15491410
removeAppExtensionsOperation,
15501411
deactivateAppsOperation,
1551-
patchAppOperation,
15521412
refreshAnisetteDataOperation,
15531413
fetchProvisioningProfilesOperation,
15541414
modifyAppExBundleIdOperation,

AltStore/Operations/Patch App/ALTAppPatcher.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

AltStore/Operations/Patch App/ALTAppPatcher.m

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)