Skip to content

Commit 05b5aa0

Browse files
Add AppAttestManager to use AppAttest to acquire the Backup entitlement for TestFlight builds
1 parent 4f4c79f commit 05b5aa0

File tree

3 files changed

+481
-8
lines changed

3 files changed

+481
-8
lines changed

Signal/src/ViewControllers/AppSettings/Internal/InternalSettingsViewController.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ class InternalSettingsViewController: OWSTableViewController2 {
155155
!BackupAttachmentDownloadEligibility.disableTransitTierDownloadsOverride
156156
}
157157
))
158+
backupsSection.add(.actionItem(withText: "Acquire Backup entitlement sans StoreKit") { [weak self] in
159+
Task {
160+
let backupTestFlightEntitlementManager = DependenciesBridge.shared.backupTestFlightEntitlementManager
161+
162+
do {
163+
try await backupTestFlightEntitlementManager.acquireEntitlement()
164+
self?.presentToast(text: "Successfully acquired Backup entitlement!")
165+
} catch {
166+
self?.presentToast(text: "Failed to acquired Backup entitlement! \(error)")
167+
}
168+
}
169+
})
158170

159171
if backupsSection.items.isEmpty.negated {
160172
contents.add(backupsSection)

SignalServiceKit/Network/API/Requests/TSRequest.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,16 @@ public struct TSRequest: CustomDebugStringConvertible {
3131
}
3232

3333
public init(url: URL, method: String = "GET", parameters: [String: Any]? = [:]) {
34+
self.init(url: url, method: method, body: .parameters(parameters ?? [:]))
35+
}
36+
37+
public init(url: URL, method: String, body: Body) {
3438
owsAssertDebug(method.isEmpty.negated)
3539

3640
self.url = url
3741
self.method = method
3842
self.headers = HttpHeaders()
39-
self.body = .parameters(parameters ?? [:])
43+
self.body = body
4044
}
4145

4246
// MARK: - Authorization

0 commit comments

Comments
 (0)