This commit is contained in:
Peter 2019-08-31 02:09:09 +04:00
parent f1d1754aa5
commit 9a055b4832
38 changed files with 5603 additions and 4228 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,360 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleAllowMixedLocalizations</key>
<true/>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>${APP_NAME}</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIcons</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>Black</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlackIcon</string>
<string>BlackNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlackClassic</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlackClassicIcon</string>
<string>BlackClassicNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlackFilled</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlackFilledIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>Blue</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlueIcon</string>
<string>BlueNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlueClassic</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlueClassicIcon</string>
<string>BlueClassicNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlueFilled</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlueFilledIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>WhiteFilled</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>WhiteFilledIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconName</key>
<string>AppIconLLC</string>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundleIcons~ipad</key>
<dict>
<key>CFBundleAlternateIcons</key>
<dict>
<key>Black</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlackIconIpad</string>
<string>BlackIconLargeIpad</string>
<string>BlackNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlackClassic</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlackClassicIconIpad</string>
<string>BlackClassicIconLargeIpad</string>
<string>BlackClassicNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlackFilled</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlackFilledIconIpad</string>
<string>BlackFilledIconLargeIpad</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>Blue</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlueIconIpad</string>
<string>BlueIconLargeIpad</string>
<string>BlueNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlueClassic</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlueClassicIconIpad</string>
<string>BlueClassicIconLargeIpad</string>
<string>BlueClassicNotificationIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>BlueFilled</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>BlueFilledIconIpad</string>
<string>BlueFilledIconLargeIpad</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
<key>WhiteFilled</key>
<dict>
<key>CFBundleIconFiles</key>
<array>
<string>WhiteFilledIcon</string>
</array>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundlePrimaryIcon</key>
<dict>
<key>CFBundleIconName</key>
<string>AppIconLLC</string>
<key>UIPrerenderedIcon</key>
<true/>
</dict>
</dict>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleURLSchemes</key>
<array>
<string>telegram</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER).compatibility</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tg</string>
<string>$(APP_SPECIFIC_URL_SCHEME)</string>
</array>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
<key>CFBundleURLName</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER).dropbox</string>
<key>CFBundleURLSchemes</key>
<array>
<string>db-pa9wtoz9l514anx</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>
<array>
<string>instagram</string>
<string>comgooglemaps-x-callback</string>
<string>foursquare</string>
<string>here-location</string>
<string>yandexmaps</string>
<string>yandexnavi</string>
<string>comgooglemaps</string>
<string>youtube</string>
<string>twitter</string>
<string>vk</string>
<string>waze</string>
<string>googlechrome</string>
<string>googlechromes</string>
<string>firefox</string>
<string>touch-http</string>
<string>touch-https</string>
<string>yandexbrowser-open-url</string>
<string>vimeo</string>
<string>vine</string>
<string>coub</string>
<string>uber</string>
<string>citymapper</string>
<string>lyft</string>
<string>opera-http</string>
<string>opera-https</string>
<string>firefox-focus</string>
<string>ddgQuickLink</string>
<string>moovit</string>
</array>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>We need this so that you can take and share photos and videos.</string>
<key>NSContactsUsageDescription</key>
<string>Telegram stores your contacts heavily encrypted in the cloud to let you connect with your friends across all your devices.</string>
<key>NSFaceIDUsageDescription</key>
<string>You can use Face ID to unlock the app.</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>When you send your location to your friends, Telegram needs access to show them a map. You also need this to send locations from an Apple Watch.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>When you send your location to your friends, Telegram needs access to show them a map.</string>
<key>NSMicrophoneUsageDescription</key>
<string>We need this so that you can record and share voice messages and videos with sound.</string>
<key>NSMotionUsageDescription</key>
<string>When you send your location to your friends, Telegram needs access to show them a map.</string>
<key>NSPhotoLibraryAddUsageDescription</key>
<string>We need this so that you can share photos and videos from your photo library.</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>We need this so that you can share photos and videos from your photo library.</string>
<key>NSSiriUsageDescription</key>
<string>You can use Siri to send messages.</string>
<key>NSUserActivityTypes</key>
<array>
<string>INSendMessageIntent</string>
<string>RemindAboutChatIntent</string>
</array>
<key>UIAppFonts</key>
<array>
<string>SFCompactRounded-Semibold.otf</string>
</array>
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>fetch</string>
<string>location</string>
<string>remote-notification</string>
<string>voip</string>
</array>
<key>UIFileSharingEnabled</key>
<false/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresPersistentWiFi</key>
<true/>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleDefault</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>UIViewEdgeAntialiasing</key>
<false/>
<key>UIViewGroupOpacity</key>
<false/>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeDescription</key>
<string>Telegram iOS Color Theme File</string>
<key>UTTypeIconFiles</key>
<array>
<string>BlueIcon@3x.png</string>
</array>
<key>UTTypeIdentifier</key>
<string>org.telegram.Telegram-iOS.theme</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
<array>
<string>tgios-theme</string>
</array>
</dict>
</dict>
</array>
</dict>
</plist>

View File

@ -1,52 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>App</string>
<key>CFBundleIconFiles</key>
<array>
<string>Icon.png</string>
<string>Icon@2x.png</string>
<string>Icon-72.png</string>
<string>Icon-72@2x.png</string>
<string>Icon-Small-50.png</string>
<string>Icon-Small-50@2x.png</string>
</array>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>

File diff suppressed because it is too large Load Diff

View File

@ -1,22 +1,6 @@
load("//Config:configs.bzl", "app_binary_configs", "library_configs", "pretty", "info_plist_substitutions", "app_info_plist_substitutions", "DEVELOPMENT_LANGUAGE")
load("//Config:configs.bzl", "app_binary_configs", "share_extension_configs", "library_configs", "pretty", "info_plist_substitutions", "app_info_plist_substitutions", "share_extension_info_plist_substitutions", "DEVELOPMENT_LANGUAGE")
load("//Config:buck_rule_macros.bzl", "apple_lib", "framework_binary_dependencies", "framework_bundle_dependencies")
'''apple_asset_catalog(
name = "ExampleAppAssets",
visibility = ["//App:"],
app_icon = "AppIcon",
dirs = ["Assets.xcassets"],
)
app_tests = [
":UnitTests",
":UnitTestsWithHostApp",
]
ui_tests = [
":XCUITests",
]'''
static_library_dependencies = [
]
@ -45,6 +29,55 @@ resource_dependencies = [
build_phase_scripts = [
]
apple_resource(
name = "AppResources",
files = glob([
"Telegram-iOS/Resources/**/*",
], exclude = ["Telegram-iOS/Resources/**/.*"]),
visibility = ["PUBLIC"],
)
apple_resource(
name = "AppStringResources",
files = [],
variants = glob([
"Telegram-iOS/*.lproj/Localizable.strings",
]),
visibility = ["PUBLIC"],
)
apple_asset_catalog(
name = 'Icons',
dirs = [
"Telegram-iOS/Icons.xcassets",
],
visibility = ["PUBLIC"],
)
apple_asset_catalog(
name = 'AppIcons',
dirs = [
"Telegram-iOS/AppIcons.xcassets",
],
visibility = ["PUBLIC"],
)
apple_resource(
name = "AdditionalIcons",
files = glob([
"Telegram-iOS/*.png",
]),
visibility = ["PUBLIC"],
)
apple_resource(
name = 'LaunchScreen',
files = [
'Telegram-iOS/Base.lproj/LaunchScreen.xib',
],
visibility = ["PUBLIC"],
)
apple_library(
name = "AppLibrary",
visibility = [
@ -97,12 +130,42 @@ apple_bundle(
info_plist = "Info.plist",
info_plist_substitutions = app_info_plist_substitutions("Telegram"),
deps = [
":ShareExtension",
]
+ framework_bundle_dependencies(framework_dependencies),
)
apple_binary(
name = "ShareBinary",
srcs = glob([
"Share/**/*.swift",
]),
configs = share_extension_configs("Share"),
linker_flags = [
"-e",
"_NSExtensionMain",
"-Xlinker",
"-rpath",
"-Xlinker",
"@executable_path/../../Frameworks",
],
deps = [
"//submodules/TelegramUI:TelegramUI#shared",
],
)
apple_bundle(
name = "ShareExtension",
binary = ":ShareBinary",
extension = "appex",
info_plist = "Share/Info.plist",
info_plist_substitutions = share_extension_info_plist_substitutions("Share"),
deps = [
],
xcode_product_type = "com.apple.product-type.app-extension",
)
apple_package(
name = "AppPackage",
bundle = ":Telegram",
)

File diff suppressed because one or more lines are too long

124
BUCK
View File

@ -1,9 +1,39 @@
load("//Config:configs.bzl", "app_binary_configs", "share_extension_configs", "library_configs", "pretty", "info_plist_substitutions", "app_info_plist_substitutions", "share_extension_info_plist_substitutions", "DEVELOPMENT_LANGUAGE")
load("//Config:buck_rule_macros.bzl", "apple_lib", "framework_binary_dependencies", "framework_bundle_dependencies")
static_library_dependencies = [
]
framework_dependencies = [
"//submodules/MtProtoKit:MtProtoKit",
"//submodules/SSignalKit/SwiftSignalKit:SwiftSignalKit",
"//submodules/Postbox:Postbox",
"//submodules/TelegramCore:TelegramCore",
"//submodules/AsyncDisplayKit:AsyncDisplayKit",
"//submodules/Display:Display",
"//submodules/TelegramUI:TelegramUI",
]
resource_dependencies = [
"//submodules/LegacyComponents:LegacyComponentsResources",
"//submodules/TelegramUI:TelegramUIAssets",
"//submodules/TelegramUI:TelegramUIResources",
"//:AppResources",
"//:AppStringResources",
"//:Icons",
"//:AppIcons",
"//:AdditionalIcons",
"//:LaunchScreen",
]
build_phase_scripts = [
]
apple_resource(
name = "AppResources",
files = glob([
"Telegram-iOS/Resources/**/*",
], exclude = ["Telegram-iOS/Resources/**/.*"]),
], exclude = ["Telegram-iOS/Resources/**/.*"]),
visibility = ["PUBLIC"],
)
@ -47,3 +77,95 @@ apple_resource(
],
visibility = ["PUBLIC"],
)
apple_library(
name = "AppLibrary",
visibility = [
"//:",
"//...",
],
configs = library_configs(),
swift_version = native.read_config("swift", "version"),
srcs = [
"Telegram-iOS/main.m",
"Telegram-iOS/Application.swift"
],
deps = [
]
+ static_library_dependencies
+ framework_binary_dependencies(framework_dependencies),
)
apple_binary(
name = "AppBinary",
visibility = [
"//:",
"//...",
],
configs = app_binary_configs("Telegram"),
swift_version = native.read_config("swift", "version"),
srcs = [
"SupportFiles/Empty.swift",
],
deps = [
":AppLibrary",
]
+ resource_dependencies,
)
xcode_workspace_config(
name = "workspace",
workspace_name = "Telegram_Buck",
src_target = ":Telegram",
)
apple_bundle(
name = "Telegram",
visibility = [
"//:",
],
extension = "app",
binary = ":AppBinary",
product_name = "Telegram",
info_plist = "Telegram-iOS/Info.plist",
info_plist_substitutions = app_info_plist_substitutions("Telegram"),
deps = [
":ShareExtension",
]
+ framework_bundle_dependencies(framework_dependencies),
)
apple_binary(
name = "ShareBinary",
srcs = glob([
"Share/**/*.swift",
]),
configs = share_extension_configs("Share"),
linker_flags = [
"-e",
"_NSExtensionMain",
"-Xlinker",
"-rpath",
"-Xlinker",
"@executable_path/../../Frameworks",
],
deps = [
"//submodules/TelegramUI:TelegramUI#shared",
],
)
apple_bundle(
name = "ShareExtension",
binary = ":ShareBinary",
extension = "appex",
info_plist = "Share/Info.plist",
info_plist_substitutions = share_extension_info_plist_substitutions("Share"),
deps = [
],
xcode_product_type = "com.apple.product-type.app-extension",
)
apple_package(
name = "AppPackage",
bundle = ":Telegram",
)

View File

@ -92,10 +92,31 @@ def app_binary_configs(name):
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
"PRODUCT_BUNDLE_IDENTIFIER": "org.telegram.Telegram-iOS",
"CODE_SIGN_IDENTITY": "iPhone Developer: Peter Iakovlev (9J4EJ3F97G)",
"CODE_SIGN_ENTITLEMENTS": "Telegram-iOS.entitlements",
"CODE_SIGN_ENTITLEMENTS": "Telegram-iOS/Telegram-iOS-Hockeyapp.entitlements",
"DEVELOPMENT_TEAM": "X834Q8SBVP",
"PROVISIONING_PROFILE_SPECIFIER": "match Development org.telegram.Telegram-iOS",
"ASSETCATALOG_COMPILER_APPICON_NAME": "AppIcon",
"BUILD_NUMBER": appConfig()["buildNumber"],
"APP_NAME": "Telegram",
"PRODUCT_NAME": "Telegram",
}
binary_config = merge_dict(SHARED_CONFIGS, binary_specific_config)
binary_config = merge_dict(binary_config, optimization_config())
binary_config = config_with_updated_linker_flags(binary_config, ALL_LOAD_LINKER_FLAG)
return configs_with_config(binary_config)
def share_extension_configs(name):
binary_specific_config = {
"ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES": "NO",
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
"PRODUCT_BUNDLE_IDENTIFIER": "org.telegram.Telegram-iOS." + name,
"CODE_SIGN_IDENTITY": "iPhone Developer: Peter Iakovlev (9J4EJ3F97G)",
"CODE_SIGN_ENTITLEMENTS": "Share/Share-HockeyApp.entitlements",
"DEVELOPMENT_TEAM": "X834Q8SBVP",
"PROVISIONING_PROFILE_SPECIFIER": "match Development org.telegram.Telegram-iOS.Share",
"BUILD_NUMBER": appConfig()["buildNumber"],
"APP_NAME": "Telegram",
"PRODUCT_NAME": "ShareExtension",
}
binary_config = merge_dict(SHARED_CONFIGS, binary_specific_config)
binary_config = merge_dict(binary_config, optimization_config())
@ -125,3 +146,16 @@ def app_info_plist_substitutions(name):
"BUILD_NUMBER": appConfig()["buildNumber"],
}
return substitutions
def share_extension_info_plist_substitutions(name):
substitutions = {
"DEVELOPMENT_LANGUAGE": DEVELOPMENT_LANGUAGE,
"EXECUTABLE_NAME": name,
"PRODUCT_BUNDLE_IDENTIFIER": "org.telegram.Telegram-iOS.Share",
"PRODUCT_NAME": name,
"CURRENT_PROJECT_VERSION": "1",
"CODE_SIGN_IDENTITY": "iPhone Developer: Peter Iakovlev (9J4EJ3F97G)",
"APP_SPECIFIC_URL_SCHEME": appConfig()["appSpecificUrlScheme"],
"BUILD_NUMBER": appConfig()["buildNumber"],
}
return substitutions

View File

@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>application-identifier</key>
<string>X834Q8SBVP.org.telegram.Telegram-iOS</string>
<key>aps-environment</key>
<string>production</string>
<key>com.apple.developer.associated-domains</key>
<string>*</string>
<key>com.apple.developer.icloud-container-development-container-identifiers</key>
<array>
<string>iCloud.org.telegram.Telegram-iOS</string>
</array>
<key>com.apple.developer.icloud-container-environment</key>
<array>
<string>Development</string>
<string>Production</string>
</array>
<key>com.apple.developer.icloud-container-identifiers</key>
<array>
<string>iCloud.org.telegram.Telegram-iOS</string>
</array>
<key>com.apple.developer.icloud-services</key>
<string>*</string>
<key>com.apple.developer.siri</key>
<true/>
<key>com.apple.developer.team-identifier</key>
<string>X834Q8SBVP</string>
<key>com.apple.developer.ubiquity-container-identifiers</key>
<array>
<string>iCloud.org.telegram.Telegram-iOS</string>
</array>
<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>X834Q8SBVP.*</string>
<key>com.apple.security.application-groups</key>
<array>
<string>group.org.telegram.Telegram-iOS</string>
</array>
<key>get-task-allow</key>
<false/>
<key>keychain-access-groups</key>
<array>
<string>X834Q8SBVP.*</string>
</array>
</dict>
</plist>

View File

@ -7,15 +7,18 @@ check_env:
sh check_env.sh
build: check_env
$(BUCK) build //App:AppPackage#iphoneos-arm64,iphoneos-armv7 ${BUCK_OPTIONS}
$(BUCK) build //:AppPackage#iphoneos-arm64,iphoneos-armv7 ${BUCK_OPTIONS}
sh package_app.sh $(BUCK) "${BUCK_OPTIONS}" iphoneos-arm64,iphoneos-armv7
build_arm64: check_env
$(BUCK) build //App:AppPackage#iphoneos-arm64 ${BUCK_OPTIONS}
$(BUCK) build //:AppPackage#iphoneos-arm64 ${BUCK_OPTIONS}
sh package_app.sh $(BUCK) "${BUCK_OPTIONS}" iphoneos-arm64
build_buckdebug: check_env
BUCK_DEBUG_MODE=1 $(BUCK) build //:AppPackage#iphoneos-arm64 ${BUCK_OPTIONS}
build_verbose: check_env
$(BUCK) build //App:AppPackage#iphoneos-armv7,iphoneos-arm64 --verbose 8 ${BUCK_OPTIONS}
$(BUCK) build //:AppPackage#iphoneos-armv7,iphoneos-arm64 --verbose 8 ${BUCK_OPTIONS}
targets:
$(BUCK) targets //...
@ -28,5 +31,9 @@ clean: kill_xcode
sh clean.sh
project: check_env kill_xcode
$(BUCK) project //App:workspace --config custom.mode=project ${BUCK_OPTIONS}
open App/Telegram_Buck.xcworkspace
$(BUCK) project //:workspace --config custom.mode=project ${BUCK_OPTIONS}
open Telegram_Buck.xcworkspace
project_buckdebug: check_env kill_xcode
BUCK_DEBUG_MODE=1 $(BUCK) project //:workspace --config custom.mode=project ${BUCK_OPTIONS}
open Telegram_Buck.xcworkspace

View File

@ -19,7 +19,7 @@
<key>CFBundleShortVersionString</key>
<string>5.11</string>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<string>99999</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>

1
SupportFiles/Empty.swift Normal file
View File

@ -0,0 +1 @@

View File

@ -489,7 +489,6 @@
D0EFF33023198D3200CF5164 /* NavigationBackArrowLight@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D0EFF32E23198D3200CF5164 /* NavigationBackArrowLight@2x.png */; };
D0EFF33123198D3200CF5164 /* NavigationShadow@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = D0EFF32F23198D3200CF5164 /* NavigationShadow@2x.png */; };
D0F575132083B96B00F1C1E1 /* CloudKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0F575122083B96B00F1C1E1 /* CloudKit.framework */; };
D0FC1948201D2DA800FEDBB2 /* SFCompactRounded-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = D0FC1947201D2DA700FEDBB2 /* SFCompactRounded-Semibold.otf */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
@ -1306,7 +1305,6 @@
D0EFF32E23198D3200CF5164 /* NavigationBackArrowLight@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "NavigationBackArrowLight@2x.png"; path = "Telegram-iOS/Resources/NavigationBackArrowLight@2x.png"; sourceTree = "<group>"; };
D0EFF32F23198D3200CF5164 /* NavigationShadow@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "NavigationShadow@2x.png"; path = "Telegram-iOS/Resources/NavigationShadow@2x.png"; sourceTree = "<group>"; };
D0F575122083B96B00F1C1E1 /* CloudKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CloudKit.framework; path = System/Library/Frameworks/CloudKit.framework; sourceTree = SDKROOT; };
D0FC1947201D2DA700FEDBB2 /* SFCompactRounded-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; name = "SFCompactRounded-Semibold.otf"; path = "Telegram-iOS/Resources/SFCompactRounded-Semibold.otf"; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
@ -2281,7 +2279,6 @@
D0E8B8A92044496C00605593 /* voip_end.caf */,
D0E8B8AA2044496C00605593 /* voip_fail.caf */,
D0E8B8AB2044496C00605593 /* voip_ringback.caf */,
D0FC1947201D2DA700FEDBB2 /* SFCompactRounded-Semibold.otf */,
D0CFBB921FD88C2900B65C0D /* begin_record.caf */,
D04DCC0A1F71C80000B021D7 /* notifications */,
D050F21B1E49DEDE00988324 /* intro */,
@ -3353,7 +3350,6 @@
D0CE6F5D213EDA4400BCD44B /* AppIntentVocabulary.plist in Resources */,
D0CE6F61213EDA4400BCD44B /* Localizable.strings in Resources */,
D04DCC311F71C80000B021D7 /* 4.m4a in Resources */,
D0FC1948201D2DA800FEDBB2 /* SFCompactRounded-Semibold.otf in Resources */,
D0EFF31C2319838800CF5164 /* anim_mute.json in Resources */,
D04DCC331F71C80000B021D7 /* 6.m4a in Resources */,
D04DCC251F71C80000B021D7 /* 102.m4a in Resources */,

View File

@ -223,7 +223,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>${BUILD_NUMBER}</string>
<string>99999</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded</key>
<false/>
</dict>
</plist>

View File

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><Scheme LastUpgradeVersion="9999" version="1.7" wasCreatedForAppExtension="YES"><BuildAction buildImplicitDependencies="YES" parallelizeBuildables="YES"><BuildActionEntries><BuildActionEntry buildForAnalyzing="YES" buildForArchiving="YES" buildForProfiling="YES" buildForRunning="YES" buildForTesting="YES"><BuildableReference BlueprintIdentifier="E66DC04EB2C34D2100000000" BlueprintName="Telegram" BuildableIdentifier="primary" BuildableName="Telegram.app" ReferencedContainer="container:Project.xcodeproj"/></BuildActionEntry><BuildActionEntry buildForAnalyzing="YES" buildForArchiving="YES" buildForProfiling="YES" buildForRunning="YES" buildForTesting="YES"><BuildableReference BlueprintIdentifier="E66DC04EE64F555800000000" BlueprintName="ShareExtension" BuildableIdentifier="primary" BuildableName="ShareExtension.appex" ReferencedContainer="container:Project.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction><TestAction buildConfiguration="Debug" shouldUseLaunchSchemeArgsEnv="YES"><Testables/></TestAction><LaunchAction buildConfiguration="Debug" launchStyle="0"><BuildableProductRunnable><BuildableReference BlueprintIdentifier="E66DC04EB2C34D2100000000" BlueprintName="Telegram" BuildableIdentifier="primary" BuildableName="Telegram.app" ReferencedContainer="container:Project.xcodeproj"/></BuildableProductRunnable></LaunchAction><ProfileAction buildConfiguration="Release" shouldUseLaunchSchemeArgsEnv="YES"><BuildableProductRunnable><BuildableReference BlueprintIdentifier="E66DC04EB2C34D2100000000" BlueprintName="Telegram" BuildableIdentifier="primary" BuildableName="Telegram.app" ReferencedContainer="container:Project.xcodeproj"/></BuildableProductRunnable></ProfileAction><AnalyzeAction buildConfiguration="Debug"/><ArchiveAction buildConfiguration="Release" revealArchiveInOrganizer="YES"/></Scheme>

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,8 @@
import Foundation
import AppBundle
private func loadCountriesInfo() -> [(Int, String, String)] {
guard let filePath = Bundle.main.path(forResource: "PhoneCountries", ofType: "txt") else {
guard let filePath = getAppBundle().path(forResource: "PhoneCountries", ofType: "txt") else {
return []
}
guard let stringData = try? Data(contentsOf: URL(fileURLWithPath: filePath)) else {

View File

@ -7,6 +7,7 @@ import TelegramCore
import TelegramPresentationData
import ActivityIndicator
import AccountContext
import AppBundle
public struct LanguageSuggestionControllerStrings {
let ChooseLanguage: String
@ -334,7 +335,7 @@ public func languageSuggestionController(context: AccountContext, suggestedLocal
let theme = context.sharedContext.currentPresentationData.with { $0 }.theme
let strings = LanguageSuggestionControllerStrings(localization: suggestedLocalization)
guard let mainPath = Bundle.main.path(forResource: "en", ofType: "lproj") else {
guard let mainPath = getAppBundle().path(forResource: "en", ofType: "lproj") else {
return nil
}
let englishStrings = LanguageSuggestionControllerStrings(bundle: Bundle(path: mainPath))

View File

@ -9,6 +9,7 @@ import TelegramPresentationData
import ItemListUI
import AccountContext
import TelegramStringFormatting
import AppBundle
private struct NotificationSoundSelectionArguments {
let account: Account
@ -223,7 +224,7 @@ public func playSound(context: AccountContext, sound: PeerMessageSound, defaultS
var deactivateImpl: (() -> Void)?
let session = context.sharedContext.mediaManager.audioSession.push(audioSessionType: .play, activate: { _ in
Queue.mainQueue().async {
if let url = Bundle.main.url(forResource: fileNameForNotificationSound(sound, defaultSound: defaultSound), withExtension: "m4a") {
if let url = getAppBundle().url(forResource: fileNameForNotificationSound(sound, defaultSound: defaultSound), withExtension: "m4a") {
currentPlayer = AudioPlayerWrapper(url: url, completed: {
deactivateImpl?()
})

View File

@ -1,71 +1 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "9999"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E66DC04E89A74F8D00000000"
BuildableName = "libSwiftSignalKit.dylib"
BlueprintName = "SwiftSignalKit#shared"
ReferencedContainer = "container:SwiftSignalKit.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "E66DC04E89A74F8D00000000"
BuildableName = "libSwiftSignalKit.dylib"
BlueprintName = "SwiftSignalKit#shared"
ReferencedContainer = "container:SwiftSignalKit.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
<?xml version="1.0" encoding="UTF-8" standalone="no"?><Scheme LastUpgradeVersion="9999" version="1.7"><BuildAction buildImplicitDependencies="YES" parallelizeBuildables="YES"><BuildActionEntries><BuildActionEntry buildForAnalyzing="YES" buildForArchiving="YES" buildForProfiling="YES" buildForRunning="YES" buildForTesting="YES"><BuildableReference BlueprintIdentifier="E66DC04E89A74F8D00000000" BlueprintName="SwiftSignalKit" BuildableIdentifier="primary" BuildableName="libSwiftSignalKit.dylib" ReferencedContainer="container:SwiftSignalKit.xcodeproj"/></BuildActionEntry></BuildActionEntries></BuildAction><TestAction buildConfiguration="Debug" shouldUseLaunchSchemeArgsEnv="YES"><Testables/></TestAction><LaunchAction buildConfiguration="Debug"/><ProfileAction buildConfiguration="Release"/><AnalyzeAction buildConfiguration="Debug"/><ArchiveAction buildConfiguration="Release" revealArchiveInOrganizer="YES"/></Scheme>

View File

@ -6,6 +6,7 @@ import SwiftSignalKit
import TelegramCore
import TelegramPresentationData
import ItemListUI
import AppBundle
private func generateBorderImage(theme: PresentationTheme, bordered: Bool, selected: Bool) -> UIImage? {
return generateImage(CGSize(width: 30.0, height: 30.0), rotatedContext: { size, context in
@ -274,7 +275,7 @@ class ThemeSettingsAppIconItemNode: ListViewItemNode, ItemListItemNode {
updated = true
}
if let image = UIImage(named: icon.imageName, in: Bundle.main, compatibleWith: nil) {
if let image = UIImage(named: icon.imageName, in: getAppBundle(), compatibleWith: nil) {
let selected = icon.name == item.currentIconName
if selected {
selectedNode = imageNode

View File

@ -1,3 +1,4 @@
import Foundation
import AppBundle
public let defaultPresentationStrings = PresentationStrings(primaryComponent: PresentationStringsComponent(languageCode: "en", localizedName: "English", pluralizationRulesCode: nil, dict: NSDictionary(contentsOf: URL(fileURLWithPath: Bundle.main.path(forResource: "Localizable", ofType: "strings", inDirectory: nil, forLocalization: "en")!)) as! [String : String]), secondaryComponent: nil, groupingSeparator: "")
public let defaultPresentationStrings = PresentationStrings(primaryComponent: PresentationStringsComponent(languageCode: "en", localizedName: "English", pluralizationRulesCode: nil, dict: NSDictionary(contentsOf: URL(fileURLWithPath: getAppBundle().path(forResource: "Localizable", ofType: "strings", inDirectory: nil, forLocalization: "en")!)) as! [String : String]), secondaryComponent: nil, groupingSeparator: "")

View File

@ -2,7 +2,7 @@ import Foundation
import AppBundle
private let fallbackDict: [String: String] = {
guard let mainPath = Bundle.main.path(forResource: "en", ofType: "lproj"), let bundle = Bundle(path: mainPath) else {
guard let mainPath = getAppBundle().path(forResource: "en", ofType: "lproj"), let bundle = Bundle(path: mainPath) else {
return [:]
}
guard let path = bundle.path(forResource: "Localizable", ofType: "strings") else {