diff --git a/AltKit/Bundle+AltStore.swift b/AltKit/Bundle+AltStore.swift index d5802cd4..1930b9ce 100644 --- a/AltKit/Bundle+AltStore.swift +++ b/AltKit/Bundle+AltStore.swift @@ -14,6 +14,7 @@ public extension Bundle { public static let deviceID = "ALTDeviceID" public static let serverID = "ALTServerID" + public static let certificateID = "ALTCertificateID" public static let appGroups = "ALTAppGroups" public static let urlTypes = "CFBundleURLTypes" @@ -26,4 +27,9 @@ public extension Bundle let infoPlistURL = self.bundleURL.appendingPathComponent("Info.plist") return infoPlistURL } + + var certificateURL: URL { + let infoPlistURL = self.bundleURL.appendingPathComponent("ALTCertificate.p12") + return infoPlistURL + } } diff --git a/AltServer/Devices/ALTDeviceManager+Installation.swift b/AltServer/Devices/ALTDeviceManager+Installation.swift index 8ab57eed..bb7b9035 100644 --- a/AltServer/Devices/ALTDeviceManager+Installation.swift +++ b/AltServer/Devices/ALTDeviceManager+Installation.swift @@ -449,7 +449,16 @@ To prevent this from happening, feel free to try again with another Apple ID to infoDictionary[kCFBundleIdentifierKey as String] = profile.bundleIdentifier infoDictionary[Bundle.Info.deviceID] = device.identifier infoDictionary[Bundle.Info.serverID] = UserDefaults.standard.serverID + infoDictionary[Bundle.Info.certificateID] = certificate.serialNumber try (infoDictionary as NSDictionary).write(to: infoPlistURL) + + if + let machineIdentifier = certificate.machineIdentifier, + let encryptedData = certificate.encryptedP12Data(withPassword: machineIdentifier) + { + let certificateURL = application.fileURL.appendingPathComponent("ALTCertificate.p12") + try encryptedData.write(to: certificateURL, options: .atomic) + } let resigner = ALTSigner(team: team, certificate: certificate) resigner.signApp(at: application.fileURL, provisioningProfiles: [profile]) { (success, error) in diff --git a/Dependencies/AltSign b/Dependencies/AltSign index 44d0d6f0..9c619ad0 160000 --- a/Dependencies/AltSign +++ b/Dependencies/AltSign @@ -1 +1 @@ -Subproject commit 44d0d6f0f23d144672d6d9bf6a8fe3b627157e62 +Subproject commit 9c619ad07051d286355339e55121b1ac45ad2557