From d04bde4030cbad77d77bbd9b9e42e57a33d7b6b0 Mon Sep 17 00:00:00 2001 From: Peter <> Date: Tue, 16 Jul 2019 18:29:55 +0100 Subject: [PATCH] Build scripts --- buildbox/build-telegram.sh | 4 +++- buildbox/guest-build-telegram.sh | 6 +++++- submodules/MtProtoKit/TON/TON.mm | 12 ++++-------- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/buildbox/build-telegram.sh b/buildbox/build-telegram.sh index ef9ab5d8be..fe570e8a7a 100644 --- a/buildbox/build-telegram.sh +++ b/buildbox/build-telegram.sh @@ -44,6 +44,8 @@ BUILD_CONFIGURATION="$1" if [ "$BUILD_CONFIGURATION" == "hockeyapp" ]; then CODESIGNING_SUBPATH="transient-data/codesigning" +elif [ "$BUILD_CONFIGURATION" == "testinghockeyapp" ]; then + CODESIGNING_SUBPATH="transient-data/codesigning" elif [ "$BUILD_CONFIGURATION" == "appstore" ]; then CODESIGNING_SUBPATH="transient-data/codesigning" elif [ "$BUILD_CONFIGURATION" == "verify" ]; then @@ -65,7 +67,7 @@ fi BASE_DIR=$(pwd) -if [ "$BUILD_CONFIGURATION" == "hockeyapp" ] || [ "$BUILD_CONFIGURATION" == "appstore" ]; then +if [ "$BUILD_CONFIGURATION" == "hockeyapp" ] || [ "$BUILD_CONFIGURATION" == "testinghockeyapp" ] || [ "$BUILD_CONFIGURATION" == "appstore" ]; then if [ ! `which setup-telegram-build.sh` ]; then echo "setup-telegram-build.sh not found in PATH $PATH" exit 1 diff --git a/buildbox/guest-build-telegram.sh b/buildbox/guest-build-telegram.sh index fba3cd7d97..950f02e7ce 100644 --- a/buildbox/guest-build-telegram.sh +++ b/buildbox/guest-build-telegram.sh @@ -10,10 +10,14 @@ if [ -z "COMMIT_ID" ]; then exit 1 fi -if [ "$1" == "hockeyapp" ]; then +if [ "$1" == "hockeyapp" ] || [ "$1" == "testinghockeyapp" ]; then FASTLANE_BUILD_CONFIGURATION="internalhockeyapp" CERTS_PATH="codesigning_data/certs" PROFILES_PATH="codesigning_data/profiles" +elif [ "$1" == "testinghockeyapp-local" ]; then + FASTLANE_BUILD_CONFIGURATION="testinghockeyapp" + CERTS_PATH="codesigning_data/certs" + PROFILES_PATH="codesigning_data/profiles" elif [ "$1" == "appstore" ]; then FASTLANE_BUILD_CONFIGURATION="testflight_llc" if [ -z "$TELEGRAM_BUILD_APPSTORE_PASSWORD" ]; then diff --git a/submodules/MtProtoKit/TON/TON.mm b/submodules/MtProtoKit/TON/TON.mm index 9f58c445ac..8cedfcd4ed 100644 --- a/submodules/MtProtoKit/TON/TON.mm +++ b/submodules/MtProtoKit/TON/TON.mm @@ -36,14 +36,14 @@ using tonlib_api::make_object; @interface TONReceiveThreadParams : NSObject -@property (nonatomic, readonly) tonlib::Client *client; +@property (nonatomic, readonly) std::shared_ptr client; @property (nonatomic, copy, readonly) void (^received)(tonlib::Client::Response &); @end @implementation TONReceiveThreadParams -- (instancetype)initWithClient:(tonlib::Client *)client received:(void (^)(tonlib::Client::Response &))received { +- (instancetype)initWithClient:(std::shared_ptr)client received:(void (^)(tonlib::Client::Response &))received { self = [super init]; if (self != nil) { _client = client; @@ -85,7 +85,7 @@ using tonlib_api::make_object; @end @interface TON () { - tonlib::Client *_client; + std::shared_ptr _client; uint64_t _nextRequestId; NSLock *_requestHandlersLock; NSMutableDictionary *_requestHandlers; @@ -114,7 +114,7 @@ using tonlib_api::make_object; _initialized.sink(@false); _nextRequestId = 1; - _client = new tonlib::Client; + _client = std::make_shared(); NSLock *requestHandlersLock = _requestHandlersLock; NSMutableDictionary *requestHandlers = _requestHandlers; @@ -139,10 +139,6 @@ using tonlib_api::make_object; return self; } -- (void)dealloc { - delete _client; -} - - (MTSignal *)requestInitWithConfigString:(NSString *)configString keystoreDirectory:(NSString *)keystoreDirectory { return [[[[MTSignal alloc] initWithGenerator:^id(MTSubscriber *subscriber) { uint64_t requestId = _nextRequestId;