Merge commit '61ac2e9c212f06a1dba9f386d85b13f218fc4216'

This commit is contained in:
Isaac 2025-09-25 13:38:04 +08:00
commit c99a642669
10 changed files with 109 additions and 18 deletions

View File

@ -23,6 +23,7 @@ internal:
- export PATH=`gem environment gemdir`/bin:$PATH
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="build-system/appcenter-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=adhoc --configuration=release_arm64
- python3 -u build-system/Make/DeployToFirebase.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/firebase-configurations/firebase-internal.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
- python3 -u build-system/Make/DeployBuild.py --configuration="$TELEGRAM_PRIVATE_DATA_PATH/deploy-configurations/internal-configuration.json" --ipa="build/artifacts/Telegram.ipa" --dsyms="build/artifacts/Telegram.DSYMs.zip"
- rm -rf build-input/configuration-repository-workdir
- rm -rf build-input/configuration-repository
- python3 -u build-system/Make/Make.py remote-build --darwinContainers="$DARWIN_CONTAINERS" --darwinContainersHost="$DARWIN_CONTAINERS_HOST" --cacheHost="$TELEGRAM_BAZEL_CACHE_HOST" --configurationPath="$TELEGRAM_PRIVATE_DATA_PATH/build-configurations/enterprise-configuration.json" --gitCodesigningRepository="$TELEGRAM_GIT_CODESIGNING_REPOSITORY" --gitCodesigningType=enterprise --configuration=release_arm64

View File

@ -18,10 +18,10 @@ def sha256_file(path):
h.update(data)
return h.hexdigest()
def init_build(host, token, files):
def init_build(host, token, files, channel):
url = host.rstrip('/') + '/upload/init'
headers = {"Authorization": "Bearer " + token}
payload = {"files": files}
payload = {"files": files, "channel": channel}
r = requests.post(url, json=payload, headers=headers, timeout=30)
r.raise_for_status()
return r.json()
@ -77,7 +77,8 @@ if __name__ == '__main__':
host = config.get('host')
token = config.get('auth_token')
if not host or not token:
channel = config.get('channel')
if not host or not token or not channel:
print('Invalid configuration')
sys.exit(1)
ipa_path = args.ipa
@ -100,7 +101,7 @@ if __name__ == '__main__':
}
print('Init build')
init = init_build(host, token, files)
init = init_build(host, token, files, channel)
build_id = init.get('build_id')
urls = init.get('upload_urls', {})
if not build_id:

View File

@ -12,6 +12,9 @@ public extension Camera {
case iPhone15Plus
case iPhone15Pro
case iPhone15ProMax
case iPhone17
case iPhone17Pro
case iPhoneAir
case unknown
public init(model: DeviceModel) {
@ -38,6 +41,12 @@ public extension Camera {
self = .iPhone15Pro
case .iPhone16ProMax:
self = .iPhone15ProMax
case .iPhone17:
self = .iPhone17
case .iPhone17Pro, .iPhone17ProMax:
self = .iPhone17Pro
case .iPhoneAir:
self = .iPhoneAir
case .unknown:
self = .unknown
default:
@ -49,12 +58,16 @@ public extension Camera {
switch self {
case .singleCamera:
return [1.0]
case .iPhone14, .iPhone14Plus, .iPhone15, .iPhone15Plus:
case .iPhone14, .iPhone14Plus, .iPhone15, .iPhone15Plus, .iPhone17:
return [0.5, 1.0, 2.0]
case .iPhone14Pro, .iPhone14ProMax, .iPhone15Pro:
return [0.5, 1.0, 2.0, 3.0]
case .iPhone15ProMax:
return [0.5, 1.0, 2.0, 5.0]
case .iPhone17Pro:
return [0.5, 1.0, 2.0, 8.0]
case .iPhoneAir:
return [1.0, 2.0]
case .unknown:
return [1.0, 2.0]
}

View File

@ -108,6 +108,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
case experimentalCallMute(Bool)
case playerV2(Bool)
case devRequests(Bool)
case enableUpdates(Bool)
case fakeAds(Bool)
case enableLocalTranslation(Bool)
case preferredVideoCodec(Int, String, String?, Bool)
@ -134,7 +135,7 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return DebugControllerSection.web.rawValue
case .keepChatNavigationStack, .skipReadHistory, .alwaysDisplayTyping, .debugRatingLayout, .crashOnSlowQueries, .crashOnMemoryPressure:
return DebugControllerSection.experiments.rawValue
case .clearTips, .resetNotifications, .crash, .fillLocalSavedMessageCache, .resetDatabase, .resetDatabaseAndCache, .resetHoles, .resetTagHoles, .reindexUnread, .resetCacheIndex, .reindexCache, .resetBiometricsData, .optimizeDatabase, .photoPreview, .knockoutWallpaper, .compressedEmojiCache, .storiesJpegExperiment, .checkSerializedData, .enableQuickReactionSwitch, .experimentalCompatibility, .enableDebugDataDisplay, .rippleEffect, .browserExperiment, .allForumsHaveTabs, .enableReactionOverrides, .restorePurchases, .disableReloginTokens, .liveStreamV2, .experimentalCallMute, .playerV2, .devRequests, .fakeAds, .enableLocalTranslation:
case .clearTips, .resetNotifications, .crash, .fillLocalSavedMessageCache, .resetDatabase, .resetDatabaseAndCache, .resetHoles, .resetTagHoles, .reindexUnread, .resetCacheIndex, .reindexCache, .resetBiometricsData, .optimizeDatabase, .photoPreview, .knockoutWallpaper, .compressedEmojiCache, .storiesJpegExperiment, .checkSerializedData, .enableQuickReactionSwitch, .experimentalCompatibility, .enableDebugDataDisplay, .rippleEffect, .browserExperiment, .allForumsHaveTabs, .enableReactionOverrides, .restorePurchases, .disableReloginTokens, .liveStreamV2, .experimentalCallMute, .playerV2, .devRequests, .enableUpdates, .fakeAds, .enableLocalTranslation:
return DebugControllerSection.experiments.rawValue
case .logTranslationRecognition, .resetTranslationStates:
return DebugControllerSection.translation.rawValue
@ -261,8 +262,10 @@ private enum DebugControllerEntry: ItemListNodeEntry {
return 56
case .enableLocalTranslation:
return 57
case .enableUpdates:
return 58
case let .preferredVideoCodec(index, _, _, _):
return 58 + index
return 59 + index
case .disableVideoAspectScaling:
return 100
case .enableNetworkFramework:
@ -1379,6 +1382,16 @@ private enum DebugControllerEntry: ItemListNodeEntry {
})
}).start()
})
case let .enableUpdates(value):
return ItemListSwitchItem(presentationData: presentationData, title: "Enable Updates", value: value, sectionId: self.section, style: .blocks, updated: { value in
let _ = arguments.sharedContext.accountManager.transaction ({ transaction in
transaction.updateSharedData(ApplicationSpecificSharedDataKeys.experimentalUISettings, { settings in
var settings = settings?.get(ExperimentalUISettings.self) ?? ExperimentalUISettings.defaultSettings
settings.enableUpdates = value
return PreferencesEntry(settings)
})
}).start()
})
case let .fakeAds(value):
return ItemListSwitchItem(presentationData: presentationData, title: "Fake Ads", value: value, sectionId: self.section, style: .blocks, updated: { value in
let _ = arguments.sharedContext.accountManager.transaction ({ transaction in
@ -1561,6 +1574,7 @@ private func debugControllerEntries(sharedContext: SharedAccountContext, present
entries.append(.devRequests(experimentalSettings.devRequests))
entries.append(.fakeAds(experimentalSettings.fakeAds))
entries.append(.enableLocalTranslation(experimentalSettings.enableLocalTranslation))
entries.append(.enableUpdates(experimentalSettings.enableUpdates))
}
if isMainApp {

View File

@ -38,6 +38,7 @@ public enum DeviceMetrics: CaseIterable, Equatable {
case iPhone14ProMaxZoomed
case iPhone16Pro
case iPhone16ProMax
case iPhoneAir
case iPad
case iPadMini
case iPad102Inch
@ -72,6 +73,7 @@ public enum DeviceMetrics: CaseIterable, Equatable {
.iPhone14ProMaxZoomed,
.iPhone16Pro,
.iPhone16ProMax,
.iPhoneAir,
.iPad,
.iPadMini,
.iPad102Inch,
@ -179,6 +181,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return CGSize(width: 402.0, height: 874.0)
case .iPhone16ProMax:
return CGSize(width: 440.0, height: 956.0)
case .iPhoneAir:
return CGSize(width: 420.0, height: 912.0)
case .iPad:
return CGSize(width: 768.0, height: 1024.0)
case .iPadMini:
@ -214,6 +218,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return 55.0
case .iPhone16Pro, .iPhone16ProMax:
return 55.0
case .iPhoneAir:
return 55.0
case let .unknown(_, _, _, screenCornerRadius):
return screenCornerRadius
default:
@ -229,6 +235,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return inLandscape ? UIEdgeInsets(top: 0.0, left: 47.0, bottom: 0.0, right: 47.0) : UIEdgeInsets(top: 44.0, left: 0.0, bottom: 0.0, right: 0.0)
case .iPhone14Pro, .iPhone14ProMax, .iPhone16Pro, .iPhone16ProMax:
return inLandscape ? UIEdgeInsets(top: 0.0, left: 59.0, bottom: 0.0, right: 59.0) : UIEdgeInsets(top: 44.0, left: 0.0, bottom: 0.0, right: 0.0)
case .iPhoneAir:
return inLandscape ? UIEdgeInsets(top: 0.0, left: 68.0, bottom: 0.0, right: 68.0) : UIEdgeInsets(top: 68.0, left: 0.0, bottom: 0.0, right: 0.0)
default:
return UIEdgeInsets.zero
}
@ -236,7 +244,7 @@ public enum DeviceMetrics: CaseIterable, Equatable {
public func onScreenNavigationHeight(inLandscape: Bool, systemOnScreenNavigationHeight: CGFloat?) -> CGFloat? {
switch self {
case .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProMax, .iPhone16Pro, .iPhone16ProMax:
case .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProMax, .iPhone16Pro, .iPhone16ProMax, .iPhoneAir:
if #available(iOS 26.0, *) {
return 20.0
} else {
@ -282,6 +290,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return 47.0
case .iPhone16Pro, .iPhone16ProMax:
return 54.0
case .iPhoneAir:
return 54.0
case .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax:
return 44.0
case .iPadPro11Inch, .iPadPro3rdGen, .iPadMini, .iPadMini6thGen:
@ -292,8 +302,18 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return 20.0
}
}
public func keyboardHeight(inLandscape: Bool) -> CGFloat {
var keyboardHeight = _keyboardHeight(inLandscape: inLandscape)
if #available(iOS 26.0, *) {
if !inLandscape {
keyboardHeight += 9.0
}
}
return keyboardHeight
}
private func _keyboardHeight(inLandscape: Bool) -> CGFloat {
if inLandscape {
switch self {
case .iPhone4, .iPhone5:
@ -302,6 +322,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return 163.0
case .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax:
return 172.0
case .iPhoneAir:
return 172.0
case .iPad, .iPad102Inch, .iPadPro10Inch:
return 348.0
case .iPadPro11Inch, .iPadMini, .iPadMini6thGen:
@ -321,6 +343,8 @@ public enum DeviceMetrics: CaseIterable, Equatable {
return 226.0
case .iPhoneX, .iPhone12Mini, .iPhone12, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMaxZoomed, .iPhone16Pro:
return 292.0
case .iPhoneAir:
return 292.0
case .iPhoneXSMax, .iPhoneXr, .iPhone12ProMax, .iPhone13ProMax, .iPhone14ProMax, .iPhone16ProMax:
return 302.0
case .iPad, .iPad102Inch, .iPadPro10Inch:
@ -340,7 +364,7 @@ public enum DeviceMetrics: CaseIterable, Equatable {
func predictiveInputHeight(inLandscape: Bool) -> CGFloat {
if inLandscape {
switch self {
case .iPhone4, .iPhone5, .iPhone6, .iPhone6Plus, .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax:
case .iPhone4, .iPhone5, .iPhone6, .iPhone6Plus, .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax, .iPhoneAir:
return 37.0
case .iPad, .iPad102Inch, .iPadPro10Inch, .iPadPro11Inch, .iPadPro, .iPadPro3rdGen, .iPadMini, .iPadMini6thGen:
return 50.0
@ -351,7 +375,7 @@ public enum DeviceMetrics: CaseIterable, Equatable {
switch self {
case .iPhone4, .iPhone5:
return 37.0
case .iPhone6, .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax:
case .iPhone6, .iPhoneX, .iPhoneXSMax, .iPhoneXr, .iPhone12Mini, .iPhone12, .iPhone12ProMax, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone13ProMax, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax, .iPhoneAir:
return 44.0
case .iPhone6Plus:
return 45.0
@ -378,7 +402,7 @@ public enum DeviceMetrics: CaseIterable, Equatable {
public var hasDynamicIsland: Bool {
switch self {
case .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax:
case .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMax, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhone16ProMax, .iPhoneAir:
return true
default:
return false

View File

@ -544,7 +544,15 @@ NSString *suffix = @"";
return @"iPhone 16 Pro Max";
if ([platform isEqualToString:@"iPhone17,5"])
return @"iPhone 16e";
if ([platform isEqualToString:@"iPhone18,3"])
return @"iPhone 17";
if ([platform isEqualToString:@"iPhone18,1"])
return @"iPhone 17 Pro";
if ([platform isEqualToString:@"iPhone18,2"])
return @"iPhone 17 Pro Max";
if ([platform isEqualToString:@"iPhone18,4"])
return @"iPhone Air";
if ([platform hasPrefix:@"iPod1"])
return @"iPod touch 1G";
if ([platform hasPrefix:@"iPod2"])

View File

@ -67,7 +67,7 @@ struct PasscodeKeyboardLayout {
self.topOffset = 226.0
self.biometricsOffset = 30.0
self.deleteOffset = 20.0
case .iPhoneX, .iPhone12Mini, .iPhone12, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMaxZoomed, .iPhone16Pro:
case .iPhoneX, .iPhone12Mini, .iPhone12, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhoneAir:
self.buttonSize = 75.0
self.horizontalSecond = 103.0
self.horizontalThird = 206.0
@ -151,7 +151,7 @@ public struct PasscodeLayout {
self.titleOffset = 112.0
self.subtitleOffset = -6.0
self.inputFieldOffset = 156.0
case .iPhoneX, .iPhone12Mini, .iPhone12, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMaxZoomed, .iPhone16Pro:
case .iPhoneX, .iPhone12Mini, .iPhone12, .iPhone13Mini, .iPhone13, .iPhone13Pro, .iPhone14Pro, .iPhone14ProZoomed, .iPhone14ProMaxZoomed, .iPhone16Pro, .iPhoneAir:
self.titleOffset = 162.0
self.subtitleOffset = 0.0
self.inputFieldOffset = 206.0

View File

@ -2923,7 +2923,7 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
private func maybeCheckForUpdates() {
#if targetEnvironment(simulator)
#else
guard let buildConfig = self.buildConfig, buildConfig.isInternalBuild else {
guard let buildConfig = self.buildConfig else {
return
}
let timestamp = CFAbsoluteTimeGetCurrent()
@ -2939,6 +2939,9 @@ private func extractAccountManagerState(records: AccountRecordsView<TelegramAcco
}
}
|> deliverOnMainQueue).start(next: { sharedContext, urlString in
guard buildConfig.isInternalBuild || sharedContext.sharedContext.immediateExperimentalUISettings.enableUpdates else {
return
}
guard let url = urlString.flatMap({ URL(string: $0) }) else {
return
}

View File

@ -69,6 +69,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
public var checkSerializedData: Bool
public var allForumsHaveTabs: Bool
public var debugRatingLayout: Bool
public var enableUpdates: Bool
public static var defaultSettings: ExperimentalUISettings {
return ExperimentalUISettings(
@ -115,7 +116,8 @@ public struct ExperimentalUISettings: Codable, Equatable {
conferenceDebug: false,
checkSerializedData: false,
allForumsHaveTabs: false,
debugRatingLayout: false
debugRatingLayout: false,
enableUpdates: false
)
}
@ -163,7 +165,8 @@ public struct ExperimentalUISettings: Codable, Equatable {
conferenceDebug: Bool,
checkSerializedData: Bool,
allForumsHaveTabs: Bool,
debugRatingLayout: Bool
debugRatingLayout: Bool,
enableUpdates: Bool
) {
self.keepChatNavigationStack = keepChatNavigationStack
self.skipReadHistory = skipReadHistory
@ -209,6 +212,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.checkSerializedData = checkSerializedData
self.allForumsHaveTabs = allForumsHaveTabs
self.debugRatingLayout = debugRatingLayout
self.enableUpdates = enableUpdates
}
public init(from decoder: Decoder) throws {
@ -258,6 +262,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
self.checkSerializedData = try container.decodeIfPresent(Bool.self, forKey: "checkSerializedData") ?? false
self.allForumsHaveTabs = try container.decodeIfPresent(Bool.self, forKey: "allForumsHaveTabs") ?? false
self.debugRatingLayout = try container.decodeIfPresent(Bool.self, forKey: "debugRatingLayout") ?? false
self.enableUpdates = try container.decodeIfPresent(Bool.self, forKey: "enableUpdates") ?? false
}
public func encode(to encoder: Encoder) throws {
@ -307,6 +312,7 @@ public struct ExperimentalUISettings: Codable, Equatable {
try container.encodeIfPresent(self.checkSerializedData, forKey: "checkSerializedData")
try container.encodeIfPresent(self.allForumsHaveTabs, forKey: "allForumsHaveTabs")
try container.encodeIfPresent(self.debugRatingLayout, forKey: "debugRatingLayout")
try container.encodeIfPresent(self.enableUpdates, forKey: "enableUpdates")
}
}

View File

@ -126,6 +126,11 @@ public enum DeviceModel: CaseIterable, Equatable {
case iPhone16ProMax
case iPhone16e
case iPhone17
case iPhone17Pro
case iPhone17ProMax
case iPhoneAir
case unknown(String)
public var modelId: [String] {
@ -238,6 +243,14 @@ public enum DeviceModel: CaseIterable, Equatable {
return ["iPhone17,2"]
case .iPhone16e:
return ["iPhone17,5"]
case .iPhone17:
return ["iPhone18,3"]
case .iPhone17Pro:
return ["iPhone18,1"]
case .iPhone17ProMax:
return ["iPhone18,2"]
case .iPhoneAir:
return ["iPhone18,4"]
case let .unknown(modelId):
return [modelId]
}
@ -353,6 +366,14 @@ public enum DeviceModel: CaseIterable, Equatable {
return "iPhone 16 Pro Max"
case .iPhone16e:
return "iPhone 16e"
case .iPhone17:
return "iPhone 17"
case .iPhone17Pro:
return "iPhone 17 Pro"
case .iPhone17ProMax:
return "iPhone 17 Pro Max"
case .iPhoneAir:
return "iPhone Air"
case let .unknown(modelId):
if modelId.hasPrefix("iPhone") {
return "Unknown iPhone"