Build MtProtoKit

This commit is contained in:
Ali 2020-02-20 01:37:54 +04:00
parent 9e46520b5f
commit a7ff727533
196 changed files with 323 additions and 563 deletions

View File

@ -118,11 +118,13 @@ swift_library(
"//submodules/rlottie:RLottieBinding",
"//submodules/AnimatedStickerNode:AnimatedStickerNode",
"//submodules/WalletUI:WalletUI",
"//submodules/WebsiteType:WebsiteType",
"//submodules/MtProtoKit:MtProtoKit",
],
)
additional_info_plist = telegram_info_plist(
name = "AdditionalInfo.plist",
name = "AdditionalInfoPlist",
app_name = "Telegram",
url_scheme = "tg",
bundle_id_define = "telegram_bundle_id",
@ -130,21 +132,15 @@ additional_info_plist = telegram_info_plist(
build_number_define = "telegram_build_number",
)
provisioning_profile = file_from_define(
name = "TelegramProvisioningProfile",
extension = "mobileprovision",
define_name = "telegram_provisioning_profile",
)
ios_application(
name = "Telegram",
bundle_id = "{telegram_bundle_id}",
families = ["iphone", "ipad"],
minimum_os_version = "9.0",
provisioning_profile = ":TelegramProvisioningProfile",
provisioning_profile = "//build-input/data/provisioning-profiles:App.mobileprovision",
infoplists = [
"Info.plist",
":AdditionalInfo.plist",
":AdditionalInfoPlist",
],
frameworks = [
#":AsyncDisplayKitFramework",

View File

@ -43,7 +43,6 @@ def _telegram_info_plist(ctx):
<string>{app_name}.compatibility</string>
<key>CFBundleURLSchemes</key>
<array>
<string>tg</string>
<string>{url_scheme}</string>
</array>
</dict>

View File

@ -12,16 +12,29 @@ touch "build-input/data/BUILD"
OUTPUT_DIRECTORY="build-input/data/provisioning-profiles"
rm -rf "$OUTPUT_DIRECTORY"
mkdir -p "$OUTPUT_DIRECTORY"
touch "$OUTPUT_DIRECTORY/BUILD"
BUILD_PATH="$OUTPUT_DIRECTORY/BUILD"
touch "$BUILD_PATH"
echo "exports_files([" >> "$BUILD_PATH"
SEARCH_NAMES=($@)
ELEMENT_COUNT=${#SEARCH_NAMES[@]}
REMAINDER=$(($ELEMENT_COUNT % 2))
if [ $REMAINDER != 0 ]; then
>&2 echo "Expecting key-value pairs"
exit 1
fi
declare -A FOUND_PROFILES
for PROFILE in `find "$PROVISIONING_PROFILE_SEARCH_PATH" -type f -name "*.mobileprovision"`; do
PROFILE_DATA=$(security cms -D -i "$PROFILE")
PROFILE_NAME=$(/usr/libexec/PlistBuddy -c "Print :Name" /dev/stdin <<< $(echo $PROFILE_DATA))
for SEARCH_NAME in $SEARCH_NAMES; do
for (( i=1; i<$ELEMENT_COUNT+1; i=i+2 )); do
ID=${SEARCH_NAMES[$i]}
SEARCH_NAME=${SEARCH_NAMES[$(($i + 1))]}
if [ "$PROFILE_NAME" = "$SEARCH_NAME" ]; then
if [ "${FOUND_PROFILES[\"$SEARCH_NAME\"]}" = "" ]; then
FOUND_PROFILES["$SEARCH_NAME"]="$PROFILE"
@ -33,12 +46,17 @@ for PROFILE in `find "$PROVISIONING_PROFILE_SEARCH_PATH" -type f -name "*.mobile
done
done
for SEARCH_NAME in $SEARCH_NAMES; do
for (( i=1; i<$ELEMENT_COUNT+1; i=i+2 )); do
ID=${SEARCH_NAMES[$i]}
SEARCH_NAME=${SEARCH_NAMES[$(($i + 1))]}
FOUND_PROFILE="${FOUND_PROFILES[\"$SEARCH_NAME\"]}"
if [ "$FOUND_PROFILE" = "" ]; then
>&2 echo "Profile \"$SEARCH_NAME\" not found"
exit 1
fi
cp "$FOUND_PROFILE" "$OUTPUT_DIRECTORY/"
cp "$FOUND_PROFILE" "$OUTPUT_DIRECTORY/$ID.mobileprovision"
echo " \"$ID.mobileprovision\"," >> $BUILD_PATH
done
echo "])" >> "$BUILD_PATH"

View File

@ -1,19 +0,0 @@
//
// AlertUI.h
// AlertUI
//
// Created by Peter on 8/10/19.
// Copyright © 2019 Telegram Messenger LLP. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for AlertUI.
FOUNDATION_EXPORT double AlertUIVersionNumber;
//! Project version string for AlertUI.
FOUNDATION_EXPORT const unsigned char AlertUIVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <AlertUI/PublicHeader.h>

View File

@ -3,79 +3,14 @@ load("//Config:buck_rule_macros.bzl", "static_library", "framework", "glob_map",
framework(
name = "MtProtoKit",
srcs = glob([
"*.m",
"MtProtoKit/*.m",
"thirdparty/AFNetworking/*.m",
"thirdparty/AsyncSocket/*.m",
"Sources/*.m",
]),
headers = merge_maps([
glob_map(glob([
"*.h",
"MtProtoKit/*.h",
"thirdparty/AFNetworking/*.h",
"thirdparty/AsyncSocket/*.h",
])),
headers = glob([
"Sources/*.h",
]),
exported_headers = glob([
"PublicHeaders/**/*.h",
]),
exported_headers = [
"MtProtoKit/MTTime.h",
"MtProtoKit/MTTimer.h",
"MtProtoKit/MTLogging.h",
"MtProtoKit/MTEncryption.h",
"MtProtoKit/MTInternalId.h",
"MtProtoKit/MTQueue.h",
"MtProtoKit/MTOutputStream.h",
"MtProtoKit/MTInputStream.h",
"MtProtoKit/MTSerialization.h",
"MtProtoKit/MTExportedAuthorizationData.h",
"MtProtoKit/MTRpcError.h",
"MtProtoKit/MTKeychain.h",
"MtProtoKit/MTFileBasedKeychain.h",
"MtProtoKit/MTContext.h",
"MtProtoKit/MTTransportScheme.h",
"MtProtoKit/MTDatacenterTransferAuthAction.h",
"MtProtoKit/MTDatacenterAuthAction.h",
"MtProtoKit/MTDatacenterAuthMessageService.h",
"MtProtoKit/MTDatacenterAddress.h",
"MtProtoKit/MTDatacenterAddressSet.h",
"MtProtoKit/MTDatacenterAuthInfo.h",
"MtProtoKit/MTDatacenterSaltInfo.h",
"MtProtoKit/MTDatacenterAddressListData.h",
"MtProtoKit/MTProto.h",
"MtProtoKit/MTSessionInfo.h",
"MtProtoKit/MTTimeFixContext.h",
"MtProtoKit/MTPreparedMessage.h",
"MtProtoKit/MTOutgoingMessage.h",
"MtProtoKit/MTIncomingMessage.h",
"MtProtoKit/MTMessageEncryptionKey.h",
"MtProtoKit/MTMessageService.h",
"MtProtoKit/MTMessageTransaction.h",
"MtProtoKit/MTTimeSyncMessageService.h",
"MtProtoKit/MTRequestMessageService.h",
"MtProtoKit/MTRequest.h",
"MtProtoKit/MTRequestContext.h",
"MtProtoKit/MTRequestErrorContext.h",
"MtProtoKit/MTDropResponseContext.h",
"MtProtoKit/MTApiEnvironment.h",
"MtProtoKit/MTResendMessageService.h",
"MtProtoKit/MTNetworkAvailability.h",
"MtProtoKit/MTTransport.h",
"MtProtoKit/MTTransportTransaction.h",
"MtProtoKit/MTTcpTransport.h",
"MtProtoKit/MTHttpRequestOperation.h",
"MTAtomic.h",
"MTBag.h",
"MTDisposable.h",
"MTSubscriber.h",
"MTSignal.h",
"MTNetworkUsageCalculationInfo.h",
"MTNetworkUsageManager.h",
"MTBackupAddressSignals.h",
"thirdparty/AFNetworking/AFURLConnectionOperation.h",
"thirdparty/AFNetworking/AFHTTPRequestOperation.h",
"MTProxyConnectivity.h",
"MTGzip.h",
"MTDatacenterVerificationData.h",
],
visibility = ["PUBLIC"],
deps = [
"//submodules/EncryptionProvider:EncryptionProvider",

View File

@ -0,0 +1,27 @@
objc_library(
name = "MtProtoKit",
enable_modules = True,
module_name = "MtProtoKit",
srcs = glob([
"Sources/*.m",
"Sources/*.h",
]),
hdrs = glob([
"PublicHeaders/**/*.h",
]),
includes = [
"PublicHeaders",
],
deps = [
"//submodules/EncryptionProvider:EncryptionProvider",
],
sdk_frameworks = [
"Foundation",
"Security",
"SystemConfiguration",
],
visibility = [
"//visibility:public",
],
)

View File

@ -1,26 +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>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<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>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>

View File

@ -1,3 +0,0 @@
#import "MTKeychain.h"

View File

@ -1,76 +0,0 @@
//
// MtProtoKit.h
// MtProtoKit
//
// Created by Peter on 13/04/15.
// Copyright (c) 2015 Telegram. All rights reserved.
//
#import <UIKit/UIKit.h>
//! Project version number for MtProtoKit.
FOUNDATION_EXPORT double MtProtoKitVersionNumber;
//! Project version string for MtProtoKit.
FOUNDATION_EXPORT const unsigned char MtProtoKitVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <MtProtoKit/PublicHeader.h>
#import <MtProtoKit/MTTime.h>
#import <MtProtoKit/MTTimer.h>
#import <MtProtoKit/MTLogging.h>
#import <MtProtoKit/MTEncryption.h>
#import <MtProtoKit/MTInternalId.h>
#import <MtProtoKit/MTQueue.h>
#import <MtProtoKit/MTOutputStream.h>
#import <MtProtoKit/MTInputStream.h>
#import <MtProtoKit/MTSerialization.h>
#import <MtProtoKit/MTExportedAuthorizationData.h>
#import <MtProtoKit/MTRpcError.h>
#import <MtProtoKit/MTKeychain.h>
#import <MtProtoKit/MTFileBasedKeychain.h>
#import <MtProtoKit/MTContext.h>
#import <MtProtoKit/MTTransportScheme.h>
#import <MtProtoKit/MTDatacenterTransferAuthAction.h>
#import <MtProtoKit/MTDatacenterAuthAction.h>
#import <MtProtoKit/MTDatacenterAuthMessageService.h>
#import <MtProtoKit/MTDatacenterAddress.h>
#import <MtProtoKit/MTDatacenterAddressSet.h>
#import <MtProtoKit/MTDatacenterAuthInfo.h>
#import <MtProtoKit/MTDatacenterSaltInfo.h>
#import <MtProtoKit/MTDatacenterAddressListData.h>
#import <MtProtoKit/MTProto.h>
#import <MtProtoKit/MTSessionInfo.h>
#import <MtProtoKit/MTTimeFixContext.h>
#import <MtProtoKit/MTPreparedMessage.h>
#import <MtProtoKit/MTOutgoingMessage.h>
#import <MtProtoKit/MTIncomingMessage.h>
#import <MtProtoKit/MTMessageEncryptionKey.h>
#import <MtProtoKit/MTMessageService.h>
#import <MtProtoKit/MTMessageTransaction.h>
#import <MtProtoKit/MTTimeSyncMessageService.h>
#import <MtProtoKit/MTRequestMessageService.h>
#import <MtProtoKit/MTRequest.h>
#import <MtProtoKit/MTRequestContext.h>
#import <MtProtoKit/MTRequestErrorContext.h>
#import <MtProtoKit/MTDropResponseContext.h>
#import <MtProtoKit/MTApiEnvironment.h>
#import <MtProtoKit/MTResendMessageService.h>
#import <MtProtoKit/MTNetworkAvailability.h>
#import <MtProtoKit/MTTransport.h>
#import <MtProtoKit/MTTransportTransaction.h>
#import <MtProtoKit/MTTcpTransport.h>
#import <MtProtoKit/MTHttpRequestOperation.h>
#import <MtProtoKit/MTAtomic.h>
#import <MtProtoKit/MTBag.h>
#import <MtProtoKit/MTDisposable.h>
#import <MtProtoKit/MTSubscriber.h>
#import <MtProtoKit/MTSignal.h>
#import <MtProtoKit/MTNetworkUsageCalculationInfo.h>
#import <MtProtoKit/MTNetworkUsageManager.h>
#import <MtProtoKit/MTBackupAddressSignals.h>
#import <MtProtoKit/AFURLConnectionOperation.h>
#import <MtProtoKit/AFHTTPRequestOperation.h>
#import <MtProtoKit/MTProxyConnectivity.h>
#import <MtProtoKit/MTGzip.h>

View File

@ -1,13 +0,0 @@
//
// MTRequestErrorContext.m
// MtProtoKit
//
// Created by Admin on 18/02/2014.
// Copyright (c) 2014 Telegram. All rights reserved.
//
#import "MTRequestErrorContext.h"
@implementation MTRequestErrorContext
@end

View File

@ -1,4 +0,0 @@
MtProtoKit
==========
Universal MTProto framework for both iOS and OS X

View File

@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "AFHTTPRequestOperation.h"
#import <MtProtoKit/AFHTTPRequestOperation.h>
static NSString * AFStringFromIndexSet(NSIndexSet *indexSet) {
NSMutableString *string = [NSMutableString string];

View File

@ -20,7 +20,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "AFURLConnectionOperation.h"
#import <MtProtoKit/AFURLConnectionOperation.h>
//#import "AFImageRequestOperation.h"

View File

@ -10,7 +10,7 @@
#import "GCDAsyncSocket.h"
#import "MTLogging.h"
#import <MtProtoKit/MTLogging.h>
#if TARGET_OS_IPHONE
#import <CFNetwork/CFNetwork.h>
@ -30,8 +30,8 @@
#import <sys/uio.h>
#import <unistd.h>
#import "MTNetworkUsageCalculationInfo.h"
#import "MTNetworkUsageManager.h"
#import <MtProtoKit/MTNetworkUsageCalculationInfo.h>
#import <MtProtoKit/MTNetworkUsageManager.h>
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"

View File

@ -1,6 +1,4 @@
#import "MTApiEnvironment.h"
#import <MtProtoKit/MTApiEnvironment.h>
#if TARGET_OS_IPHONE
# import <UIKit/UIKit.h>

View File

@ -1,4 +1,4 @@
#import "MTAtomic.h"
#import <MtProtoKit/MTAtomic.h>
#import <libkern/OSAtomic.h>

View File

@ -1,4 +1,4 @@
#import "MTBackupAddressSignals.h"
#import <MtProtoKit/MTBackupAddressSignals.h>
#import <MtProtoKit/MTSignal.h>
#import <MtProtoKit/MTQueue.h>

View File

@ -1,4 +1,4 @@
#import "MTBag.h"
#import <MtProtoKit/MTBag.h>
@interface MTBag ()
{

View File

@ -1,27 +1,26 @@
#import "MTContext.h"
#import <MtProtoKit/MTContext.h>
#import <inttypes.h>
#import "MTLogging.h"
#import "MTTimer.h"
#import "MTQueue.h"
#import "MTKeychain.h"
#import "MTDatacenterAddressSet.h"
#import "MTDatacenterAddress.h"
#import "MTDatacenterAuthInfo.h"
#import "MTDatacenterSaltInfo.h"
#import "MTSessionInfo.h"
#import "MTApiEnvironment.h"
#import <MtProtoKit/MTLogging.h>
#import <MtProtoKit/MTTimer.h>
#import <MtProtoKit/MTQueue.h>
#import <MtProtoKit/MTKeychain.h>
#import <MtProtoKit/MTDatacenterAddressSet.h>
#import <MtProtoKit/MTDatacenterAddress.h>
#import <MtProtoKit/MTDatacenterAuthInfo.h>
#import <MtProtoKit/MTDatacenterSaltInfo.h>
#import <MtProtoKit/MTSessionInfo.h>
#import <MtProtoKit/MTApiEnvironment.h>
#import "MTDiscoverDatacenterAddressAction.h"
#import "MTDatacenterAuthAction.h"
#import "MTDatacenterTransferAuthAction.h"
#import <MtProtoKit/MTDatacenterAuthAction.h>
#import <MtProtoKit/MTDatacenterTransferAuthAction.h>
#import "MTTransportScheme.h"
#import "MTTcpTransport.h"
#import <MtProtoKit/MTTransportScheme.h>
#import <MtProtoKit/MTTcpTransport.h>
#import "MTApiEnvironment.h"
#import <MtProtoKit/MTApiEnvironment.h>
#import <libkern/OSAtomic.h>

View File

@ -1,6 +1,4 @@
#import "MTDatacenterAddress.h"
#import <MtProtoKit/MTDatacenterAddress.h>
#import <netinet/in.h>
#import <arpa/inet.h>

View File

@ -1,4 +1,4 @@
#import "MTDatacenterAddressListData.h"
#import <MtProtoKit/MTDatacenterAddressListData.h>
@implementation MTDatacenterAddressListData

View File

@ -1,8 +1,6 @@
#import <MtProtoKit/MTDatacenterAddressSet.h>
#import "MTDatacenterAddressSet.h"
#import "MTDatacenterAddress.h"
#import <MtProtoKit/MTDatacenterAddress.h>
@implementation MTDatacenterAddressSet

View File

@ -1,21 +1,17 @@
#import "MTDatacenterAuthAction.h"
#import "MTLogging.h"
#import "MTContext.h"
#import "MTProto.h"
#import "MTRequest.h"
#import "MTDatacenterSaltInfo.h"
#import "MTDatacenterAuthInfo.h"
#import "MTApiEnvironment.h"
#import "MTSerialization.h"
#import "MTDatacenterAddressSet.h"
#import <MtProtoKit/MTDatacenterAuthAction.h>
#import <MtProtoKit/MTLogging.h>
#import <MtProtoKit/MTContext.h>
#import <MtProtoKit/MTProto.h>
#import <MtProtoKit/MTRequest.h>
#import <MtProtoKit/MTDatacenterSaltInfo.h>
#import <MtProtoKit/MTDatacenterAuthInfo.h>
#import <MtProtoKit/MTApiEnvironment.h>
#import <MtProtoKit/MTSerialization.h>
#import <MtProtoKit/MTDatacenterAddressSet.h>
#import <MtProtoKit/MTSignal.h>
#import "MTDatacenterAuthMessageService.h"
#import "MTRequestMessageService.h"
#import <MtProtoKit/MTDatacenterAuthMessageService.h>
#import <MtProtoKit/MTRequestMessageService.h>
#import "MTBuffer.h"
@interface MTDatacenterAuthAction () <MTDatacenterAuthMessageServiceDelegate>

View File

@ -1,5 +1,5 @@
#import "MTDatacenterAuthInfo.h"
#import "MTDatacenterSaltInfo.h"
#import <MtProtoKit/MTDatacenterAuthInfo.h>
#import <MtProtoKit/MTDatacenterSaltInfo.h>
@implementation MTDatacenterAuthKey

View File

@ -1,18 +1,18 @@
#import "MTDatacenterAuthMessageService.h"
#import <MtProtoKit/MTDatacenterAuthMessageService.h>
#import "MTLogging.h"
#import "MTContext.h"
#import "MTProto.h"
#import "MTSerialization.h"
#import "MTSessionInfo.h"
#import "MTIncomingMessage.h"
#import "MTOutgoingMessage.h"
#import "MTMessageTransaction.h"
#import "MTPreparedMessage.h"
#import "MTDatacenterAuthInfo.h"
#import "MTDatacenterSaltInfo.h"
#import <MtProtoKit/MTLogging.h>
#import <MtProtoKit/MTContext.h>
#import <MtProtoKit/MTProto.h>
#import <MtProtoKit/MTSerialization.h>
#import <MtProtoKit/MTSessionInfo.h>
#import <MtProtoKit/MTIncomingMessage.h>
#import <MtProtoKit/MTOutgoingMessage.h>
#import <MtProtoKit/MTMessageTransaction.h>
#import <MtProtoKit/MTPreparedMessage.h>
#import <MtProtoKit/MTDatacenterAuthInfo.h>
#import <MtProtoKit/MTDatacenterSaltInfo.h>
#import "MTBuffer.h"
#import "MTEncryption.h"
#import <MtProtoKit/MTEncryption.h>
#import "MTInternalMessageParser.h"
#import "MTServerDhInnerDataMessage.h"

View File

@ -1,6 +1,4 @@
#import "MTDatacenterSaltInfo.h"
#import <MtProtoKit/MTDatacenterSaltInfo.h>
@implementation MTDatacenterSaltInfo

View File

@ -1,12 +1,12 @@
#import "MTDatacenterTransferAuthAction.h"
#import <MtProtoKit/MTDatacenterTransferAuthAction.h>
#import "MTContext.h"
#import "MTSerialization.h"
#import "MTProto.h"
#import "MTRequestMessageService.h"
#import "MTRequest.h"
#import <MtProtoKit/MTContext.h>
#import <MtProtoKit/MTSerialization.h>
#import <MtProtoKit/MTProto.h>
#import <MtProtoKit/MTRequestMessageService.h>
#import <MtProtoKit/MTRequest.h>
#import "MTBuffer.h"
@interface MTDatacenterTransferAuthAction () <MTContextChangeListener>

Some files were not shown because too many files have changed in this diff Show More