mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
Fix build
This commit is contained in:
parent
0be79b443f
commit
44daeaca45
84
BUCK
84
BUCK
@ -29,14 +29,73 @@ apple_asset_catalog(
|
||||
app_icon = 'AppIconLLC',
|
||||
)
|
||||
|
||||
apple_library(
|
||||
name = 'BuildConfig',
|
||||
srcs = glob([
|
||||
'Telegram-iOS/BuildConfig.m',
|
||||
]),
|
||||
headers = [
|
||||
'Telegram-iOS/BuildConfig.h',
|
||||
],
|
||||
compiler_flags = [
|
||||
'-w',
|
||||
'-DAPP_CONFIG_IS_INTERNAL_BUILD=false',
|
||||
'-DAPP_CONFIG_IS_APPSTORE_BUILD=true',
|
||||
'-DAPP_CONFIG_APPSTORE_ID=686449807',
|
||||
'-DAPP_SPECIFIC_URL_SCHEME=\"tgapp\"',
|
||||
'-DAPP_CONFIG_API_ID=8',
|
||||
'-DAPP_CONFIG_API_HASH=\"7245de8e747a0d6fbe11f7cc14fcc0bb\"',
|
||||
'-DAPP_CONFIG_HOCKEYAPP_ID=\"ad8831329ffc8f8aff9a2b0b86558b24\"',
|
||||
],
|
||||
header_namespace = 'BuildConfig',
|
||||
exported_headers = [
|
||||
'Telegram-iOS/BuildConfig.h',
|
||||
],
|
||||
modular = True,
|
||||
visibility = ['PUBLIC'],
|
||||
deps = [
|
||||
'//submodules/MtProtoKit:MtProtoKit',
|
||||
],
|
||||
)
|
||||
|
||||
apple_library(
|
||||
name = 'AppBinaryPrivate',
|
||||
srcs = glob([
|
||||
'Telegram-iOS/TGBridgeServer.m',
|
||||
'Telegram-iOS/TGAutoDownloadPreferences.m',
|
||||
'Telegram-iOS/TGPresentationAutoNightPreferences.m',
|
||||
'Telegram-iOS/TGProxyItem.m',
|
||||
'Telegram-iOS/UIImage+ImageEffects.m',
|
||||
]),
|
||||
headers = [
|
||||
],
|
||||
header_namespace = 'AppBinaryPrivate',
|
||||
exported_headers = [
|
||||
'Telegram-iOS/TGBridgeServer.h',
|
||||
'Telegram-iOS/TGAutoDownloadPreferences.h',
|
||||
'Telegram-iOS/TGPresentationAutoNightPreferences.h',
|
||||
'Telegram-iOS/TGProxyItem.h',
|
||||
'Telegram-iOS/UIImage+ImageEffects.h',
|
||||
],
|
||||
modular = True,
|
||||
#visibility = ['//submodules/TelegramUI:TelegramUI'],
|
||||
visibility = ['PUBLIC'],
|
||||
deps = [
|
||||
'//submodules/SSignalKit:SSignalKit',
|
||||
'//Watch:WatchUtils',
|
||||
'//submodules/LegacyComponents:LegacyComponents',
|
||||
],
|
||||
)
|
||||
|
||||
apple_binary(
|
||||
name = 'AppBinary',
|
||||
configs = configs_with_config(config_with_updated_linker_flags(APP_CONFIGS, ALL_LOAD_LINKER_FLAG)),
|
||||
swift_version = '4.2',
|
||||
srcs = [
|
||||
'Telegram-iOS/TempRoot.swift',
|
||||
'Telegram-iOS/TempMain.m',
|
||||
srcs = glob([
|
||||
'Telegram-iOS/*.swift',
|
||||
]) + [
|
||||
'Telegram-iOS/main.m',
|
||||
],
|
||||
entitlements_file = 'Telegram-iOS/Telegram-iOS-AppStoreLLC.entitlements',
|
||||
deps = [
|
||||
':LaunchScreenXib',
|
||||
':Images',
|
||||
@ -55,20 +114,31 @@ apple_binary(
|
||||
'//submodules/ffmpeg:FFMpeg',
|
||||
'//submodules/TelegramUI:TelegramUI',
|
||||
'//submodules/TelegramUI:TelegramUIPrivateModule',
|
||||
'//Watch:WatchUtils',
|
||||
':BuildConfig',
|
||||
':AppBinaryPrivate',
|
||||
],
|
||||
)
|
||||
|
||||
xcode_workspace_config(
|
||||
name = "workspace",
|
||||
workspace_name = "Telegram_BUCK",
|
||||
src_target = ":AppBinary",
|
||||
)
|
||||
|
||||
apple_bundle(
|
||||
name = 'AppBundle',
|
||||
extension = 'app',
|
||||
binary = ':AppBinary',
|
||||
product_name = 'Telegram',
|
||||
info_plist = 'Info.plist',
|
||||
info_plist = 'Telegram-iOS/Info.plist',
|
||||
info_plist_substitutions = {
|
||||
'DEVELOPMENT_LANGUAGE': 'en-us',
|
||||
'EXECUTABLE_NAME': 'TelegramApp',
|
||||
'APP_NAME': 'Telegram',
|
||||
'EXECUTABLE_NAME': 'Telegram',
|
||||
'PRODUCT_BUNDLE_IDENTIFIER': 'ph.telegra.Telegraph',
|
||||
'PRODUCT_NAME': 'TelegramApp',
|
||||
'PRODUCT_NAME': 'Telegram',
|
||||
'APP_SPECIFIC_URL_SCHEME': 'tgapp',
|
||||
'VERSION': '5.8',
|
||||
'BUILD_NUMBER': '2001',
|
||||
},
|
||||
|
@ -11,6 +11,10 @@ import PushKit
|
||||
import AsyncDisplayKit
|
||||
import CloudKit
|
||||
|
||||
#if BUCK
|
||||
import BuildConfig
|
||||
#endif
|
||||
|
||||
private let handleVoipNotifications = false
|
||||
|
||||
private var testIsLaunched = false
|
||||
@ -972,14 +976,12 @@ final class SharedApplicationContext {
|
||||
}
|
||||
self.mainWindow.forEachViewController({ controller in
|
||||
if let controller = controller as? TabBarAccountSwitchController {
|
||||
var dismissed = false
|
||||
if let rootController = self.mainWindow.viewController as? TelegramRootController {
|
||||
if let tabsController = rootController.viewControllers.first as? TabBarController {
|
||||
for i in 0 ..< tabsController.controllers.count {
|
||||
if let _ = tabsController.controllers[i] as? (SettingsController & ViewController) {
|
||||
let sourceNodes = tabsController.sourceNodesForController(at: i)
|
||||
if let sourceNodes = sourceNodes {
|
||||
dismissed = true
|
||||
controller.dismiss(sourceNodes: sourceNodes)
|
||||
}
|
||||
return false
|
||||
@ -987,9 +989,6 @@ final class SharedApplicationContext {
|
||||
}
|
||||
}
|
||||
}
|
||||
if dismissed {
|
||||
controller.dismiss()
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
@ -1146,7 +1145,7 @@ final class SharedApplicationContext {
|
||||
BITHockeyManager.shared().configure(withIdentifier: hockeyAppId, delegate: self)
|
||||
BITHockeyManager.shared().crashManager.crashManagerStatus = .alwaysAsk
|
||||
BITHockeyManager.shared().start()
|
||||
BITHockeyManager.shared().authenticator.authenticateInstallation()
|
||||
//BITHockeyManager.shared().authenticator.authenticateInstallation()
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(forName: NSNotification.Name.UIWindowDidBecomeHidden, object: nil, queue: nil, using: { notification in
|
||||
|
@ -7,6 +7,11 @@ import TelegramCore
|
||||
import Display
|
||||
import LegacyComponents
|
||||
|
||||
#if BUCK
|
||||
import BuildConfig
|
||||
import AppBinaryPrivate
|
||||
#endif
|
||||
|
||||
func isAccessLocked(data: PostboxAccessChallengeData, at timestamp: Int32) -> Bool {
|
||||
if data.isLockable, let autolockDeadline = data.autolockDeadline, autolockDeadline <= timestamp {
|
||||
return true
|
||||
@ -342,7 +347,7 @@ final class AuthorizedApplicationContext {
|
||||
|
||||
self.notificationMessagesDisposable.set((context.account.stateManager.notificationMessages
|
||||
|> deliverOn(Queue.mainQueue())).start(next: { [weak self] messageList in
|
||||
if let strongSelf = self, let (messages, groupId, notify) = messageList.last, let firstMessage = messages.first {
|
||||
if let strongSelf = self, let (messages, _, notify) = messageList.last, let firstMessage = messages.first {
|
||||
if UIApplication.shared.applicationState == .active {
|
||||
var chatIsVisible = false
|
||||
if let topController = strongSelf.rootController.topViewController as? ChatController, topController.traceVisibility() {
|
||||
|
@ -10,7 +10,11 @@
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef BUCK
|
||||
#import <MtProtoKit/MtProtoKit.h>
|
||||
#else
|
||||
#import <MtProtoKitDynamic/MtProtoKitDynamic.h>
|
||||
#endif
|
||||
|
||||
static uint32_t funcSwap32(uint32_t input)
|
||||
{
|
||||
|
@ -113,7 +113,7 @@ private func readSecretChatData(reader: BufferReader) -> SecretChatData? {
|
||||
guard let accessHash = reader.readInt64() else {
|
||||
return nil
|
||||
}
|
||||
guard let keyFingerprint = reader.readInt64() else {
|
||||
guard let _ = reader.readInt64() else {
|
||||
return nil
|
||||
}
|
||||
guard let handshakeState = reader.readInt32() else {
|
||||
@ -267,7 +267,7 @@ private func loadLegacyPeerCustomProperyData(database: SqliteInterface, peerId:
|
||||
let keyHash: Int32
|
||||
switch key {
|
||||
case let .string(string):
|
||||
keyHash = murMurHashString32(string)
|
||||
keyHash = HashFunctions.murMurHash32(string)
|
||||
case let .hash(hash):
|
||||
keyHash = hash
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import TelegramCore
|
||||
import SwiftSignalKit
|
||||
import Postbox
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import TelegramCore
|
||||
import SwiftSignalKit
|
||||
import Postbox
|
||||
@ -9,6 +10,10 @@ import MtProtoKitDynamic
|
||||
#endif
|
||||
import TelegramUI
|
||||
|
||||
#if BUCK
|
||||
import AppBinaryPrivate
|
||||
#endif
|
||||
|
||||
import LegacyComponents
|
||||
|
||||
@objc(TGPresentationState) private final class TGPresentationState: NSObject, NSCoding {
|
||||
@ -101,7 +106,6 @@ func importLegacyPreferences(accountManager: AccountManager, account: TemporaryA
|
||||
let vibrationEnabled: Bool? = preferencesProvider["vibrationEnabled"] as? Bool
|
||||
let bannerEnabled: Bool? = preferencesProvider["bannerEnabled"] as? Bool
|
||||
let callsDataUsageMode: Int? = preferencesProvider["callsDataUsageMode"] as? Int
|
||||
let callsDisableP2P: Bool? = preferencesProvider["callsDisableP2P"] as? Bool
|
||||
let callsDisableCallKit: Bool? = preferencesProvider["callsDisableCallKit"] as? Bool
|
||||
let callsUseProxy: Bool? = preferencesProvider["callsUseProxy"] as? Bool
|
||||
let contactsInhibitSync: Bool? = preferencesProvider["contactsInhibitSync"] as? Bool
|
||||
@ -366,7 +370,7 @@ func importLegacyPreferences(accountManager: AccountManager, account: TemporaryA
|
||||
})
|
||||
|
||||
transaction.updateSharedData(ApplicationSpecificSharedDataKeys.instantPagePresentationSettings, { current in
|
||||
var settings: InstantPagePresentationSettings = current as? InstantPagePresentationSettings ?? .defaultSettings
|
||||
let settings: InstantPagePresentationSettings = current as? InstantPagePresentationSettings ?? .defaultSettings
|
||||
if let instantPageFontSize = instantPageFontSize {
|
||||
switch instantPageFontSize {
|
||||
case 0.85:
|
||||
|
@ -1,4 +1,5 @@
|
||||
import Foundation
|
||||
import UIKit
|
||||
import TelegramCore
|
||||
import SwiftSignalKit
|
||||
import Postbox
|
||||
|
@ -315,7 +315,10 @@ final class SharedNotificationManager {
|
||||
isAnnouncement = true
|
||||
}
|
||||
|
||||
if let body = body {
|
||||
if let _ = body {
|
||||
let _ = title
|
||||
let _ = apnsSound
|
||||
|
||||
if isAnnouncement {
|
||||
//presentAnnouncement
|
||||
} else {
|
||||
|
@ -1,11 +1,15 @@
|
||||
#import "TGBridgeServer.h"
|
||||
#import "TGBridgeCommon.h"
|
||||
|
||||
#import <LegacyComponents/LegacyComponents.h>
|
||||
#import <WatchConnectivity/WatchConnectivity.h>
|
||||
#import <libkern/OSAtomic.h>
|
||||
|
||||
#ifdef BUCK
|
||||
#import <WatchUtils/WatchUtils.h>
|
||||
#else
|
||||
#import "TGBridgeCommon.h"
|
||||
#import "TGBridgeContext.h"
|
||||
#endif
|
||||
|
||||
@interface TGBridgeSignalManager : NSObject
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
import Foundation
|
||||
import Postbox
|
||||
import TelegramCore
|
||||
import TelegramUI
|
||||
#if BUCK
|
||||
import WatchUtils
|
||||
#endif
|
||||
|
||||
func makePeerIdFromBridgeIdentifier(_ identifier: Int64) -> PeerId? {
|
||||
if identifier < 0 && identifier > Int32.min {
|
||||
|
@ -4,6 +4,11 @@ import Postbox
|
||||
import TelegramCore
|
||||
import TelegramUI
|
||||
|
||||
#if BUCK
|
||||
import WatchUtils
|
||||
import AppBinaryPrivate
|
||||
#endif
|
||||
|
||||
final class WatchCommunicationManager {
|
||||
private let queue: Queue
|
||||
private let allowBackgroundTimeExtension: (Double) -> Void
|
||||
|
@ -5,6 +5,9 @@ import Display
|
||||
import TelegramCore
|
||||
import TelegramUI
|
||||
import LegacyComponents
|
||||
#if BUCK
|
||||
import WatchUtils
|
||||
#endif
|
||||
|
||||
let allWatchRequestHandlers: [AnyClass] = [
|
||||
WatchChatListHandler.self,
|
||||
@ -695,7 +698,7 @@ final class WatchAudioHandler: WatchRequestHandler {
|
||||
}
|
||||
}
|
||||
//let outputPath = manager.watchTemporaryStorePath + "/\(key).opus"
|
||||
} else if let args = subscription as? TGBridgeAudioSentSubscription {
|
||||
} else if let _ = subscription as? TGBridgeAudioSentSubscription {
|
||||
|
||||
}
|
||||
return SSignal.fail(nil)
|
||||
|
76
Watch/BUCK
Normal file
76
Watch/BUCK
Normal file
@ -0,0 +1,76 @@
|
||||
load('//tools:buck_utils.bzl', 'config_with_updated_linker_flags', 'configs_with_config')
|
||||
load('//tools:buck_defs.bzl', 'combined_config', 'SHARED_CONFIGS', 'LIB_SPECIFIC_CONFIG')
|
||||
|
||||
apple_library(
|
||||
name = 'WatchUtils',
|
||||
srcs = [
|
||||
'Bridge/TGBridgeCommon.m',
|
||||
'Bridge/TGBridgeContactMediaAttachment.m',
|
||||
'Bridge/TGBridgeVideoMediaAttachment.m',
|
||||
'Bridge/TGBridgeSubscriptions.m',
|
||||
'Bridge/TGBridgeLocationVenue.m',
|
||||
'Bridge/TGBridgeImageMediaAttachment.m',
|
||||
'Bridge/TGBridgeBotInfo.m',
|
||||
'Bridge/TGBridgeChatMessages.m',
|
||||
'Bridge/TGBridgeMessage.m',
|
||||
'Bridge/TGBridgeUnsupportedMediaAttachment.m',
|
||||
'Bridge/TGBridgeChat.m',
|
||||
'Bridge/TGBridgeForwardedMessageMediaAttachment.m',
|
||||
'Bridge/TGBridgeMessageEntities.m',
|
||||
'Bridge/TGBridgeLocationMediaAttachment.m',
|
||||
'Bridge/TGBridgeMessageEntitiesAttachment.m',
|
||||
'Bridge/TGBridgeReplyMarkupMediaAttachment.m',
|
||||
'Bridge/TGBridgeWebPageMediaAttachment.m',
|
||||
'Bridge/TGBridgeDocumentMediaAttachment.m',
|
||||
'Bridge/TGBridgeActionMediaAttachment.m',
|
||||
'Bridge/TGBridgeContext.m',
|
||||
'Bridge/TGBridgeMediaAttachment.m',
|
||||
'Bridge/TGBridgeUser.m',
|
||||
'Bridge/TGBridgeBotCommandInfo.m',
|
||||
'Bridge/TGBridgeAudioMediaAttachment.m',
|
||||
'Bridge/TGBridgeReplyMessageMediaAttachment.m',
|
||||
],
|
||||
headers = glob([
|
||||
'Bridge/*.h',
|
||||
'Extension/*.h',
|
||||
]),
|
||||
header_namespace = 'WatchUtils',
|
||||
exported_headers = [
|
||||
'Bridge/TGBridgeCommon.h',
|
||||
'Bridge/TGBridgeContactMediaAttachment.h',
|
||||
'Bridge/TGBridgeVideoMediaAttachment.h',
|
||||
'Bridge/TGBridgeSubscriptions.h',
|
||||
'Bridge/TGBridgeLocationVenue.h',
|
||||
'Bridge/TGBridgeImageMediaAttachment.h',
|
||||
'Bridge/TGBridgeBotInfo.h',
|
||||
'Bridge/TGBridgeChatMessages.h',
|
||||
'Bridge/TGBridgeMessage.h',
|
||||
'Bridge/TGBridgeUnsupportedMediaAttachment.h',
|
||||
'Bridge/TGBridgeChat.h',
|
||||
'Bridge/TGBridgeForwardedMessageMediaAttachment.h',
|
||||
'Bridge/TGBridgeMessageEntities.h',
|
||||
'Bridge/TGBridgeLocationMediaAttachment.h',
|
||||
'Bridge/TGBridgeMessageEntitiesAttachment.h',
|
||||
'Bridge/TGBridgeReplyMarkupMediaAttachment.h',
|
||||
'Bridge/TGBridgeWebPageMediaAttachment.h',
|
||||
'Bridge/TGBridgeDocumentMediaAttachment.h',
|
||||
'Bridge/TGBridgeActionMediaAttachment.h',
|
||||
'Bridge/TGBridgeContext.h',
|
||||
'Bridge/TGBridgeMediaAttachment.h',
|
||||
'Bridge/TGBridgeUser.h',
|
||||
'Bridge/TGBridgeBotCommandInfo.h',
|
||||
'Bridge/TGBridgeAudioMediaAttachment.h',
|
||||
'Bridge/TGBridgeReplyMessageMediaAttachment.h',
|
||||
],
|
||||
modular = True,
|
||||
configs = configs_with_config(combined_config([SHARED_CONFIGS, LIB_SPECIFIC_CONFIG])),
|
||||
compiler_flags = [
|
||||
'-w',
|
||||
],
|
||||
preprocessor_flags = ['-fobjc-arc'],
|
||||
visibility = ['PUBLIC'],
|
||||
frameworks = [
|
||||
'$SDKROOT/System/Library/Frameworks/Foundation.framework',
|
||||
'$SDKROOT/System/Library/Frameworks/UIKit.framework',
|
||||
],
|
||||
)
|
@ -1 +1 @@
|
||||
Subproject commit 4fe76fd53bb0b561fde9aad5e32bd4d0ddca305c
|
||||
Subproject commit 9974280abe4fb74260219a6afe93b63f21cddc0c
|
@ -1 +1 @@
|
||||
Subproject commit 923ee1b409eb1c4dbe836196740fd662c8f3ddb6
|
||||
Subproject commit 0d67e5c006be22a10b49517da534029060a1e47a
|
@ -1 +1 @@
|
||||
Subproject commit ab27f2f195fbf8c3ea9df18c8bc37c7facc1cf1d
|
||||
Subproject commit e8faf440ce71021d0e2985958c069a4f73845544
|
@ -1 +1 @@
|
||||
Subproject commit 36e789c8847a62fd9c369aa0a86376b0d6178893
|
||||
Subproject commit 4bcb4e5d7c718fd53f0bb56eff7625e35f31d56b
|
@ -1 +1 @@
|
||||
Subproject commit a1ddd03c71fd318a3c81820c431a0a5e6563f9d4
|
||||
Subproject commit 351c9968ff2f0781ccda2011aa2e935865c3dc27
|
Loading…
x
Reference in New Issue
Block a user