diff --git a/Telegram/BUILD b/Telegram/BUILD index 138394805c..468c3ce4ed 100644 --- a/Telegram/BUILD +++ b/Telegram/BUILD @@ -127,7 +127,7 @@ genrule( ], ) -minimum_os_version = "11.0" +minimum_os_version = "12.0" minimum_watchos_version="9.0" empty_languages = [ diff --git a/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm b/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm index c0b639df84..999b33d21e 100644 --- a/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm +++ b/submodules/AsyncDisplayKit/Source/ASDisplayNode.mm @@ -549,9 +549,12 @@ ASSynthesizeLockingMethodsWithMutex(__instanceLock__); } // CAEAGLLayer +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" if([[view.layer class] isSubclassOfClass:[CAEAGLLayer class]]){ _flags.canClearContentsOfLayer = NO; } +#pragma clang diagnostic pop } return view; diff --git a/submodules/AsyncDisplayKit/Source/ASGraphicsContext.mm b/submodules/AsyncDisplayKit/Source/ASGraphicsContext.mm index ab16cfc47d..f8b1cd74f3 100644 --- a/submodules/AsyncDisplayKit/Source/ASGraphicsContext.mm +++ b/submodules/AsyncDisplayKit/Source/ASGraphicsContext.mm @@ -31,12 +31,6 @@ NS_AVAILABLE_IOS(10) NS_INLINE void ASConfigureExtendedRange(UIGraphicsImageRendererFormat *format) { - if (AS_AVAILABLE_IOS_TVOS(12, 12)) { - // nop. We always use automatic range on iOS >= 12. - } else { - // Currently we never do wide color. One day we could pipe this information through from the ASImageNode if it was worth it. - format.prefersExtendedRange = NO; - } } UIImage *ASGraphicsCreateImageWithOptions(CGSize size, BOOL opaque, CGFloat scale, UIImage *sourceImage, diff --git a/submodules/AuthorizationUI/Sources/AuthorizationSequenceController.swift b/submodules/AuthorizationUI/Sources/AuthorizationSequenceController.swift index a8516a55e7..0921b2fb96 100644 --- a/submodules/AuthorizationUI/Sources/AuthorizationSequenceController.swift +++ b/submodules/AuthorizationUI/Sources/AuthorizationSequenceController.swift @@ -1302,7 +1302,7 @@ public final class AuthorizationSequenceController: NavigationController, MFMail public static func defaultCountryCode() -> Int32 { var countryId: String? = nil let networkInfo = CTTelephonyNetworkInfo() - if let carrier = networkInfo.subscriberCellularProvider { + if let carrier = networkInfo.serviceSubscriberCellularProviders?.values.first { countryId = carrier.isoCountryCode } diff --git a/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift b/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift index 714e973038..19eadbaba7 100644 --- a/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift +++ b/submodules/GalleryUI/Sources/Items/ChatDocumentGalleryItem.swift @@ -279,8 +279,6 @@ class ChatDocumentGalleryItemNode: ZoomableContentGalleryItemNode, WKNavigationD webView.loadFileURL(URL(fileURLWithPath: data.path), allowingReadAccessTo: URL(fileURLWithPath: data.path)) } } - } else if let webView = strongSelf.webView as? UIWebView { - webView.loadRequest(URLRequest(url: URL(fileURLWithPath: data.path))) } } } diff --git a/submodules/InAppPurchaseManager/Sources/InAppPurchaseManager.swift b/submodules/InAppPurchaseManager/Sources/InAppPurchaseManager.swift index 34ebc100d5..2a27d2825b 100644 --- a/submodules/InAppPurchaseManager/Sources/InAppPurchaseManager.swift +++ b/submodules/InAppPurchaseManager/Sources/InAppPurchaseManager.swift @@ -70,10 +70,8 @@ public final class InAppPurchaseManager: NSObject { public var isSubscription: Bool { if #available(iOS 12.0, *) { return self.skProduct.subscriptionGroupIdentifier != nil - } else if #available(iOS 11.2, *) { - return self.skProduct.subscriptionPeriod != nil } else { - return self.id.hasSuffix(".monthly") || self.id.hasSuffix(".annual") || self.id.hasSuffix(".semiannual") + return self.skProduct.subscriptionPeriod != nil } } diff --git a/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift b/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift index f8874c03f0..20c32435fc 100644 --- a/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift +++ b/submodules/LegacyMediaPickerUI/Sources/LegacyMediaPickers.swift @@ -767,9 +767,11 @@ public func legacyAssetPickerEnqueueMessages(context: AccountContext, account: A finalDuration = adjustments.trimEndValue - adjustments.trimStartValue } - let adjustmentsData = MemoryBuffer(data: NSKeyedArchiver.archivedData(withRootObject: adjustments.dictionary()!)) - let digest = MemoryBuffer(data: adjustmentsData.md5Digest()) - resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false) + if let dict = adjustments.dictionary(), let data = try? NSKeyedArchiver.archivedData(withRootObject: dict, requiringSecureCoding: false) { + let adjustmentsData = MemoryBuffer(data: data) + let digest = MemoryBuffer(data: adjustmentsData.md5Digest()) + resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false) + } } let resource: TelegramMediaResource diff --git a/submodules/MtProtoKit/PublicHeaders/MtProtoKit/MTKeychain.h b/submodules/MtProtoKit/PublicHeaders/MtProtoKit/MTKeychain.h index fd640d96f0..8bded10053 100644 --- a/submodules/MtProtoKit/PublicHeaders/MtProtoKit/MTKeychain.h +++ b/submodules/MtProtoKit/PublicHeaders/MtProtoKit/MTKeychain.h @@ -5,7 +5,8 @@ @protocol MTKeychain - (void)setObject:(id)object forKey:(NSString *)aKey group:(NSString *)group; -- (id)objectForKey:(NSString *)aKey group:(NSString *)group; +- (NSDictionary *)dictionaryForKey:(NSString *)aKey group:(NSString *)group; +- (NSNumber *)numberForKey:(NSString *)aKey group:(NSString *)group; - (void)removeObjectForKey:(NSString *)aKey group:(NSString *)group; @end diff --git a/submodules/MtProtoKit/Sources/MTBackupAddressSignals.m b/submodules/MtProtoKit/Sources/MTBackupAddressSignals.m index 5b79068a55..5861cd5a1d 100644 --- a/submodules/MtProtoKit/Sources/MTBackupAddressSignals.m +++ b/submodules/MtProtoKit/Sources/MTBackupAddressSignals.m @@ -42,8 +42,22 @@ _dict[[self itemKeyForGroup:group key:aKey]] = object; } -- (id)objectForKey:(NSString *)aKey group:(NSString *)group { - return _dict[[self itemKeyForGroup:group key:aKey]]; +- (NSDictionary *)dictionaryForKey:(NSString *)aKey group:(NSString *)group { + id result = _dict[[self itemKeyForGroup:group key:aKey]]; + if ([result isKindOfClass:[NSDictionary class]]) { + return result; + } else { + return nil; + } +} + +- (NSNumber *)numberForKey:(NSString *)aKey group:(NSString *)group { + id result = _dict[[self itemKeyForGroup:group key:aKey]]; + if ([result isKindOfClass:[NSNumber class]]) { + return result; + } else { + return nil; + } } - (void)removeObjectForKey:(NSString *)aKey group:(NSString *)group { diff --git a/submodules/MtProtoKit/Sources/MTContext.m b/submodules/MtProtoKit/Sources/MTContext.m index 33e2e7bfaa..7b425dc085 100644 --- a/submodules/MtProtoKit/Sources/MTContext.m +++ b/submodules/MtProtoKit/Sources/MTContext.m @@ -291,18 +291,25 @@ static int32_t fixedTimeDifferenceValue = 0; } } -static void copyKeychainKey(NSString * _Nonnull group, NSString * _Nonnull key, id _Nonnull fromKeychain, id _Nonnull toKeychain) { - id value = [fromKeychain objectForKey:key group:group]; +static void copyKeychainNumberKey(NSString * _Nonnull group, NSString * _Nonnull key, id _Nonnull fromKeychain, id _Nonnull toKeychain) { + id value = [fromKeychain numberForKey:key group:group]; + if (value) { + [toKeychain setObject:value forKey:key group:group]; + } +} + +static void copyKeychainDictionaryKey(NSString * _Nonnull group, NSString * _Nonnull key, id _Nonnull fromKeychain, id _Nonnull toKeychain) { + id value = [fromKeychain dictionaryForKey:key group:group]; if (value) { [toKeychain setObject:value forKey:key group:group]; } } + (void)copyAuthInfoFrom:(id _Nonnull)keychain toTempKeychain:(id _Nonnull)tempKeychain { - copyKeychainKey(@"temp", @"globalTimeDifference", keychain, tempKeychain); - copyKeychainKey(@"persistent", @"datacenterAddressSetById", keychain, tempKeychain); - copyKeychainKey(@"persistent", @"datacenterAuthInfoById", keychain, tempKeychain); - copyKeychainKey(@"ephemeral", @"datacenterPublicKeysById", keychain, tempKeychain); + copyKeychainNumberKey(@"temp", @"globalTimeDifference", keychain, tempKeychain); + copyKeychainDictionaryKey(@"persistent", @"datacenterAddressSetById", keychain, tempKeychain); + copyKeychainDictionaryKey(@"persistent", @"datacenterAuthInfoById", keychain, tempKeychain); + copyKeychainDictionaryKey(@"ephemeral", @"datacenterPublicKeysById", keychain, tempKeychain); //copyKeychainKey(@"persistent", @"authTokenById", keychain, tempKeychain); } @@ -375,11 +382,11 @@ static void copyKeychainKey(NSString * _Nonnull group, NSString * _Nonnull key, if (_keychain != nil) { - NSNumber *nGlobalTimeDifference = [keychain objectForKey:@"globalTimeDifference" group:@"temp"]; + NSNumber *nGlobalTimeDifference = [keychain numberForKey:@"globalTimeDifference" group:@"temp"]; if (nGlobalTimeDifference != nil) _globalTimeDifference = [nGlobalTimeDifference doubleValue]; - NSDictionary *datacenterAddressSetById = [keychain objectForKey:@"datacenterAddressSetById" group:@"persistent"]; + NSDictionary *datacenterAddressSetById = [keychain dictionaryForKey:@"datacenterAddressSetById" group:@"persistent"]; if (datacenterAddressSetById != nil) { _datacenterAddressSetById = [[NSMutableDictionary alloc] initWithDictionary:datacenterAddressSetById]; if (MTLogEnabled()) { @@ -387,7 +394,7 @@ static void copyKeychainKey(NSString * _Nonnull group, NSString * _Nonnull key, } } - NSDictionary *datacenterManuallySelectedSchemeById = [keychain objectForKey:@"datacenterManuallySelectedSchemeById_v1" group:@"persistent"]; + NSDictionary *datacenterManuallySelectedSchemeById = [keychain dictionaryForKey:@"datacenterManuallySelectedSchemeById_v1" group:@"persistent"]; if (datacenterManuallySelectedSchemeById != nil) { _datacenterManuallySelectedSchemeById = [[NSMutableDictionary alloc] initWithDictionary:datacenterManuallySelectedSchemeById]; if (MTLogEnabled()) { @@ -399,7 +406,7 @@ static void copyKeychainKey(NSString * _Nonnull group, NSString * _Nonnull key, _datacenterAddressSetById[nDatacenterId] = [[MTDatacenterAddressSet alloc] initWithAddressList:@[address]]; }]; - NSDictionary *datacenterAuthInfoById = [keychain objectForKey:@"datacenterAuthInfoById" group:@"persistent"]; + NSDictionary *datacenterAuthInfoById = [keychain dictionaryForKey:@"datacenterAuthInfoById" group:@"persistent"]; if (datacenterAuthInfoById != nil) { _datacenterAuthInfoById = [[NSMutableDictionary alloc] initWithDictionary:datacenterAuthInfoById]; @@ -417,12 +424,12 @@ static void copyKeychainKey(NSString * _Nonnull group, NSString * _Nonnull key, } } - NSDictionary *datacenterPublicKeysById = [keychain objectForKey:@"datacenterPublicKeysById" group:@"ephemeral"]; + NSDictionary *datacenterPublicKeysById = [keychain dictionaryForKey:@"datacenterPublicKeysById" group:@"ephemeral"]; if (datacenterPublicKeysById != nil) { _datacenterPublicKeysById = [[NSMutableDictionary alloc] initWithDictionary:datacenterPublicKeysById]; } - NSDictionary *transportSchemeStats = [keychain objectForKey:@"transportSchemeStats_v1" group:@"temp"]; + NSDictionary *transportSchemeStats = [keychain dictionaryForKey:@"transportSchemeStats_v1" group:@"temp"]; if (transportSchemeStats != nil) { [_transportSchemeStats removeAllObjects]; [transportSchemeStats enumerateKeysAndObjectsUsingBlock:^(NSNumber *nDatacenterId, NSDictionary *values, __unused BOOL *stop) { @@ -433,11 +440,11 @@ static void copyKeychainKey(NSString * _Nonnull group, NSString * _Nonnull key, } } - NSDictionary *authTokenById = [keychain objectForKey:@"authTokenById" group:@"persistent"]; + NSDictionary *authTokenById = [keychain dictionaryForKey:@"authTokenById" group:@"persistent"]; if (authTokenById != nil) _authTokenById = [[NSMutableDictionary alloc] initWithDictionary:authTokenById]; - NSDictionary *cleanupSessionIdsByAuthKeyId = [keychain objectForKey:@"cleanupSessionIdsByAuthKeyId" group:@"cleanup"]; + NSDictionary *cleanupSessionIdsByAuthKeyId = [keychain dictionaryForKey:@"cleanupSessionIdsByAuthKeyId" group:@"cleanup"]; if (cleanupSessionIdsByAuthKeyId != nil) _cleanupSessionIdsByAuthKeyId = [[NSMutableDictionary alloc] initWithDictionary:cleanupSessionIdsByAuthKeyId]; diff --git a/submodules/MtProtoKit/Sources/MTEncryption.m b/submodules/MtProtoKit/Sources/MTEncryption.m index 455366e376..97713424f4 100644 --- a/submodules/MtProtoKit/Sources/MTEncryption.m +++ b/submodules/MtProtoKit/Sources/MTEncryption.m @@ -541,7 +541,7 @@ bool MTCheckIsSafePrime(id provider, NSData *numberBytes, id { NSString *primeKey = [[NSString alloc] initWithFormat:@"isPrimeSafe_%@", hexStringFromData(numberBytes)]; - NSNumber *nCachedResult = [keychain objectForKey:primeKey group:@"primes"]; + NSNumber *nCachedResult = [keychain numberForKey:primeKey group:@"primes"]; if (nCachedResult != nil) { return [nCachedResult boolValue]; } @@ -652,7 +652,7 @@ bool MTCheckIsSafeGAOrB(id provider, NSData *gAOrB, NSData * bool MTCheckMod(id provider, NSData *numberBytes, unsigned int g, id keychain) { NSString *modKey = [[NSString alloc] initWithFormat:@"isPrimeModSafe_%@_%d", hexStringFromData(numberBytes), g]; - NSNumber *nCachedResult = [keychain objectForKey:modKey group:@"primes"]; + NSNumber *nCachedResult = [keychain numberForKey:modKey group:@"primes"]; if (nCachedResult != nil) { return [nCachedResult boolValue]; } diff --git a/submodules/PassportUI/Sources/SecureIdPlaintextFormControllerNode.swift b/submodules/PassportUI/Sources/SecureIdPlaintextFormControllerNode.swift index 558a92b562..a13b1d0ca6 100644 --- a/submodules/PassportUI/Sources/SecureIdPlaintextFormControllerNode.swift +++ b/submodules/PassportUI/Sources/SecureIdPlaintextFormControllerNode.swift @@ -383,8 +383,7 @@ extension SecureIdPlaintextFormInnerState { switch type { case .phone: var countryId: String? = nil - let networkInfo = CTTelephonyNetworkInfo() - if let carrier = networkInfo.subscriberCellularProvider { + if let carrier = CTTelephonyNetworkInfo().serviceSubscriberCellularProviders?.values.first { countryId = carrier.isoCountryCode } diff --git a/submodules/RMIntro/PublicHeaders/RMIntro/RMIntroViewController.h b/submodules/RMIntro/PublicHeaders/RMIntro/RMIntroViewController.h index 2ac83f5c81..0ae475af14 100644 --- a/submodules/RMIntro/PublicHeaders/RMIntro/RMIntroViewController.h +++ b/submodules/RMIntro/PublicHeaders/RMIntro/RMIntroViewController.h @@ -7,8 +7,14 @@ // #import + +#define GLES_SILENCE_DEPRECATION + #import +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + @class SSignal; @interface TGAvailableLocalization : NSObject @@ -74,3 +80,5 @@ - (void)stopTimer; @end + +#pragma clang diagnostic pop diff --git a/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m b/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m index 27b6fac397..7fdabab890 100644 --- a/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m +++ b/submodules/RMIntro/Sources/platform/ios/RMIntroViewController.m @@ -601,6 +601,8 @@ typedef enum { [[NSNotificationCenter defaultCenter] removeObserver:_didEnterBackgroundObserver]; [[NSNotificationCenter defaultCenter] removeObserver:_willEnterBackgroundObserver]; + [_localizationsDisposable dispose]; + [self freeGL]; } diff --git a/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift b/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift index be4b957a30..856b8fa1c4 100644 --- a/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift +++ b/submodules/SettingsUI/Sources/ChangePhoneNumberControllerNode.swift @@ -213,7 +213,7 @@ final class ChangePhoneNumberControllerNode: ASDisplayNode { var countryId: String? = nil let networkInfo = CTTelephonyNetworkInfo() - if let carrier = networkInfo.subscriberCellularProvider { + if let carrier = networkInfo.serviceSubscriberCellularProviders?.values.first { countryId = carrier.isoCountryCode } diff --git a/submodules/SettingsUI/Sources/DeleteAccountPhoneItem.swift b/submodules/SettingsUI/Sources/DeleteAccountPhoneItem.swift index a36fbca9a2..caf368cf73 100644 --- a/submodules/SettingsUI/Sources/DeleteAccountPhoneItem.swift +++ b/submodules/SettingsUI/Sources/DeleteAccountPhoneItem.swift @@ -236,7 +236,7 @@ class DeleteAccountPhoneItemNode: ListViewItemNode, ItemListItemNode { var countryId: String? = nil let networkInfo = CTTelephonyNetworkInfo() - if let carrier = networkInfo.subscriberCellularProvider { + if let carrier = networkInfo.serviceSubscriberCellularProviders?.values.first { countryId = carrier.isoCountryCode } diff --git a/submodules/ShareItems/Sources/ShareItems.swift b/submodules/ShareItems/Sources/ShareItems.swift index 890b8800e8..b935a76c84 100644 --- a/submodules/ShareItems/Sources/ShareItems.swift +++ b/submodules/ShareItems/Sources/ShareItems.swift @@ -138,9 +138,11 @@ private func preparedShareItem(postbox: Postbox, network: Network, to peerId: Pe finalDuration = adjustments.trimEndValue - adjustments.trimStartValue } - let adjustmentsData = MemoryBuffer(data: NSKeyedArchiver.archivedData(withRootObject: adjustments.dictionary()!)) - let digest = MemoryBuffer(data: adjustmentsData.md5Digest()) - resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false) + if let dict = adjustments.dictionary(), let data = try? NSKeyedArchiver.archivedData(withRootObject: dict, requiringSecureCoding: false) { + let adjustmentsData = MemoryBuffer(data: data) + let digest = MemoryBuffer(data: adjustmentsData.md5Digest()) + resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false) + } } let estimatedSize = TGMediaVideoConverter.estimatedSize(for: preset, duration: finalDuration, hasAudio: true) diff --git a/submodules/TelegramCore/Sources/Account/Account.swift b/submodules/TelegramCore/Sources/Account/Account.swift index c776913d72..3bd1ba3507 100644 --- a/submodules/TelegramCore/Sources/Account/Account.swift +++ b/submodules/TelegramCore/Sources/Account/Account.swift @@ -224,9 +224,10 @@ public func accountWithId(accountManager: AccountManager Signal Any! { + func dictionary(forKey aKey: String!, group: String!) -> [AnyHashable : Any]? { guard let aKey = aKey, let group = group else { return nil } if let data = self.get(group + ":" + aKey) { - var result: Any? + var result: NSDictionary? MTContext.perform(objCTry: { - result = NSKeyedUnarchiver.unarchiveObject(with: data as Data) + result = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSDictionary.self, from: data as Data) + }) + if let result = result { + return result as? [AnyHashable : Any] + } + } + return nil + } + + func number(forKey aKey: String!, group: String!) -> NSNumber? { + guard let aKey = aKey, let group = group else { + return nil + } + if let data = self.get(group + ":" + aKey) { + var result: NSNumber? + MTContext.perform(objCTry: { + result = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSNumber.self, from: data as Data) }) return result } diff --git a/submodules/TelegramCore/Sources/Network/NetworkType.swift b/submodules/TelegramCore/Sources/Network/NetworkType.swift index ab672ea004..9088496c52 100644 --- a/submodules/TelegramCore/Sources/Network/NetworkType.swift +++ b/submodules/TelegramCore/Sources/Network/NetworkType.swift @@ -82,15 +82,14 @@ private final class NetworkTypeManagerImpl { self.updated = updated #if os(iOS) - let telephonyInfo = CTTelephonyNetworkInfo() - let accessTechnology = telephonyInfo.currentRadioAccessTechnology ?? "" + let accessTechnology = CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology?.values.first ?? "" self.currentCellularType = CellularNetworkType(accessTechnology: accessTechnology) - self.cellularTypeObserver = NotificationCenter.default.addObserver(forName: NSNotification.Name.CTRadioAccessTechnologyDidChange, object: nil, queue: nil, using: { [weak self] notification in + self.cellularTypeObserver = NotificationCenter.default.addObserver(forName: NSNotification.Name.CTServiceRadioAccessTechnologyDidChange, object: nil, queue: nil, using: { [weak self] notification in queue.async { guard let strongSelf = self else { return } - let accessTechnology = telephonyInfo.currentRadioAccessTechnology ?? "" + let accessTechnology = CTTelephonyNetworkInfo().serviceCurrentRadioAccessTechnology?.values.first ?? "" let cellularType = CellularNetworkType(accessTechnology: accessTechnology) if strongSelf.currentCellularType != cellularType { strongSelf.currentCellularType = cellularType @@ -137,7 +136,7 @@ private final class NetworkTypeManagerImpl { self.networkTypeDisposable?.dispose() #if os(iOS) if let observer = self.cellularTypeObserver { - NotificationCenter.default.removeObserver(observer, name: NSNotification.Name.CTRadioAccessTechnologyDidChange, object: nil) + NotificationCenter.default.removeObserver(observer, name: NSNotification.Name.CTServiceRadioAccessTechnologyDidChange, object: nil) } #endif } diff --git a/submodules/TelegramUI/Components/LegacyInstantVideoController/Sources/LegacyInstantVideoController.swift b/submodules/TelegramUI/Components/LegacyInstantVideoController/Sources/LegacyInstantVideoController.swift index bb99271cbf..b53095a379 100644 --- a/submodules/TelegramUI/Components/LegacyInstantVideoController/Sources/LegacyInstantVideoController.swift +++ b/submodules/TelegramUI/Components/LegacyInstantVideoController/Sources/LegacyInstantVideoController.swift @@ -202,9 +202,11 @@ public func legacyInstantVideoController(theme: PresentationTheme, forStory: Boo finalDuration = adjustments.trimEndValue - adjustments.trimStartValue } - let adjustmentsData = MemoryBuffer(data: NSKeyedArchiver.archivedData(withRootObject: adjustments.dictionary()!)) - let digest = MemoryBuffer(data: adjustmentsData.md5Digest()) - resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false) + if let dict = adjustments.dictionary(), let data = try? NSKeyedArchiver.archivedData(withRootObject: dict, requiringSecureCoding: false) { + let adjustmentsData = MemoryBuffer(data: data) + let digest = MemoryBuffer(data: adjustmentsData.md5Digest()) + resourceAdjustments = VideoMediaResourceAdjustments(data: adjustmentsData, digest: digest, isStory: false) + } } if finalDuration.isZero || finalDuration.isNaN { diff --git a/submodules/TelegramUI/Components/Resources/FetchVideoMediaResource/Sources/FetchVideoMediaResource.swift b/submodules/TelegramUI/Components/Resources/FetchVideoMediaResource/Sources/FetchVideoMediaResource.swift index cd32068f41..4702db6484 100644 --- a/submodules/TelegramUI/Components/Resources/FetchVideoMediaResource/Sources/FetchVideoMediaResource.swift +++ b/submodules/TelegramUI/Components/Resources/FetchVideoMediaResource/Sources/FetchVideoMediaResource.swift @@ -334,7 +334,7 @@ public func fetchVideoLibraryMediaResource(postbox: Postbox, resource: VideoLibr if let values = try? JSONDecoder().decode(MediaEditorValues.self, from: adjustmentsValue.data.makeData()) { mediaEditorValues = values } - } else if let dict = NSKeyedUnarchiver.unarchiveObject(with: adjustmentsValue.data.makeData()) as? [AnyHashable : Any], let legacyAdjustments = TGVideoEditAdjustments(dictionary: dict) { + } else if let dict = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSDictionary.self, from: adjustmentsValue.data.makeData()) as? [AnyHashable : Any], let legacyAdjustments = TGVideoEditAdjustments(dictionary: dict) { if alwaysUseModernPipeline { mediaEditorValues = MediaEditorValues(legacyAdjustments: legacyAdjustments, defaultPreset: qualityPreset) } else { @@ -500,7 +500,7 @@ public func fetchLocalFileVideoMediaResource(postbox: Postbox, resource: LocalFi if let values = try? JSONDecoder().decode(MediaEditorValues.self, from: videoAdjustments.data.makeData()) { mediaEditorValues = values } - } else if let dict = NSKeyedUnarchiver.unarchiveObject(with: videoAdjustments.data.makeData()) as? [AnyHashable : Any], let legacyAdjustments = TGVideoEditAdjustments(dictionary: dict) { + } else if let dict = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSDictionary.self, from: videoAdjustments.data.makeData()) as? [AnyHashable : Any], let legacyAdjustments = TGVideoEditAdjustments(dictionary: dict) { if alwaysUseModernPipeline && !isImage { mediaEditorValues = MediaEditorValues(legacyAdjustments: legacyAdjustments, defaultPreset: qualityPreset) } else { @@ -710,7 +710,7 @@ public func fetchVideoLibraryMediaResourceHash(resource: VideoLibraryMediaResour adjustments = nil case let .compress(adjustmentsValue): if let adjustmentsValue = adjustmentsValue { - if let dict = NSKeyedUnarchiver.unarchiveObject(with: adjustmentsValue.data.makeData()) as? [AnyHashable : Any], let legacyAdjustments = TGVideoEditAdjustments(dictionary: dict) { + if let dict = try? NSKeyedUnarchiver.unarchivedObject(ofClass: NSDictionary.self, from: adjustmentsValue.data.makeData()) as? [AnyHashable : Any], let legacyAdjustments = TGVideoEditAdjustments(dictionary: dict) { adjustments = legacyAdjustments } } diff --git a/submodules/WatchBridge/Sources/WatchCommunicationManager.swift b/submodules/WatchBridge/Sources/WatchCommunicationManager.swift index 4672c1a99b..1c69d158e5 100644 --- a/submodules/WatchBridge/Sources/WatchCommunicationManager.swift +++ b/submodules/WatchBridge/Sources/WatchCommunicationManager.swift @@ -134,8 +134,8 @@ public final class WatchCommunicationManager { if fileManager.fileExists(atPath: presetsFileUrl.path) { try? fileManager.removeItem(atPath: presetsFileUrl.path) } - let data = NSKeyedArchiver.archivedData(withRootObject: suggestions) - try? data.write(to: presetsFileUrl) + let data = try? NSKeyedArchiver.archivedData(withRootObject: suggestions, requiringSecureCoding: false) + try? data?.write(to: presetsFileUrl) let _ = strongSelf.sendFile(url: presetsFileUrl, metadata: [TGBridgeIncomingFileIdentifierKey: "presets"]).start() })) diff --git a/third-party/libjxl/build-libjxl-bazel.sh b/third-party/libjxl/build-libjxl-bazel.sh index 42188d8120..17d46032b9 100755 --- a/third-party/libjxl/build-libjxl-bazel.sh +++ b/third-party/libjxl/build-libjxl-bazel.sh @@ -14,7 +14,7 @@ CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DJPEGXL_ENABLE_BE if [ "$ARCH" = "arm64" ]; then IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform" IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk) - export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=11.0 -funwind-tables" + export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=12.0 -funwind-tables" cd "$BUILD_DIR" mkdir build @@ -30,7 +30,7 @@ if [ "$ARCH" = "arm64" ]; then elif [ "$ARCH" = "sim_arm64" ]; then IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform" IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk) - export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios11.0-simulator -miphonesimulator-version-min=11.0 -funwind-tables" + export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios12.0-simulator -miphonesimulator-version-min=12.0 -funwind-tables" cd "$BUILD_DIR" mkdir build @@ -46,7 +46,7 @@ elif [ "$ARCH" = "sim_arm64" ]; then elif [ "$ARCH" = "x86_64" ]; then IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform" IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk) - export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=11.0 -funwind-tables" + export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=12.0 -funwind-tables" cd "$BUILD_DIR" mkdir build diff --git a/third-party/webp/build-webp-bazel.sh b/third-party/webp/build-webp-bazel.sh index 530c791945..2964d42873 100755 --- a/third-party/webp/build-webp-bazel.sh +++ b/third-party/webp/build-webp-bazel.sh @@ -14,7 +14,7 @@ COMMON_ARGS="-DWEBP_LINK_STATIC=1 -DWEBP_BUILD_CWEBP=0 -DWEBP_BUILD_DWEBP=0 -DWE if [ "$ARCH" = "arm64" ]; then IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneOS.platform" IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneOS*.sdk) - export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=11.0 -funwind-tables" + export CFLAGS="-Wall -arch arm64 -miphoneos-version-min=12.0 -funwind-tables" cd "$BUILD_DIR" mkdir build @@ -30,7 +30,7 @@ if [ "$ARCH" = "arm64" ]; then elif [ "$ARCH" = "sim_arm64" ]; then IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform" IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk) - export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios11.0-simulator -miphonesimulator-version-min=11.0 -funwind-tables" + export CFLAGS="-Wall -arch arm64 --target=arm64-apple-ios12.0-simulator -miphonesimulator-version-min=12.0 -funwind-tables" cd "$BUILD_DIR" mkdir build @@ -46,7 +46,7 @@ elif [ "$ARCH" = "sim_arm64" ]; then elif [ "$ARCH" = "x86_64" ]; then IOS_PLATFORMDIR="$(xcode-select -p)/Platforms/iPhoneSimulator.platform" IOS_SYSROOT=($IOS_PLATFORMDIR/Developer/SDKs/iPhoneSimulator*.sdk) - export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=11.0 -funwind-tables" + export CFLAGS="-Wall -arch x86_64 -miphoneos-version-min=12.0 -funwind-tables" cd "$BUILD_DIR" mkdir build diff --git a/versions.json b/versions.json index 02ba8961ad..5538efdf73 100644 --- a/versions.json +++ b/versions.json @@ -1,5 +1,5 @@ { "app": "10.2", "bazel": "6.3.2", - "xcode": "14.3.1" + "xcode": "14.5" }