From 7162a029bb7eb793b9c76b2e9168d9d00117d615 Mon Sep 17 00:00:00 2001 From: Nythepegasus Date: Sat, 3 Dec 2022 17:25:54 -0500 Subject: [PATCH] Retry AFC 10 times before giving up --- AltStore/Operations/SendAppOperation.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/AltStore/Operations/SendAppOperation.swift b/AltStore/Operations/SendAppOperation.swift index e630ded6..1a46386b 100644 --- a/AltStore/Operations/SendAppOperation.swift +++ b/AltStore/Operations/SendAppOperation.swift @@ -51,7 +51,13 @@ 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 { self.progress.completedUnitCount += 1 self.finish(.success(()))