Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

Commit 200e79a

Browse files
authored
Fix bugs
1 parent 756d6ff commit 200e79a

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

Sources/prostore/certificates/CertificatesManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public final class CertificatesManager: ObservableObject {
5656
return nil
5757
}
5858

59-
return identityAny as? SecIdentity
59+
return identityAny as! SecIdentity
6060
}
6161

6262
// MARK: - SHA256 hex
@@ -72,7 +72,7 @@ public final class CertificatesManager: ObservableObject {
7272
}
7373
var error: Unmanaged<CFError>?
7474
guard let data = SecKeyCopyExternalRepresentation(secKey, &error) as Data? else {
75-
let code = error?.takeRetainedValue().map { CFErrorGetCode($0) as OSStatus } ?? -1
75+
let code = error.map { OSStatus(CFErrorGetCode($0.takeRetainedValue())) } ?? -1
7676
throw CertificateError.publicKeyExportFailed(code)
7777
}
7878
return data
Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,23 @@
1+
// installApp.swift
12
import Foundation
23
import IDeviceSwift
34

5+
/// Installs a signed IPA on the device using InstallationProxy
46
public func installApp(from ipaURL: URL) async throws {
5-
print("Installing app from \(ipaURL.path)...")
7+
print("Installing app from: \(ipaURL.path)")
68

7-
// Heartbeat
9+
// Start heartbeat to keep connection alive during long install
810
HeartbeatManager.shared.start()
911

10-
// Create installer
12+
// Create view model to receive installation status updates
1113
let viewModel = InstallerStatusViewModel()
14+
15+
// Create the installation proxy
16+
// Note: InstallationProxy(viewModel:) initializer is NOT async in current IDeviceSwift versions
1217
let installer = InstallationProxy(viewModel: viewModel)
1318

14-
// Install IPA
19+
// Perform the actual installation
1520
try await installer.install(at: ipaURL)
16-
}
17-
18-
1921

22+
print("Installation completed successfully!")
23+
}

Sources/prostore/signing/DownloadSignManager.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,7 @@ final class DownloadSignManager: ObservableObject, @unchecked Sendable {
112112
self.downloadTask = task
113113
task.resume()
114114

115-
// Clean up observation when task finishes
116-
task.progress.addObserver(NSObject(), forKeyPath: "fractionCompleted", options: [], context: nil)
117-
observation.invalidateOnDeallocate(task.progress)
115+
// Clean up observation when task finishes (invalidate manually in completion if needed)
118116
}
119117

120118
private func getCertificateFiles(for folderName: String) -> (p12URL: URL, provURL: URL, password: String)? {
@@ -158,7 +156,7 @@ final class DownloadSignManager: ObservableObject, @unchecked Sendable {
158156
Task { @MainActor in
159157
guard let self else { return }
160158

161-
switch result => {
159+
switch result {
162160
case .success(let signedIPAURL):
163161
self.progress = 1.0
164162
self.status = "Signed! Installing..."

0 commit comments

Comments
 (0)