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

Commit 0801a38

Browse files
authored
Update DownloadSignManager.swift
1 parent 8dce453 commit 0801a38

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

Sources/prostore/signing/DownloadSignManager.swift

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,28 @@ class DownloadSignManager: ObservableObject {
152152
return nil
153153
}
154154
}
155+
156+
private func getCertificateFiles(for folderName: String) -> (p12URL: URL, provURL: URL, password: String)? {
157+
let fm = FileManager.default
158+
let certsDir = CertificateFileManager.shared.certificatesDirectory.appendingPathComponent(folderName)
159+
160+
let p12URL = certsDir.appendingPathComponent("certificate.p12")
161+
let provURL = certsDir.appendingPathComponent("profile.mobileprovision")
162+
let passwordURL = certsDir.appendingPathComponent("password.txt")
163+
164+
guard fm.fileExists(atPath: p12URL.path),
165+
fm.fileExists(atPath: provURL.path),
166+
fm.fileExists(atPath: passwordURL.path) else {
167+
return nil
168+
}
169+
170+
do {
171+
let password = try String(contentsOf: passwordURL, encoding: .utf8).trimmingCharacters(in: .whitespacesAndNewlines)
172+
return (p12URL, provURL, password)
173+
} catch {
174+
return nil
175+
}
176+
}
155177

156178
private func signIPA(ipaURL: URL, p12URL: URL, provURL: URL, password: String, appName: String) {
157179
DispatchQueue.main.async {
@@ -226,4 +248,5 @@ private func signIPA(ipaURL: URL, p12URL: URL, provURL: URL, password: String, a
226248
}
227249
return appFolder
228250
}
229-
}
251+
252+
}

0 commit comments

Comments
 (0)