@@ -173,37 +173,33 @@ private func signIPA(ipaURL: URL, p12URL: URL, provURL: URL, password: String, a
173173 }
174174 } ,
175175 completion: { [ weak self] result in
176- Task {
177- DispatchQueue . main. async {
178- switch result {
179- case . success( let signedIPAURL) :
180- self ? . progress = 1.0
181- self ? . status = " ✅ Successfully signed ipa! Installing app now... "
182- self ? . showSuccess = true
183-
184- do {
185- try await installApp ( from: signedIPAURL)
186- } catch {
187- self ? . status = " ❌ Install failed: \( error. localizedDescription) "
188- }
176+ Task { @MainActor in
177+ switch result {
178+ case . success( let signedIPAURL) :
179+ self ? . progress = 1.0
180+ self ? . status = " ✅ Successfully signed ipa! Installing app now... "
181+ self ? . showSuccess = true
189182
190- DispatchQueue . main. asyncAfter ( deadline: . now( ) + 3 ) {
191- self ? . isProcessing = false
192- self ? . showSuccess = false
193- self ? . progress = 0.0
194- self ? . status = " "
195- }
196-
197- // Clean up original downloaded IPA
198- try ? FileManager . default. removeItem ( at: ipaURL)
199-
200- case . failure( let error) :
201- self ? . status = " ❌ Signing failed: \( error. localizedDescription) "
202- self ? . isProcessing = false
203- try ? FileManager . default. removeItem ( at: ipaURL)
204- }
205- }
183+ do {
184+ try await installApp ( from: signedIPAURL)
185+ } catch {
186+ self ? . status = " ❌ Install failed: \( error. localizedDescription) "
187+ }
188+
189+ DispatchQueue . main. asyncAfter ( deadline: . now( ) + 3 ) {
190+ self ? . isProcessing = false
191+ self ? . showSuccess = false
192+ self ? . progress = 0.0
193+ self ? . status = " "
206194 }
195+
196+ try ? FileManager . default. removeItem ( at: ipaURL)
197+ case . failure( let error) :
198+ self ? . status = " ❌ Signing failed: \( error. localizedDescription) "
199+ self ? . isProcessing = false
200+ try ? FileManager . default. removeItem ( at: ipaURL)
201+ }
202+ }
207203 }
208204 )
209205}
0 commit comments