Implement emotional damage (#95)

* Implement em_proxy

* Update libimobiledevice

* Add minimuxer library to Xcode

* Build missing C files for libimobiledevice

* Remove objective C library

* Add pairing file to Info.plist

* Heartbeat self on startup

* Enable JIT on-device

* Implement on-device installation

* Fix OpenSSL header errors

* Random submodule bullcrap go

* Search release folder for emotional damage

* Clean dependencies

* Build Rust dependencies attempt 1/999

* Update em_proxy

* Implement refreshing apps

* Clean up old operations

* Remove all AltServer code

* Remove files from Xcode project

* Implement auto mounting the developer DMG

* Recover from app being backgrounded

* Fixed keeping pairing file in app after updating SideStore (#3)

* Use compliant error handling for minimuxer

* Fix app failing to install

* Don't kill proxy on backgrounding

* Makes sure the ALTPairingFile gets transferred even if team IDs change (#4)

* Step 1 to allow SideStore to resign itself

* Update ResignAppOperation.swift

* Adding cache for action runner (#5)

* Start caching commit for actions

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Update build.yml

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Update build.yml

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Use rust lib directories to cache

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Cache cargo also

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Fix spacing

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Replace cargo id for caching

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Remove cache if statements

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>

* Add disconnected WireGuard detection

* Add minimuxer logging

Signed-off-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>
Co-authored-by: jawshoeadan <62785552+jawshoeadan@users.noreply.github.com>
Co-authored-by: Joelle Stickney <joellestickney@gmail.com>
Co-authored-by: Spidy123222 <64176728+Spidy123222@users.noreply.github.com>
This commit is contained in:
Jackson Coxson
2022-11-02 17:58:59 -07:00
committed by GitHub
parent fc3f83231c
commit dd66355488
34 changed files with 811 additions and 1175 deletions

View File

@@ -217,23 +217,6 @@ extension AppManager
}
}
@discardableResult
func findServer(context: OperationContext = OperationContext(), completionHandler: @escaping (Result<Server, Error>) -> Void) -> FindServerOperation
{
let findServerOperation = FindServerOperation(context: context)
findServerOperation.resultHandler = { (result) in
switch result
{
case .failure(let error): context.error = error
case .success(let server): context.server = server
}
}
self.run([findServerOperation], context: context)
return findServerOperation
}
@discardableResult
func authenticate(presentingViewController: UIViewController?, context: AuthenticatedOperationContext = AuthenticatedOperationContext(), completionHandler: @escaping (Result<(ALTTeam, ALTCertificate, ALTAppleAPISession), Error>) -> Void) -> AuthenticationOperation
{
@@ -242,8 +225,6 @@ extension AppManager
return operation
}
let findServerOperation = self.findServer(context: context) { _ in }
let authenticationOperation = AuthenticationOperation(context: context, presentingViewController: presentingViewController)
authenticationOperation.resultHandler = { (result) in
switch result
@@ -254,7 +235,6 @@ extension AppManager
completionHandler(result)
}
authenticationOperation.addDependency(findServerOperation)
self.run([authenticationOperation], context: context)
@@ -555,13 +535,10 @@ extension AppManager
// authentication, so we keep it separate.
let context = OperationContext()
let findServerOperation = self.findServer(context: context) { _ in }
let deactivateAppOperation = DeactivateAppOperation(app: installedApp, context: context)
deactivateAppOperation.resultHandler = { (result) in
completionHandler(result)
}
deactivateAppOperation.addDependency(findServerOperation)
self.run([deactivateAppOperation], context: context, requiresSerialQueue: true)
}
@@ -695,13 +672,11 @@ extension AppManager
let context = Context()
context.installedApp = installedApp
let findServerOperation = self.findServer(context: context) { _ in }
let enableJITOperation = EnableJITOperation(context: context)
enableJITOperation.resultHandler = { (result) in
completionHandler(result)
}
enableJITOperation.addDependency(findServerOperation)
self.run([enableJITOperation], context: context, requiresSerialQueue: true)
}
@@ -747,7 +722,7 @@ extension AppManager
switch result
{
case .failure(let error): context.error = error
case .success(let installationConnection): context.installationConnection = installationConnection
case .success(_): print("App sent over AFC")
}
}
sendAppOperation.addDependency(patchAppOperation)
@@ -900,8 +875,7 @@ private extension AppManager
if app.certificateSerialNumber != group.context.certificate?.serialNumber ||
uti != nil ||
app.needsResign ||
(group.context.server?.connectionType == .local && !UserDefaults.standard.localServerSupportsRefreshing)
app.needsResign
{
// Resign app instead of just refreshing profiles because either:
// * Refreshing using different certificate
@@ -1147,7 +1121,7 @@ private extension AppManager
presentingViewController?.dismiss(animated: true, completion: nil)
}
}
presentingViewController.present(navigationController, animated: true, completion: nil)
presentingViewController.present(navigationController, animated: true, completion: nil)
}
}
catch
@@ -1204,7 +1178,7 @@ private extension AppManager
switch result
{
case .failure(let error): context.error = error
case .success(let installationConnection): context.installationConnection = installationConnection
case .success(_): print("App reported as installed")
}
}
sendAppOperation.addDependency(resignAppOperation)
@@ -1649,27 +1623,6 @@ private extension AppManager
func finish(_ operation: AppOperation, result: Result<InstalledApp, Error>, group: RefreshGroup, progress: Progress?)
{
let result = result.mapError { (resultError) -> Error in
guard let error = resultError as? ALTServerError else { return resultError }
switch error.code
{
case .deviceNotFound, .lostConnection:
if let server = group.context.server, server.isPreferred || server.connectionType != .wireless
{
// Preferred server (or not random wireless connection), so report errors normally.
return error
}
else
{
// Not preferred server, so ignore these specific errors and throw serverNotFound instead.
return ConnectionError.serverNotFound
}
default: return error
}
}
// Must remove before saving installedApp.
if let currentProgress = self.progress(for: operation), currentProgress == progress
{
@@ -1709,7 +1662,7 @@ private extension AppManager
}
if #available(iOS 14, *)
{
{
WidgetCenter.shared.getCurrentConfigurations { (result) in
guard case .success(let widgets) = result else { return }