From 13f306742e60f5ee051216fe87085699d5e9018c Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Wed, 4 Jan 2023 08:48:33 -0500 Subject: [PATCH] Revert "Merge pull request #189 from Nythepegasus/feature/retries" This reverts commit 50841f5e24a5f82bf9588ebbca9d5d83729762d6, reversing changes made to d797ddd668033b592d834e03e0dc362062ee32f9. --- AltStore/LaunchViewController.swift | 8 +----- AltStore/Operations/SendAppOperation.swift | 6 ---- minimuxer/minimuxer.swift | 32 +++------------------- 3 files changed, 5 insertions(+), 41 deletions(-) diff --git a/AltStore/LaunchViewController.swift b/AltStore/LaunchViewController.swift index 8a24eb21..83e8c47e 100644 --- a/AltStore/LaunchViewController.swift +++ b/AltStore/LaunchViewController.swift @@ -147,13 +147,7 @@ class LaunchViewController: RSTLaunchViewController, UIDocumentPickerDelegate func start_minimuxer_threads(_ pairing_file: String) { set_usbmuxd_socket() - var res = start_minimuxer(pairing_file: pairing_file) - var attempts = 10 - while (attempts != 0 && res != 0) { - print("start_minimuxer `res` != 0, retry #\(attempts)") - res = start_minimuxer(pairing_file: pairing_file) - attempts -= 1 - } + let res = start_minimuxer(pairing_file: pairing_file) if res != 0 { displayError("minimuxer failed to start. Incorrect arguments were passed.") } diff --git a/AltStore/Operations/SendAppOperation.swift b/AltStore/Operations/SendAppOperation.swift index ffc43b38..35933b90 100644 --- a/AltStore/Operations/SendAppOperation.swift +++ b/AltStore/Operations/SendAppOperation.swift @@ -52,13 +52,7 @@ class SendAppOperation: ResultOperation<()> for (index, data) in data.enumerated() { pls[index] = data } - var attempts = 10 let res = minimuxer_yeet_app_afc(ns_bundle_ptr, pls, UInt(data.length)) - while (attempts != 0 && res != 0){ - print("minimuxer_yeet_app_afc `res` != 0, retry #\(attempts)") - let res = minimuxer_yeet_app_afc(ns_bundle_ptr, pls, UInt(data.length)) - attempts -= 1 - } if res == 0 { print("minimuxer_yeet_app_afc `res` == \(res)") self.progress.completedUnitCount += 1 diff --git a/minimuxer/minimuxer.swift b/minimuxer/minimuxer.swift index f6172283..d1afe1d8 100644 --- a/minimuxer/minimuxer.swift +++ b/minimuxer/minimuxer.swift @@ -27,13 +27,7 @@ public func set_usbmuxd_socket() { public func debug_app(app_id: String) throws -> Uhoh { let ai = NSString(string: app_id) let ai_pointer = UnsafeMutablePointer(mutating: ai.utf8String) - var res = minimuxer_debug_app(ai_pointer) - var attempts = 10 - while (attempts != 0 && res != 0) { - print("(JIT) ATTEMPTS: \(attempts)") - res = minimuxer_debug_app(ai_pointer) - attempts -= 1 - } + let res = minimuxer_debug_app(ai_pointer) if res != 0 { throw Uhoh.Bad(code: res) } @@ -45,13 +39,7 @@ public func install_provisioning_profile(plist: Data) throws -> Uhoh { print(pls) print(plist) let x = plist.withUnsafeBytes { buf in UnsafeMutableRawPointer(mutating: buf) } - var res = minimuxer_install_provisioning_profile(x, UInt32(plist.count)) - var attempts = 10 - while (attempts != 0 && res != 0) { - print("(INSTALL) ATTEMPTS: \(attempts)") - res = minimuxer_install_provisioning_profile(x, UInt32(plist.count)) - attempts -= 1 - } + let res = minimuxer_install_provisioning_profile(x, UInt32(plist.count)) if res != 0 { throw Uhoh.Bad(code: res) } @@ -61,13 +49,7 @@ public func install_provisioning_profile(plist: Data) throws -> Uhoh { public func remove_provisioning_profile(id: String) throws -> Uhoh { let id_ns = NSString(string: id) let id_pointer = UnsafeMutablePointer(mutating: id_ns.utf8String) - var res = minimuxer_remove_provisioning_profile(id_pointer) - var attempts = 10 - while (attempts != 0 && res != 0) { - print("(REMOVE PROFILE) ATTEMPTS: \(attempts)") - res = minimuxer_remove_provisioning_profile(id_pointer) - attempts -= 1 - } + let res = minimuxer_remove_provisioning_profile(id_pointer) if res != 0 { throw Uhoh.Bad(code: res) } @@ -77,13 +59,7 @@ public func remove_provisioning_profile(id: String) throws -> Uhoh { public func remove_app(app_id: String) throws -> Uhoh { let ai = NSString(string: app_id) let ai_pointer = UnsafeMutablePointer(mutating: ai.utf8String) - var res = minimuxer_remove_app(ai_pointer) - var attempts = 10 - while (attempts != 0 && res != 0) { - print("(REMOVE APP) ATTEMPTS: \(attempts)") - res = minimuxer_remove_app(ai_pointer) - attempts -= 1 - } + let res = minimuxer_remove_app(ai_pointer) if res != 0 { throw Uhoh.Bad(code: res) }