Remove buggy retry code finally

This commit is contained in:
nythepegasus
2023-10-17 17:37:29 -04:00
parent 0deae92829
commit c5b8cb4459
4 changed files with 21 additions and 44 deletions

View File

@@ -39,9 +39,6 @@ final class DeactivateAppOperation: ResultOperation<InstalledApp>
let allIdentifiers = [installedApp.resignedBundleIdentifier] + appExtensionProfiles let allIdentifiers = [installedApp.resignedBundleIdentifier] + appExtensionProfiles
for profile in allIdentifiers { for profile in allIdentifiers {
var attempts = 5
while (attempts > 0){
print("Remove Provisioning profile attempts left: \(attempts)")
do { do {
try remove_provisioning_profile(profile) try remove_provisioning_profile(profile)
self.progress.completedUnitCount += 1 self.progress.completedUnitCount += 1
@@ -49,13 +46,9 @@ final class DeactivateAppOperation: ResultOperation<InstalledApp>
self.finish(.success(installedApp)) self.finish(.success(installedApp))
break break
} catch { } catch {
attempts -= 1
if (attempts <= 0){
self.finish(.failure(error)) self.finish(.failure(error))
} }
} }
} }
} }
} }
}
}

View File

@@ -50,7 +50,7 @@ final class EnableJITOperation<Context: EnableJITContext>: ResultOperation<Void>
do { do {
try debug_app(installedApp.resignedBundleIdentifier) try debug_app(installedApp.resignedBundleIdentifier)
self.finish(.success(())) self.finish(.success(()))
break retries = 0
} catch { } catch {
retries -= 1 retries -= 1
if (retries <= 0){ if (retries <= 0){

View File

@@ -41,20 +41,12 @@ final class RefreshAppOperation: ResultOperation<InstalledApp>
guard let app = self.context.app else { return self.finish(.failure(OperationError.appNotFound)) } guard let app = self.context.app else { return self.finish(.failure(OperationError.appNotFound)) }
for p in profiles { for p in profiles {
var attempts = 5
while (attempts > 0){
print("Install provisioning profile attempts left: \(attempts)")
do { do {
let bytes = p.value.data.toRustByteSlice() let bytes = p.value.data.toRustByteSlice()
try install_provisioning_profile(bytes.forRust()) try install_provisioning_profile(bytes.forRust())
break
} catch { } catch {
attempts -= 1
if (attempts <= 0) {
self.finish(.failure(MinimuxerError.ProfileInstall)) self.finish(.failure(MinimuxerError.ProfileInstall))
} }
}
}
DatabaseManager.shared.persistentContainer.performBackgroundTask { (context) in DatabaseManager.shared.persistentContainer.performBackgroundTask { (context) in
print("Sending refresh app request...") print("Sending refresh app request...")

View File

@@ -45,21 +45,13 @@ final class SendAppOperation: ResultOperation<()>
print("AFC App `fileURL`: \(fileURL.absoluteString)") print("AFC App `fileURL`: \(fileURL.absoluteString)")
if let data = NSData(contentsOf: fileURL) { if let data = NSData(contentsOf: fileURL) {
var attempts = 10
while (attempts != 0){
print("Send app attempts left: \(attempts)")
do { do {
let bytes = Data(data).toRustByteSlice() let bytes = Data(data).toRustByteSlice()
try yeet_app_afc(app.bundleIdentifier, bytes.forRust()) try yeet_app_afc(app.bundleIdentifier, bytes.forRust())
self.progress.completedUnitCount += 1 self.progress.completedUnitCount += 1
self.finish(.success(())) self.finish(.success(()))
break
} catch { } catch {
attempts -= 1
if (attempts <= 0) {
self.finish(.failure(MinimuxerError.RwAfc)) self.finish(.failure(MinimuxerError.RwAfc))
}
}
self.progress.completedUnitCount += 1 self.progress.completedUnitCount += 1
self.finish(.success(())) self.finish(.success(()))
} }